Skip to content

Commit 4d53eb5

Browse files
committed
Add support for detecting mismatch with aot images
1 parent 4a3a917 commit 4d53eb5

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

src/mono/mono/mini/aot-compiler.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15107,6 +15107,9 @@ aot_assembly (MonoAssembly *ass, guint32 jit_opts, MonoAotOptions *aot_options)
1510715107
acfg->is_full_aot = TRUE;
1510815108
}
1510915109

15110+
if (mono_opt_compressed_interface_bitmap)
15111+
acfg->flags = (MonoAotFileFlags)(acfg->flags | MONO_AOT_FILE_FLAG_COMPRESSED_INTERFACE_BITMAP);
15112+
1511015113
if (mini_safepoints_enabled ())
1511115114
acfg->flags = (MonoAotFileFlags)(acfg->flags | MONO_AOT_FILE_FLAG_SAFEPOINTS);
1511215115

src/mono/mono/mini/aot-runtime.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1631,7 +1631,7 @@ check_usable (MonoAssembly *assembly, MonoAotFileInfo *info, guint8 *blob, char
16311631
char *build_info;
16321632
char *msg = NULL;
16331633
gboolean usable = TRUE;
1634-
gboolean full_aot, interp, safepoints;
1634+
gboolean full_aot, interp, safepoints, compressed_interface_bmap;
16351635
guint32 excluded_cpu_optimizations;
16361636

16371637
if (strcmp (assembly->image->guid, (const char*)info->assembly_guid)) {
@@ -1713,6 +1713,13 @@ check_usable (MonoAssembly *assembly, MonoAotFileInfo *info, guint8 *blob, char
17131713
}
17141714
#endif
17151715

1716+
compressed_interface_bmap = info->flags & MONO_AOT_FILE_FLAG_COMPRESSED_INTERFACE_BITMAP;
1717+
if ((mono_opt_compressed_interface_bitmap && !compressed_interface_bmap) ||
1718+
(!mono_opt_compressed_interface_bitmap && compressed_interface_bmap)) {
1719+
msg = g_strdup ("mismatch with compressed interface bitmap feature");
1720+
usable = FALSE;
1721+
}
1722+
17161723
*out_msg = msg;
17171724
return usable;
17181725
}

src/mono/mono/mini/aot-runtime.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include "mini.h"
1212

1313
/* Version number of the AOT file format */
14-
#define MONO_AOT_FILE_VERSION 186
14+
#define MONO_AOT_FILE_VERSION 187
1515

1616
#define MONO_AOT_TRAMP_PAGE_SIZE 16384
1717

@@ -74,7 +74,8 @@ typedef enum {
7474
MONO_AOT_FILE_FLAG_SEPARATE_DATA = 64,
7575
MONO_AOT_FILE_FLAG_EAGER_LOAD = 128,
7676
MONO_AOT_FILE_FLAG_INTERP = 256,
77-
MONO_AOT_FILE_FLAG_CODE_EXEC_ONLY = 512
77+
MONO_AOT_FILE_FLAG_CODE_EXEC_ONLY = 512,
78+
MONO_AOT_FILE_FLAG_COMPRESSED_INTERFACE_BITMAP = 1024
7879
} MonoAotFileFlags;
7980

8081
typedef enum {

0 commit comments

Comments
 (0)