/* imt_method->slot might not be set */
impl = mono_class_get_vtable_entry (vt->klass, interface_offset + mono_method_get_declaring_generic_method (imt_method)->slot);
- if (impl->klass->generic_class)
- context.class_inst = impl->klass->generic_class->context.class_inst;
+ if (mono_class_is_ginst (impl->klass))
+ context.class_inst = mono_class_get_generic_class (impl->klass)->context.class_inst;
context.method_inst = ((MonoMethodInflated*)imt_method)->context.method_inst;
impl = mono_class_inflate_generic_method_checked (impl, &context, error);
mono_error_assert_ok (error);
if (callee_array_helper) {
add_static_rgctx_tramp = FALSE;
- /* FIXME: ji->from_aot is not set for llvm methods */
- if (ji && (ji->from_aot || mono_aot_only)) {
- /* In AOT mode, compiled_method points to one of the InternalArray methods in Array. */
- if (!mono_llvm_only && mono_method_needs_static_rgctx_invoke (jinfo_get_method (ji), TRUE))
- add_static_rgctx_tramp = TRUE;
- }
+ /* In AOT mode, compiled_method points to one of the InternalArray methods in Array. */
+ if (ji && !mono_llvm_only && mono_method_needs_static_rgctx_invoke (jinfo_get_method (ji), TRUE))
+ add_static_rgctx_tramp = TRUE;
}
if (mono_llvm_only)
else
declaring = m;
- if (m->klass->generic_class)
- context.class_inst = m->klass->generic_class->context.class_inst;
+ if (mono_class_is_ginst (m->klass))
+ context.class_inst = mono_class_get_generic_class (m->klass)->context.class_inst;
else
- g_assert (!m->klass->generic_container);
+ g_assert (!mono_class_is_gtd (m->klass));
generic_virtual = mono_arch_find_imt_method (regs, code);
g_assert (generic_virtual);
else
declaring = m;
- if (klass->generic_class)
- context.class_inst = klass->generic_class->context.class_inst;
- else if (klass->generic_container)
- context.class_inst = klass->generic_container->context.class_inst;
+ if (mono_class_is_ginst (klass))
+ context.class_inst = mono_class_get_generic_class (klass)->context.class_inst;
+ else if (mono_class_is_gtd (klass))
+ context.class_inst = mono_class_get_generic_container (klass)->context.class_inst;
context.method_inst = method_inst;
actual_method = mono_class_inflate_generic_method_checked (declaring, &context, error);
gpointer *vtable_slot;
MonoMethod *m;
MonoError error;
- gpointer addr, res;
+ gpointer addr, res = NULL;
trampoline_calls ++;
else
declaring = m;
- if (m->klass->generic_class)
- context.class_inst = m->klass->generic_class->context.class_inst;
+ if (mono_class_is_ginst (m->klass))
+ context.class_inst = mono_class_get_generic_class (m->klass)->context.class_inst;
else
- g_assert (!m->klass->generic_container);
+ g_assert (!mono_class_is_gtd (m->klass));
imt_method = mono_arch_find_imt_method (regs, code);
if (imt_method->is_inflated)
* If the call doesn't return a valuetype, then the vcall uses the same calling
* convention as a normal call.
*/
- if (((method->klass->flags & TYPE_ATTRIBUTE_SEALED) || !(method->flags & METHOD_ATTRIBUTE_VIRTUAL)) && !MONO_TYPE_ISSTRUCT (sig->ret)) {
+ if ((mono_class_is_sealed (method->klass) || !(method->flags & METHOD_ATTRIBUTE_VIRTUAL)) && !MONO_TYPE_ISSTRUCT (sig->ret)) {
callvirt = FALSE;
enable_caching = FALSE;
}
if (delegate->target &&
method->flags & METHOD_ATTRIBUTE_VIRTUAL &&
method->flags & METHOD_ATTRIBUTE_ABSTRACT &&
- method->klass->flags & TYPE_ATTRIBUTE_ABSTRACT) {
+ mono_class_is_abstract (method->klass)) {
method = mono_object_get_virtual_method (delegate->target, method);
enable_caching = FALSE;
}