Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / mini / aot-runtime.c
index 01c2fe883933e8922c563f7ba899d0e22c4de338..7330d1cd30a976205ad29f6ae985472c6a8b28ad 100644 (file)
@@ -3957,9 +3957,10 @@ load_method (MonoDomain *domain, MonoAotModule *amodule, MonoImage *image, MonoM
                return code;
 
        if (mono_last_aot_method != -1) {
-               if (mono_jit_stats.methods_aot >= mono_last_aot_method)
-                               return NULL;
-               else if (mono_jit_stats.methods_aot == mono_last_aot_method - 1) {
+               gint32 methods_aot = InterlockedRead (&mono_jit_stats.methods_aot);
+               if (methods_aot >= mono_last_aot_method)
+                       return NULL;
+               else if (methods_aot == mono_last_aot_method - 1) {
                        if (!method) {
                                method = mono_get_method_checked (image, token, NULL, NULL, error);
                                if (!method)
@@ -5143,6 +5144,8 @@ no_trampolines (void)
        g_assert_not_reached ();
 }
 
+
+#ifndef TARGET_WASM
 /*
  * Return the trampoline identified by NAME from the mscorlib AOT file.
  * On ppc64, this returns a function descriptor.
@@ -5159,6 +5162,8 @@ mono_aot_get_trampoline_full (const char *name, MonoTrampInfo **out_tinfo)
 
        return mono_create_ftnptr_malloc ((guint8 *)load_function_full (amodule, name, out_tinfo));
 }
+#endif
+
 
 gpointer
 mono_aot_get_trampoline (const char *name)
@@ -5800,7 +5805,7 @@ mono_aot_is_pagefault (void *ptr)
 void
 mono_aot_handle_pagefault (void *ptr)
 {
-#ifndef PLATFORM_WIN32
+#ifndef HOST_WIN32
        guint8* start = (guint8*)ROUND_DOWN (((gssize)ptr), mono_pagesize ());
        int res;