From 218419e77b886c45bfeedf1bcc0c18ee1d251d98 Mon Sep 17 00:00:00 2001 From: Zoltan Varga Date: Mon, 27 Jul 2020 21:59:29 -0400 Subject: [PATCH] [wasm] Use interp-only instead of interp-llvmonly as the default execution mode. (#20159) * [wasm] Use interp-only instead of interp-llvmonly as the default execution mode. interp-llvmonly caused mono_llvm_only to be set, causing bad behavior like stack walks not working. * Address comments. --- mono/mini/driver.c | 6 +----- mono/mini/jit.h | 2 ++ mono/mini/mini-runtime.h | 4 +--- sdks/wasm/src/driver.c | 4 ++-- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/mono/mini/driver.c b/mono/mini/driver.c index 322a23cef651..aa72d2af850a 100644 --- a/mono/mini/driver.c +++ b/mono/mini/driver.c @@ -2006,10 +2006,6 @@ apply_root_domain_configuration_file_bindings (MonoDomain *domain, char *root_do static void mono_check_interp_supported (void) { -#ifdef DISABLE_INTERPRETER - g_error ("Mono IL interpreter support is missing\n"); -#endif - #ifdef MONO_CROSS_COMPILE g_error ("--interpreter on cross-compile runtimes not supported\n"); #endif @@ -2999,7 +2995,7 @@ mono_runtime_set_execution_mode_full (int mode, gboolean override) mono_llvm_only = TRUE; break; - case MONO_EE_MODE_INTERP: + case MONO_AOT_MODE_INTERP_ONLY: mono_check_interp_supported (); mono_use_interpreter = TRUE; diff --git a/mono/mini/jit.h b/mono/mini/jit.h index 011792c346b4..02639c95122d 100644 --- a/mono/mini/jit.h +++ b/mono/mini/jit.h @@ -65,6 +65,8 @@ typedef enum { MONO_AOT_MODE_INTERP_LLVMONLY, /* Use only llvm compiled code, fall back to the interpeter */ MONO_AOT_MODE_LLVMONLY_INTERP, + /* Same as --interp */ + MONO_AOT_MODE_INTERP_ONLY, /* Sentinel value used internally by the runtime. We use a large number to avoid clashing with some internal values. */ MONO_AOT_MODE_LAST = 1000, } MonoAotMode; diff --git a/mono/mini/mini-runtime.h b/mono/mini/mini-runtime.h index 971d9a59c675..7061283543cc 100644 --- a/mono/mini/mini-runtime.h +++ b/mono/mini/mini-runtime.h @@ -411,11 +411,9 @@ extern MonoEEFeatures mono_ee_features; //XXX this enum *MUST extend MonoAotMode as they are consumed together. typedef enum { - /* Always execute with interp, will use JIT to produce trampolines */ - MONO_EE_MODE_INTERP = MONO_AOT_MODE_LAST, + MONO_EE_MODE_INTERP = MONO_AOT_MODE_INTERP_ONLY, } MonoEEMode; - static inline MonoMethod* jinfo_get_method (MonoJitInfo *ji) { diff --git a/sdks/wasm/src/driver.c b/sdks/wasm/src/driver.c index ff0b2e315bf3..5812bfb81e42 100644 --- a/sdks/wasm/src/driver.c +++ b/sdks/wasm/src/driver.c @@ -158,7 +158,7 @@ mono_wasm_add_assembly (const char *name, const unsigned char *data, unsigned in entry->next = assemblies; assemblies = entry; ++assembly_count; - return mono_has_pdb_checksum (data, size); + return mono_has_pdb_checksum ((char*)data, size); } EMSCRIPTEN_KEEPALIVE void @@ -369,7 +369,7 @@ mono_wasm_load_runtime (const char *managed_path, int enable_debugging) mono_jit_set_aot_mode (MONO_AOT_MODE_LLVMONLY); #endif #else - mono_jit_set_aot_mode (MONO_AOT_MODE_INTERP_LLVMONLY); + mono_jit_set_aot_mode (MONO_AOT_MODE_INTERP_ONLY); if (enable_debugging) { // Disable optimizations which interfere with debugging interp_opts = "-all";