Merge pull request #3436 from ntherning/fix-alt-dir-separator-not-replaced-in-Path...
[mono.git] / mono / mini / aot-runtime.c
index d4eb786235ed89a7de1860e7c2be46fce9e9ecab..afa3a7dd0af38706cfa39638829ec6a420e9fc0b 100644 (file)
@@ -922,9 +922,6 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod
                        }
                        break;
                }
-               case MONO_WRAPPER_STFLD_REMOTE:
-                       ref->method = mono_marshal_get_stfld_remote_wrapper (NULL);
-                       break;
 #endif
                case MONO_WRAPPER_ALLOC: {
                        int atype = decode_value (p, &p);
@@ -933,6 +930,9 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod
                                MANAGED_ALLOCATOR_SLOW_PATH : MANAGED_ALLOCATOR_REGULAR;
 
                        ref->method = mono_gc_get_managed_allocator_by_type (atype, variant);
+                       /* Try to fallback to the slow path version */
+                       if (!ref->method && variant == MANAGED_ALLOCATOR_REGULAR)
+                               ref->method = mono_gc_get_managed_allocator_by_type (atype, MANAGED_ALLOCATOR_SLOW_PATH);
                        if (!ref->method) {
                                mono_error_set_bad_image_name (error, module->aot_name, "Error: No managed allocator, but we need one for AOT.\nAre you using non-standard GC options?\n");
                                return FALSE;
@@ -2002,6 +2002,9 @@ load_aot_module (MonoAssembly *assembly, gpointer user_data)
                find_symbol (sofile, globals, "mono_aot_file_info", (gpointer*)&info);
        }
 
+       // Copy aotid to MonoImage
+       memcpy(&assembly->image->aotid, info->aotid, 16);
+
        if (version_symbol) {
                /* Old file format */
                version = atoi (version_symbol);
@@ -4041,7 +4044,7 @@ find_aot_method_in_amodule (MonoAotModule *amodule, MonoMethod *method, guint32
                        WrapperInfo *info1 = mono_marshal_get_wrapper_info (method);
                        WrapperInfo *info2 = mono_marshal_get_wrapper_info (m);
 
-                       if (info1 && info2 && info1->subtype == info2->subtype && method->klass == m->klass) {
+                       if (info1 && info2 && info1->subtype == info2->subtype && info1->d.delegate_invoke.method == info2->d.delegate_invoke.method) {
                                index = value;
                                break;
                        }
@@ -5831,7 +5834,7 @@ mono_aot_get_method (MonoDomain *domain, MonoMethod *method)
 
 gpointer
 mono_aot_get_method_checked (MonoDomain *domain,
-                                                        MonoMethod *method, MonoError *error);
+                                                        MonoMethod *method, MonoError *error)
 {
        mono_error_init (error);
        return NULL;