#define MINT_TYPE_P 9
#define MINT_TYPE_VT 10
-#define BOX_NOT_CLEAR_VT_SP 0x4000
+#define INLINED_METHOD_FLAG 0xffff
#define MINT_VT_ALIGNMENT 8
int const size = mono_class_value_size (c, NULL);
guint16 offset = ip [2];
- gboolean const pop_vt_sp = !(offset & BOX_NOT_CLEAR_VT_SP);
- offset &= ~BOX_NOT_CLEAR_VT_SP;
+ guint16 pop_vt_sp = !ip [3];
sp [-1 - offset].data.o = mono_nullable_box (sp [-1 - offset].data.p, c, error);
mono_interp_error_cleanup (error); /* FIXME: don't swallow the error */
int const size = mono_class_value_size (c, NULL);
guint16 offset = ip [2];
- gboolean const pop_vt_sp = !(offset & BOX_NOT_CLEAR_VT_SP);
- offset &= ~BOX_NOT_CLEAR_VT_SP;
+ guint16 pop_vt_sp = !ip [3];
OBJREF (o) = mono_gc_alloc_obj (vtable, m_class_get_instance_size (vtable->klass));
mono_value_copy_internal (mono_object_get_data (o), sp [-1 - offset].data.p, c);
guint16 param_count;
guint16 imethod_index = ip [1];
- const gboolean is_inlined = imethod_index == 0xffff;
+ const gboolean is_inlined = imethod_index == INLINED_METHOD_FLAG;
param_count = ip [2];
}
MINT_IN_CASE(MINT_BOX_VT) {
vt_sp -= mono_interp_box_vt (frame, ip, sp);
- ip += 3;
+ ip += 4;
MINT_IN_BREAK;
}
MINT_IN_CASE(MINT_BOX_NULLABLE) {
vt_sp -= mono_interp_box_nullable (frame, ip, sp, error);
- ip += 3;
+ ip += 4;
MINT_IN_BREAK;
}
MINT_IN_CASE(MINT_NEWARR) {
OPDEF(MINT_ISINST_COMMON, "isinst.common", 2, Pop1, Push1, MintOpClassToken)
OPDEF(MINT_NEWARR, "newarr", 2, Pop1, Push1, MintOpClassToken)
OPDEF(MINT_BOX, "box", 3, Pop0, Push0, MintOpTwoShorts)
-OPDEF(MINT_BOX_VT, "box.vt", 3, Pop0, Push0, MintOpTwoShorts)
-OPDEF(MINT_BOX_NULLABLE, "box.nullable", 3, Pop0, Push0, MintOpTwoShorts)
+OPDEF(MINT_BOX_VT, "box.vt", 4, Pop0, Push0, MintOpTwoShorts)
+OPDEF(MINT_BOX_NULLABLE, "box.nullable", 4, Pop0, Push0, MintOpTwoShorts)
OPDEF(MINT_UNBOX, "unbox", 2, Pop1, Push1, MintOpClassToken)
OPDEF(MINT_LDTOKEN, "ldtoken", 2, Pop0, Push1, MintOpClassToken) /* not really */
OPDEF(MINT_LDFTN, "ldftn", 2, Pop0, Push1, MintOpMethodToken)
g_assert (mt == MINT_TYPE_VT);
interp_add_ins (td, MINT_BOX_NULLABLE);
td->last_ins->data [0] = get_data_item_index (td, constrained_class);
- td->last_ins->data [1] = csignature->param_count | ((td->sp - 1 - csignature->param_count)->type != STACK_TYPE_MP ? 0 : BOX_NOT_CLEAR_VT_SP);
+ td->last_ins->data [1] = csignature->param_count;
+ td->last_ins->data [2] = (td->sp - 1 - csignature->param_count)->type != STACK_TYPE_MP ? 0 : 1;
} else {
MonoVTable *vtable = mono_class_vtable_checked (domain, constrained_class, error);
return_if_nok (error);
if (mt == MINT_TYPE_VT) {
interp_add_ins (td, MINT_BOX_VT);
td->last_ins->data [0] = get_data_item_index (td, vtable);
- td->last_ins->data [1] = csignature->param_count | ((td->sp - 1 - csignature->param_count)->type != STACK_TYPE_MP ? 0 : BOX_NOT_CLEAR_VT_SP);
+ td->last_ins->data [1] = csignature->param_count;
+ td->last_ins->data [2] = (td->sp - 1 - csignature->param_count)->type != STACK_TYPE_MP ? 0 : 1;
} else {
interp_add_ins (td, MINT_BOX);
td->last_ins->data [0] = get_data_item_index (td, vtable);
goto_if_nok (error, exit);
if (interp_inline_method (td, m, mheader, error)) {
- newobj_fast->data [0] = 0xffff;
+ newobj_fast->data [0] = INLINED_METHOD_FLAG;
break;
}
}
}
case MINT_NEWOBJ_FAST: {
int param_count = ins->data [1];
- gboolean is_inlined = ins->data [0] == 0xffff;
+ gboolean is_inlined = ins->data [0] == INLINED_METHOD_FLAG;
if (is_inlined) {
// This needs to be handled explictly during cprop, in order to properly
// keep track of stack contents
sp [-1].ins = NULL;
sp++;
} else if (ins->opcode >= MINT_BOX && ins->opcode <= MINT_BOX_NULLABLE) {
- int offset = (ins->data [1] & ~BOX_NOT_CLEAR_VT_SP);
+ int offset = ins->data [1];
// Clear the stack slot that is boxed
memset (&sp [-1 - offset], 0, sizeof (StackContentInfo));
// Make sure that the instructions that pushed this stack slot can't be
sp [-i].ins = NULL;
memset (sp, 0, sizeof (StackContentInfo));
sp++;
- } else if (ins->opcode == MINT_NEWOBJ_FAST && ins->data [0] == 0xffff) {
+ } else if (ins->opcode == MINT_NEWOBJ_FAST && ins->data [0] == INLINED_METHOD_FLAG) {
int param_count = ins->data [1];
// memmove the stack values while clearing ins, to prevent instruction removal
for (int i = 1; i <= param_count; i++) {