Skip to content

Commit 672c107

Browse files
committed
[mbr] [wasm] Don't automatically turn off inlining
Instead of turning off inlining whenever ENABLE_METADATA_UPDATE is defined in the code, only turn it off when MONO_METADATA_UPDATE is set in the environment. Update the browser MBR sample to use the env var
1 parent bb4f407 commit 672c107

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/mono/netcore/sample/mbr/browser/runtime.js

+3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ var Module = {
66
config.loaded_cb = function () {
77
App.init ();
88
};
9+
config.environment_variables = {
10+
"MONO_METADATA_UPDATE": "1"
11+
};
912
config.fetch_file_cb = function (asset) {
1013
return fetch (asset, { credentials: 'same-origin' });
1114
}

src/mono/wasm/runtime/driver.c

+8-3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ void mono_icall_table_init (void);
4848
void mono_aot_register_module (void **aot_info);
4949
char *monoeg_g_getenv(const char *variable);
5050
int monoeg_g_setenv(const char *variable, const char *value, int overwrite);
51+
int32_t monoeg_g_hasenv(const char *variable);
5152
void mono_free (void*);
5253
int32_t mini_parse_debug_option (const char *option);
5354
char *mono_method_get_full_name (MonoMethod *method);
@@ -466,9 +467,6 @@ EMSCRIPTEN_KEEPALIVE void
466467
mono_wasm_load_runtime (const char *unused, int debug_level)
467468
{
468469
const char *interp_opts = "";
469-
#ifdef ENABLE_METADATA_UPDATE
470-
interp_opts = "-inline"; /* FIXME: EnC hack - make this configurable */
471-
#endif
472470

473471
#ifdef DEBUG
474472
monoeg_g_setenv ("MONO_LOG_LEVEL", "debug", 0);
@@ -505,6 +503,12 @@ mono_wasm_load_runtime (const char *unused, int debug_level)
505503
#else
506504
mono_jit_set_aot_mode (MONO_AOT_MODE_INTERP_ONLY);
507505

506+
#ifdef ENABLE_METADATA_UPDATE
507+
if (monoeg_g_hasenv ("MONO_METADATA_UPDATE")) {
508+
interp_opts = "-inline";
509+
}
510+
#endif
511+
508512
/*
509513
* debug_level > 0 enables debugging and sets the debug log level to debug_level
510514
* debug_level == 0 disables debugging and enables interpreter optimizations
@@ -517,6 +521,7 @@ mono_wasm_load_runtime (const char *unused, int debug_level)
517521
interp_opts = "-all";
518522
mono_wasm_enable_debugging (debug_level);
519523
}
524+
520525
#endif
521526

522527
#ifdef LINK_ICALLS

0 commit comments

Comments
 (0)