memcpy (result->data.vt, data, size);
}
return;
+ case MONO_TYPE_GENERICINST:
+ stackval_from_data (type->data.generic_inst->generic_type, result, data, pinvoke);
+ return;
default:
g_warning ("got type 0x%02x", type->type);
g_assert_not_reached ();
memcpy (data, val->data.vt, size);
}
return;
+ case MONO_TYPE_GENERICINST:
+ stackval_to_data (type->data.generic_inst->generic_type, val, data, pinvoke);
+ return;
default:
g_warning ("got type %x", type->type);
g_assert_not_reached ();
int i, align, size, offset = 0;
MonoMethodHeader *header = ((MonoMethodNormal*)method)->header;
MonoMethodSignature *signature = method->signature;
+ MonoGenericContext *generic_context = NULL;
register const unsigned char *ip, *end;
const MonoOpcode *opcode;
guint32 token;
MethodRuntimeData *rtd;
int n_fields = 0;
+ if (method->signature->is_inflated)
+ generic_context = ((MonoMethodInflated *) method)->context;
+
mono_profiler_method_jit (method); /* sort of... */
/* intern the strings in the method. */
ip = header->code;
break;
case MonoInlineType:
if (method->wrapper_type == MONO_WRAPPER_NONE) {
- class = mono_class_get (image, read32 (ip + 1));
+ class = mono_class_get_full (image, read32 (ip + 1), generic_context);
mono_class_init (class);
if (!(class->flags & TYPE_ATTRIBUTE_INTERFACE))
mono_class_vtable (domain, class);
break;
case MonoInlineMethod:
if (method->wrapper_type == MONO_WRAPPER_NONE) {
- m = mono_get_method (image, read32 (ip + 1), NULL);
+ m = mono_get_method_full (image, read32 (ip + 1), NULL, generic_context);
mono_class_init (m->klass);
if (!(m->klass->flags & TYPE_ATTRIBUTE_INTERFACE))
mono_class_vtable (domain, m->klass);
break;
case MonoInlineField:
token = read32 (ip + 1);
- rtd->field_info[n_fields].field = mono_field_from_token (image, token, &class);
+ rtd->field_info[n_fields].field = mono_field_from_token (image, token, &class, generic_context);
mono_class_vtable (domain, class);
g_assert(rtd->field_info[n_fields].field->parent == class);
write32 ((unsigned char *)ip + 1, n_fields);
MonoInvocation child_frame;
MonoMethodHeader *header;
MonoMethodSignature *signature;
+ MonoGenericContext *generic_context = NULL;
MonoImage *image;
GSList *finally_ips = NULL;
const unsigned char *endfinally_ip = NULL;
mono_runtime_class_init (method_class_vt);
signature = frame->method->signature;
+ if (frame->method->signature->is_inflated)
+ generic_context = ((MonoMethodInflated *) frame->method)->context;
+
DEBUG_ENTER ();
header = ((MonoMethodNormal *)frame->method)->header;
if (frame->method->wrapper_type != MONO_WRAPPER_NONE)
child_frame.method = (MonoMethod *)mono_method_get_wrapper_data (frame->method, token);
else
- child_frame.method = mono_get_method (image, token, NULL);
+ child_frame.method = mono_get_method_full (image, token, NULL, generic_context);
if (!child_frame.method)
THROW_EX (mono_get_exception_missing_method (), ip -5);
csignature = child_frame.method->signature;
CASE (CEE_CPOBJ) {
MonoClass *vtklass;
++ip;
- vtklass = mono_class_get (image, read32 (ip));
+ vtklass = mono_class_get_full (image, read32 (ip), generic_context);
ip += 4;
sp -= 2;
memcpy (sp [0].data.p, sp [1].data.p, mono_class_value_size (vtklass, NULL));
if (frame->method->wrapper_type != MONO_WRAPPER_NONE)
c = (MonoClass *)mono_method_get_wrapper_data (frame->method, token);
else
- c = mono_class_get (image, token);
+ c = mono_class_get_full (image, token, generic_context);
addr = sp [-1].data.vt;
vt_alloc (&c->byval_arg, &sp [-1], FALSE);
if (frame->method->wrapper_type != MONO_WRAPPER_NONE)
child_frame.method = (MonoMethod *)mono_method_get_wrapper_data (frame->method, token);
else
- child_frame.method = mono_get_method (image, token, NULL);
+ child_frame.method = mono_get_method_full (image, token, NULL, generic_context);
if (!child_frame.method)
THROW_EX (mono_get_exception_missing_method (), ip -5);
++ip;
token = read32 (ip);
- c = mono_class_get (image, token);
+ c = mono_class_get_full (image, token, generic_context);
g_assert (sp [-1].type == VAL_OBJ);
if (frame->method->wrapper_type != MONO_WRAPPER_NONE)
c = (MonoClass *)mono_method_get_wrapper_data (frame->method, token);
else
- c = mono_class_get (image, token);
+ c = mono_class_get_full (image, token, generic_context);
o = sp [-1].data.p;
if (!o)
CASE (CEE_STOBJ) {
MonoClass *vtklass;
++ip;
- vtklass = mono_class_get (image, read32 (ip));
+ vtklass = mono_class_get_full (image, read32 (ip), generic_context);
ip += 4;
sp -= 2;
if (frame->method->wrapper_type != MONO_WRAPPER_NONE)
class = (MonoClass *)mono_method_get_wrapper_data (frame->method, token);
else
- class = mono_class_get (image, token);
+ class = mono_class_get_full (image, token, generic_context);
g_assert (class != NULL);
sp [-1].type = VAL_OBJ;
if (frame->method->wrapper_type != MONO_WRAPPER_NONE)
class = (MonoClass *)mono_method_get_wrapper_data (frame->method, token);
else
- class = mono_class_get (image, token);
+ class = mono_class_get_full (image, token, generic_context);
o = (MonoObject*) mono_array_new (domain, class, sp [-1].data.i);
ip += 4;
if (frame->method->wrapper_type != MONO_WRAPPER_NONE)
m = (MonoMethod *)mono_method_get_wrapper_data (frame->method, token);
else
- m = mono_get_method (image, token, NULL);
+ m = mono_get_method_full (image, token, NULL, generic_context);
if (!m)
THROW_EX (mono_get_exception_missing_method (), ip - 5);
token = read32 (ip);
ip += 4;
- class = mono_class_get (image, token);
+ class = mono_class_get_full (image, token, generic_context);
--sp;
g_assert (sp->type == VAL_TP || sp->type == VAL_MP);
MonoType *type = mono_type_create_from_typespec (image, token);
sp->data.i = mono_type_size (type, &align);
} else {
- MonoClass *szclass = mono_class_get (image, token);
+ MonoClass *szclass = mono_class_get_full (image, token, generic_context);
mono_class_init (szclass);
if (!szclass->valuetype)
THROW_EX (mono_exception_from_name (mono_defaults.corlib, "System", "InvalidProgramException"), ip - 5);