[aot] Fix the support for separate aot data files. Reorder the MONO_AOT_TABLE constan...
authormonojenkins <jo.shields+jenkins@xamarin.com>
Fri, 17 Apr 2020 09:41:02 +0000 (05:41 -0400)
committerGitHub <noreply@github.com>
Fri, 17 Apr 2020 09:41:02 +0000 (11:41 +0200)
Co-authored-by: vargaz <vargaz@users.noreply.github.com>
src/mono/mono/mini/aot-compiler.c
src/mono/mono/mini/aot-runtime.c
src/mono/mono/mini/aot-runtime.h

index bab6b97bf51d08c773596f31899eb44c376ee02a..762a5a743fc29a90d0e5b9be2cf1f46cade068a2 100644 (file)
@@ -10399,7 +10399,7 @@ emit_method_info_table (MonoAotCompile *acfg)
                if (acfg->cfgs [i])
                        method_flags [acfg->cfgs [i]->method_index] = acfg->cfgs [i]->aot_method_flags;
        }
-       emit_aot_data (acfg, MONO_AOT_TABLE_FLAGS_TABLE, "method_flags_table", method_flags, acfg->nmethods);
+       emit_aot_data (acfg, MONO_AOT_TABLE_METHOD_FLAGS_TABLE, "method_flags_table", method_flags, acfg->nmethods);
 }
 
 #endif /* #if !defined(DISABLE_AOT) && !defined(DISABLE_JIT) */
index 95da672a6599b132ee61fbb5825ed60b0f68603b..1c04902fcc8d25062637cc6302b96623e7773a9e 100644 (file)
@@ -126,6 +126,7 @@ struct MonoAotModule {
        guint8 *plt_end;
        guint8 *blob;
        gpointer weak_field_indexes;
+       guint8 *method_flags_table;
        /* Maps method indexes to their code */
        gpointer *methods;
        /* Sorted array of method addresses */
@@ -2377,6 +2378,7 @@ load_aot_module (MonoAssemblyLoadContext *alc, MonoAssembly *assembly, gpointer
                amodule->got_info_offsets = (guint32*)amodule->tables [MONO_AOT_TABLE_GOT_INFO_OFFSETS];
                amodule->llvm_got_info_offsets = (guint32*)amodule->tables [MONO_AOT_TABLE_LLVM_GOT_INFO_OFFSETS];
                amodule->weak_field_indexes = (guint32*)amodule->tables [MONO_AOT_TABLE_WEAK_FIELD_INDEXES];
+               amodule->method_flags_table = (guint8*)amodule->tables [MONO_AOT_TABLE_METHOD_FLAGS_TABLE];
        } else {
                amodule->blob = (guint8*)info->blob;
                amodule->method_info_offsets = (guint32 *)info->method_info_offsets;
@@ -2388,6 +2390,7 @@ load_aot_module (MonoAssemblyLoadContext *alc, MonoAssembly *assembly, gpointer
                amodule->got_info_offsets = (guint32*)info->got_info_offsets;
                amodule->llvm_got_info_offsets = (guint32*)info->llvm_got_info_offsets;
                amodule->weak_field_indexes = (guint32*)info->weak_field_indexes;
+               amodule->method_flags_table = (guint8*)info->method_flags_table;
        }
        amodule->unbox_trampolines = (guint32 *)info->unbox_trampolines;
        amodule->unbox_trampolines_end = (guint32 *)info->unbox_trampolines_end;
@@ -4348,7 +4351,7 @@ load_method (MonoDomain *domain, MonoAotModule *amodule, MonoImage *image, MonoM
        }
 
        if (mono_llvm_only) {
-               guint8 flags = amodule->info.method_flags_table [method_index];
+               guint8 flags = amodule->method_flags_table [method_index];
                /* The caller needs to looks this up, but its hard to do without constructing the full MonoJitInfo, so save it here */
                if (flags & MONO_AOT_METHOD_FLAG_GSHAREDVT_VARIABLE) {
                        mono_aot_lock ();
@@ -4633,7 +4636,7 @@ init_method (MonoAotModule *amodule, gpointer info, guint32 method_index, MonoMe
        p += 4;
 
        code = (guint8 *)amodule->methods [method_index];
-       guint8 flags = amodule->info.method_flags_table [method_index];
+       guint8 flags = amodule->method_flags_table [method_index];
 
        if (flags & MONO_AOT_METHOD_FLAG_HAS_CCTOR)
                klass_to_run_ctor = decode_klass_ref (amodule, p, &p, error);
index c8b2f1c09ccdd1750e569607a8397b54a8a611c6..c4171fab12a3aa22def65d7694311ad2c05e53e1 100644 (file)
@@ -11,7 +11,7 @@
 #include "mini.h"
 
 /* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION 177
+#define MONO_AOT_FILE_VERSION 178
 
 #define MONO_AOT_TRAMP_PAGE_SIZE 16384
 
@@ -87,17 +87,17 @@ typedef enum {
 
 typedef enum {
        MONO_AOT_TABLE_BLOB,
-       MONO_AOT_TABLE_IMAGE_TABLE,
        MONO_AOT_TABLE_CLASS_NAME,
+       MONO_AOT_TABLE_CLASS_INFO_OFFSETS,
        MONO_AOT_TABLE_METHOD_INFO_OFFSETS,
        MONO_AOT_TABLE_EX_INFO_OFFSETS,
-       MONO_AOT_TABLE_CLASS_INFO_OFFSETS,
-       MONO_AOT_TABLE_GOT_INFO_OFFSETS,
-       MONO_AOT_TABLE_LLVM_GOT_INFO_OFFSETS,
        MONO_AOT_TABLE_EXTRA_METHOD_INFO_OFFSETS,
        MONO_AOT_TABLE_EXTRA_METHOD_TABLE,
+       MONO_AOT_TABLE_GOT_INFO_OFFSETS,
+       MONO_AOT_TABLE_LLVM_GOT_INFO_OFFSETS,
+       MONO_AOT_TABLE_IMAGE_TABLE,
        MONO_AOT_TABLE_WEAK_FIELD_INDEXES,
-       MONO_AOT_TABLE_FLAGS_TABLE,
+       MONO_AOT_TABLE_METHOD_FLAGS_TABLE,
        MONO_AOT_TABLE_NUM
 } MonoAotFileTable;