[runtime] AOTID is now properly stored.
authorMarcos Henrich <marcos.henrich@xamarin.com>
Tue, 21 Jun 2016 10:36:29 +0000 (11:36 +0100)
committerMarcos Henrich <marcos.henrich@xamarin.com>
Fri, 8 Jul 2016 21:40:38 +0000 (22:40 +0100)
mono/mini/aot-compiler.c
mono/mini/mini-llvm.c
mono/mini/mini.h

index 6bfed9f47ef4909f25329d8bd030d3332de5faf1..4ce201e75f19a47c06e78b90e98d87492612df37 100644 (file)
@@ -9521,6 +9521,8 @@ emit_aot_file_info (MonoAotCompile *acfg, MonoAotFileInfo *info)
        for (i = 0; i < MONO_AOT_TRAMP_NUM; ++i)
                emit_int32 (acfg, info->tramp_page_code_offsets [i]);
 
+       emit_bytes (acfg, info->aotid, 16);
+
        if (acfg->aot_opts.static_link) {
                emit_global_inner (acfg, acfg->static_linking_symbol, FALSE);
                emit_alignment (acfg, sizeof (gpointer));
index e2f963bff0461fef64bb49cb4b48b6efddff8916..bc7b1765b71905c6bc162749d11c927f4618ff05 100644 (file)
@@ -8389,6 +8389,19 @@ llvm_array_from_uints (LLVMTypeRef el_type, guint32 *values, int nvalues)
        return res;
 }
 
+static LLVMValueRef
+llvm_array_from_bytes (guint8 *values, int nvalues)
+{
+       int i;
+       LLVMValueRef res, *vals;
+
+       vals = g_new0 (LLVMValueRef, nvalues);
+       for (i = 0; i < nvalues; ++i)
+               vals [i] = LLVMConstInt (LLVMInt8Type (), values [i], FALSE);
+       res = LLVMConstArray (LLVMInt8Type (), vals, nvalues);
+       g_free (vals);
+       return res;
+}
 /*
  * mono_llvm_emit_aot_file_info:
  *
@@ -8452,7 +8465,7 @@ emit_aot_file_info (MonoLLVMModule *module)
        info = &module->aot_info;
 
        /* Create an LLVM type to represent MonoAotFileInfo */
-       nfields = 2 + MONO_AOT_FILE_INFO_NUM_SYMBOLS + 15 + 5;
+       nfields = 2 + MONO_AOT_FILE_INFO_NUM_SYMBOLS + 16 + 5;
        eltypes = g_new (LLVMTypeRef, nfields);
        tindex = 0;
        eltypes [tindex ++] = LLVMInt32Type ();
@@ -8467,6 +8480,7 @@ emit_aot_file_info (MonoLLVMModule *module)
        eltypes [tindex ++] = LLVMArrayType (LLVMInt32Type (), MONO_AOT_TABLE_NUM);
        for (i = 0; i < 4; ++i)
                eltypes [tindex ++] = LLVMArrayType (LLVMInt32Type (), MONO_AOT_TRAMP_NUM);
+       eltypes [tindex ++] = LLVMArrayType (LLVMInt8Type (), 16);
        g_assert (tindex == nfields);
        file_info_type = LLVMStructCreateNamed (module->context, "MonoAotFileInfo");
        LLVMStructSetBody (file_info_type, eltypes, nfields, FALSE);
@@ -8589,6 +8603,8 @@ emit_aot_file_info (MonoLLVMModule *module)
        fields [tindex ++] = llvm_array_from_uints (LLVMInt32Type (), info->trampoline_got_offset_base, MONO_AOT_TRAMP_NUM);
        fields [tindex ++] = llvm_array_from_uints (LLVMInt32Type (), info->trampoline_size, MONO_AOT_TRAMP_NUM);
        fields [tindex ++] = llvm_array_from_uints (LLVMInt32Type (), info->tramp_page_code_offsets, MONO_AOT_TRAMP_NUM);
+
+       fields [tindex ++] = llvm_array_from_bytes (info->aotid, 16);
        g_assert (tindex == nfields);
 
        LLVMSetInitializer (info_var, LLVMConstNamedStruct (file_info_type, fields, nfields));
index c55c89c0988924a3440afbee6b54d18dc0ec4f5b..531078a3c496b0a231912b89075609221150ce8f 100644 (file)
 #endif
 
 /* Version number of the AOT file format */
-#define MONO_AOT_FILE_VERSION 134
+#define MONO_AOT_FILE_VERSION 135
 
 //TODO: This is x86/amd64 specific.
 #define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6))