mono_class_setup_methods (klass);
if (mono_class_has_failure (klass))
return NULL;
- for (i = 0; i < klass->method.count; ++i) {
+ int mcount = mono_class_get_method_count (klass);
+ for (i = 0; i < mcount; ++i) {
m = klass->methods [i];
if (m == declaring)
break;
if (m->is_inflated && mono_method_get_declaring_generic_method (m) == declaring)
break;
}
- if (i >= klass->method.count)
+ if (i >= mcount)
return NULL;
}
MonoMethod *res, *cached;
WrapperInfo *info;
MonoMethodSignature *csig, *gsharedvt_sig;
- int i, pindex, retval_var;
+ int i, pindex, retval_var = 0;
static GHashTable *cache;
// FIXME: Memory management
mono_class_setup_vtable (info->klass);
// FIXME: Check type load
- if (mono_class_get_flags (iface_class) & TYPE_ATTRIBUTE_INTERFACE) {
+ if (mono_class_is_interface (iface_class)) {
ioffset = mono_class_interface_offset (info->klass, iface_class);
g_assert (ioffset != -1);
} else {
mono_class_setup_vtable (info->klass);
// FIXME: Check type load
- if (mono_class_get_flags (iface_class) & TYPE_ATTRIBUTE_INTERFACE) {
+ if (mono_class_is_interface (iface_class)) {
ioffset = mono_class_interface_offset (info->klass, iface_class);
g_assert (ioffset != -1);
} else {
/* See mono_emit_method_call_full () */
/* The gsharedvt trampoline will recognize this constant */
vcall_offset = MONO_GSHAREDVT_DEL_INVOKE_VT_OFFSET;
- } else if (mono_class_get_flags (method->klass) & TYPE_ATTRIBUTE_INTERFACE) {
+ } else if (mono_class_is_interface (method->klass)) {
guint32 imt_slot = mono_method_get_imt_slot (method);
vcall_offset = ((gint32)imt_slot - MONO_IMT_SIZE) * SIZEOF_VOID_P;
} else {
method_inst ? method_inst->type_argc : 0, slot, TRUE, TRUE, &do_free);
/* This might take the loader lock */
info = instantiate_info (domain, &oti, &context, klass, error);
+ return_val_if_nok (error, NULL);
g_assert (info);
/*
void
mono_set_generic_sharing_vt_supported (gboolean supported)
{
- gsharedvt_supported = supported;
+ /* ensure we do not disable gsharedvt once it's been enabled */
+ if (!gsharedvt_supported && supported)
+ gsharedvt_supported = TRUE;
}
#ifdef MONO_ARCH_GSHAREDVT_SUPPORTED