ip += 4;;
MINT_IN_BREAK;
}
- MINT_IN_CASE(MINT_INTRINS_BYREFERENCE_GET_VALUE) {
- LOCAL_VAR (ip [1], gpointer) = *LOCAL_VAR (ip [2], gpointer*);
- ip += 3;
- MINT_IN_BREAK;
- }
MINT_IN_CASE(MINT_INTRINS_UNSAFE_ADD_BYTE_OFFSET) {
LOCAL_VAR (ip [1], gpointer) = LOCAL_VAR (ip [2], guint8*) + LOCAL_VAR (ip [3], mono_u);
ip += 4;
static int
imethod_opcount_comparer (gconstpointer m1, gconstpointer m2)
{
- return (*(InterpMethod**)m2)->opcounts - (*(InterpMethod**)m1)->opcounts;
+ long diff = (*(InterpMethod**)m2)->opcounts > (*(InterpMethod**)m1)->opcounts;
+ if (diff > 0)
+ return 1;
+ else if (diff < 0)
+ return -1;
+ else
+ return 0;
}
static void
OPDEF(MINT_INTRINS_GET_HASHCODE, "intrins_get_hashcode", 3, 1, 1, MintOpNoArgs)
OPDEF(MINT_INTRINS_GET_TYPE, "intrins_get_type", 3, 1, 1, MintOpNoArgs)
OPDEF(MINT_INTRINS_SPAN_CTOR, "intrins_span_ctor", 4, 1, 2, MintOpNoArgs)
-OPDEF(MINT_INTRINS_BYREFERENCE_GET_VALUE, "intrins_byreference_get_value", 3, 1, 1, MintOpNoArgs)
OPDEF(MINT_INTRINS_UNSAFE_ADD_BYTE_OFFSET, "intrins_unsafe_add_byte_offset", 4, 1, 2, MintOpNoArgs)
OPDEF(MINT_INTRINS_UNSAFE_BYTE_OFFSET, "intrins_unsafe_byte_offset", 4, 1, 2, MintOpNoArgs)
OPDEF(MINT_INTRINS_RUNTIMEHELPERS_OBJECT_HAS_COMPONENT_SIZE, "intrins_runtimehelpers_object_has_component_size", 3, 1, 1, MintOpNoArgs)
*op = MINT_INTRINS_CLEAR_WITH_REFERENCES;
} else if (in_corlib && !strcmp (klass_name_space, "System") && !strcmp (klass_name, "ByReference`1")) {
g_assert (!strcmp (tm, "get_Value"));
- *op = MINT_INTRINS_BYREFERENCE_GET_VALUE;
+ *op = MINT_LDIND_I;
} else if (in_corlib && !strcmp (klass_name_space, "System") && !strcmp (klass_name, "Marvin")) {
if (!strcmp (tm, "Block"))
*op = MINT_INTRINS_MARVIN_BLOCK;
goto_if_nok (error, exit);
} else {
td->sp--;
+ int foffset = m_class_is_valuetype (klass) ? field->offset - MONO_ABI_SIZEOF (MonoObject) : field->offset;
if (td->sp->type == STACK_TYPE_O) {
interp_add_ins (td, MINT_LDFLDA);
+ td->last_ins->data [0] = foffset;
} else {
int sp_type = td->sp->type;
g_assert (sp_type == STACK_TYPE_MP || sp_type == STACK_TYPE_I);
- interp_add_ins (td, MINT_LDFLDA_UNSAFE);
+ if (foffset) {
+ interp_add_ins (td, MINT_LDFLDA_UNSAFE);
+ td->last_ins->data [0] = foffset;
+ } else {
+ interp_add_ins (td, MINT_MOV_P);
+ }
}
- td->last_ins->data [0] = m_class_is_valuetype (klass) ? field->offset - MONO_ABI_SIZEOF (MonoObject) : field->offset;
interp_ins_set_sreg (td->last_ins, td->sp [0].local);
push_simple_type (td, STACK_TYPE_MP);
interp_ins_set_dreg (td->last_ins, td->sp [-1].local);