From ffa12ccdf0c49c19ddfd9f37895461c6391dc210 Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Fri, 2 Jun 2023 23:15:32 +0200 Subject: [PATCH] Revert "[mono][aot] Deduplicate runtime invoke wrappers on iOS (#85908)" (#87066) We have encountered more frequent failures following the merge as outlined in #85908 (comment), so we will revert the change and try to reproduce the issue locally using the same version of macOS and iPhone as on the CI environment. Reverts #85908 --- src/mono/mono/mini/aot-compiler.c | 6 +++--- src/mono/mono/mini/aot-runtime.c | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mono/mono/mini/aot-compiler.c b/src/mono/mono/mini/aot-compiler.c index d1647930140c9..31feac1cc2e05 100644 --- a/src/mono/mono/mini/aot-compiler.c +++ b/src/mono/mono/mini/aot-compiler.c @@ -4334,9 +4334,6 @@ collect_dedup_method (MonoAotCompile *acfg, MonoMethod *method) static int add_method_full (MonoAotCompile *acfg, MonoMethod *method, gboolean extra, int depth) { - if (collect_dedup_method (acfg, method)) - return -1; - int index; index = GPOINTER_TO_UINT (g_hash_table_lookup (acfg->method_indexes, method)); @@ -4423,6 +4420,9 @@ add_extra_method_full (MonoAotCompile *acfg, MonoMethod *method, gboolean prefer mono_error_assert_ok (error); } + if (collect_dedup_method (acfg, method)) + return; + if (acfg->aot_opts.log_generics) aot_printf (acfg, "%*sAdding method %s.\n", depth, "", mono_method_get_full_name (method)); diff --git a/src/mono/mono/mini/aot-runtime.c b/src/mono/mono/mini/aot-runtime.c index 280d05b6d8f8a..65d9770df555a 100644 --- a/src/mono/mono/mini/aot-runtime.c +++ b/src/mono/mono/mini/aot-runtime.c @@ -4556,7 +4556,12 @@ mono_aot_can_dedup (MonoMethod *method) /* Use a set of wrappers/instances which work and useful */ switch (method->wrapper_type) { case MONO_WRAPPER_RUNTIME_INVOKE: +#ifdef TARGET_WASM return TRUE; +#else + return FALSE; +#endif + break; case MONO_WRAPPER_OTHER: { WrapperInfo *info = mono_marshal_get_wrapper_info (method);