From 42582722cb0f2c0a38e4a6fa2cba23eb05264a3f Mon Sep 17 00:00:00 2001 From: Milos Kotlar Date: Wed, 24 May 2023 17:55:07 +0200 Subject: [PATCH] [mono][aot] Deduplicate runtime invoke wrappers on iOS (#85908) * Deduplicate runtime invoke wrappers on iOS * Move log to the add_extra_method_full --- src/mono/mono/mini/aot-compiler.c | 6 +++--- src/mono/mono/mini/aot-runtime.c | 5 ----- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/mono/mono/mini/aot-compiler.c b/src/mono/mono/mini/aot-compiler.c index 52147fcbec951..33d4e9db4f01b 100644 --- a/src/mono/mono/mini/aot-compiler.c +++ b/src/mono/mono/mini/aot-compiler.c @@ -4334,6 +4334,9 @@ 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)); @@ -4420,9 +4423,6 @@ 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 261f95bc82091..6da9d27bfc802 100644 --- a/src/mono/mono/mini/aot-runtime.c +++ b/src/mono/mono/mini/aot-runtime.c @@ -4555,12 +4555,7 @@ 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);