diff options
-rw-r--r-- | mono/mini/aot-runtime.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/mono/mini/aot-runtime.c b/mono/mini/aot-runtime.c index 941d5017d0f..2fd57cf8561 100644 --- a/mono/mini/aot-runtime.c +++ b/mono/mini/aot-runtime.c @@ -3936,15 +3936,18 @@ load_method (MonoDomain *domain, MonoAotModule *amodule, MonoImage *image, MonoM amodule_lock (amodule); - InterlockedIncrement (&mono_jit_stats.methods_aot); - - amodule->methods_loaded [method_index / 32] |= 1 << (method_index % 32); - init_plt (amodule); + InterlockedIncrement (&mono_jit_stats.methods_aot); + if (method && method->wrapper_type) g_hash_table_insert (amodule->method_to_code, method, code); + /* Commit changes since methods_loaded is accessed outside the lock */ + mono_memory_barrier (); + + amodule->methods_loaded [method_index / 32] |= 1 << (method_index % 32); + amodule_unlock (amodule); if (mono_profiler_get_events () & MONO_PROFILE_JIT_COMPILATION) { |