Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/mono/mono/metadata/class-init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1805,7 +1805,7 @@ mono_compress_bitmap (uint8_t *dest, const uint8_t *bitmap, int size)
while (bitmap < end) {
if (*bitmap || numz == 255) {
if (dest) {
*dest++ = numz;
*dest++ = (uint8_t)numz;
*dest++ = *bitmap;
}
res += 2;
Expand All @@ -1819,7 +1819,7 @@ mono_compress_bitmap (uint8_t *dest, const uint8_t *bitmap, int size)
if (numz) {
res += 2;
if (dest) {
*dest++ = numz;
*dest++ = (uint8_t)numz;
*dest++ = 0;
}
}
Expand Down
4 changes: 0 additions & 4 deletions src/mono/mono/metadata/class-internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,7 @@ union _MonoClassSizes {
int generic_param_token; /* for generic param types, both var and mvar */
};

/* enabled only with small config for now: we might want to do it unconditionally */
#ifdef MONO_SMALL_CONFIG
#define COMPRESSED_INTERFACE_BITMAP 1
#endif


#ifdef ENABLE_CHECKED_BUILD_PRIVATE_TYPES
#define MONO_CLASS_DEF_PRIVATE 1
Expand Down
8 changes: 5 additions & 3 deletions src/mono/mono/metadata/class-setup-vtable.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,12 @@ mono_class_setup_interface_offsets_internal (MonoClass *klass, int cur_slot, int
}
if (!klass->interface_bitmap) {
#ifdef COMPRESSED_INTERFACE_BITMAP
int i = mono_compress_bitmap (NULL, bitmap, bsize);
klass->interface_bitmap = mono_class_alloc0 (klass, i);
mono_compress_bitmap (klass->interface_bitmap, bitmap, bsize);
int len = mono_compress_bitmap (NULL, bitmap, bsize);
uint8_t *compressed_bitmap = mono_class_alloc0 (klass, len);
mono_compress_bitmap (compressed_bitmap, bitmap, bsize);
g_free (bitmap);

klass->interface_bitmap = compressed_bitmap;
#else
klass->interface_bitmap = bitmap;
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/mono/mono/mini/type-checking.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ mini_emit_interface_bitmap_check (MonoCompile *cfg, int intf_bit_reg, int base_r
#ifdef COMPRESSED_INTERFACE_BITMAP
MonoInst *args [2];
MonoInst *res, *ins;
NEW_LOAD_MEMBASE (cfg, ins, OP_LOAD_MEMBASE, ibitmap_reg, base_reg, offset);
NEW_LOAD_MEMBASE (cfg, ins, OP_LOAD_MEMBASE, ibitmap_reg, base_reg, (target_mgreg_t)offset);
MONO_ADD_INS (cfg->cbb, ins);
args [0] = ins;
args [1] = mini_emit_runtime_constant (cfg, MONO_PATCH_INFO_IID, klass);
Expand Down
Loading