if (gshared && method->is_inflated && mono_method_get_context (method)->method_inst) {
MonoGenericContext context = { NULL, NULL };
- if (res->klass->generic_class)
- context.class_inst = res->klass->generic_class->context.class_inst;
- else if (res->klass->generic_container)
- context.class_inst = res->klass->generic_container->context.class_inst;
+ if (mono_class_is_ginst (res->klass))
+ context.class_inst = mono_class_get_generic_class (res->klass)->context.class_inst;
+ else if (mono_class_is_gtd (res->klass))
+ context.class_inst = mono_class_get_generic_container (res->klass)->context.class_inst;
context.method_inst = mono_method_get_context (method)->method_inst;
res = mono_class_inflate_generic_method_checked (res, &context, &error);
return NULL;
}
vmethod = mono_object_get_virtual_method (obj, method);
- g_assert (!vmethod->klass->generic_container);
- g_assert (!vmethod->klass->generic_class || !vmethod->klass->generic_class->context.class_inst->is_open);
+ g_assert (!mono_class_is_gtd (vmethod->klass));
+ g_assert (!mono_class_is_ginst (vmethod->klass) || !mono_class_get_generic_class (vmethod->klass)->context.class_inst->is_open);
g_assert (!context->method_inst || !context->method_inst->is_open);
addr = mono_compile_method_checked (vmethod, &error);
MonoClass *oklass;
if (mini_get_debug_options ()->better_cast_details) {
- jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id);
+ jit_tls = (MonoJitTlsData *)mono_tls_get_jit_tls ();
jit_tls->class_cast_from = NULL;
}
gpointer cached_vtable, obj_vtable;
if (mini_get_debug_options ()->better_cast_details) {
- jit_tls = (MonoJitTlsData *)mono_native_tls_get_value (mono_jit_tls_id);
+ jit_tls = (MonoJitTlsData *)mono_tls_get_jit_tls ();
jit_tls->class_cast_from = NULL;
}
mono_error_init (error);
- if (klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+ if (mono_class_is_interface (klass)) {
MonoObject *this_obj;
/* Have to use the receiver's type instead of klass, the receiver is a ref type */
mono_class_setup_vtable (klass);
g_assert (klass->vtable);
vt_slot = mono_method_get_vtable_slot (cmethod);
- if (cmethod->klass->flags & TYPE_ATTRIBUTE_INTERFACE) {
+ if (mono_class_is_interface (cmethod->klass)) {
iface_offset = mono_class_interface_offset (klass, cmethod->klass);
g_assert (iface_offset != -1);
vt_slot += iface_offset;
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 = imt_method;
g_assert (generic_virtual);
need_unbox_tramp = TRUE;
}
+ if (m->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)
+ m = mono_marshal_get_synchronized_wrapper (m);
+
// FIXME: This can throw exceptions
addr = compiled_method = mono_compile_method_checked (m, error);
mono_error_assert_ok (error);
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));
g_assert (generic_virtual->is_inflated);
context.method_inst = ((MonoMethodInflated*)generic_virtual)->context.method_inst;
/*
* This wastes memory but the memory usage is bounded since
- * mono_method_add_generic_virtual_invocation () eventually builds an imt thunk for
+ * mono_method_add_generic_virtual_invocation () eventually builds an imt trampoline for
* this vtable slot so we are not called any more for this instantiation.
*/
MonoFtnDesc *ftndesc = mini_create_llvmonly_ftndesc (mono_domain_get (), addr, arg);
if (vt->klass->valuetype)
need_unbox_tramp = TRUE;
- // FIXME: This can throw exceptions
+ if (m->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)
+ m = mono_marshal_get_synchronized_wrapper (m);
+
addr = compiled_method = mono_compile_method_checked (m, &error);
- mono_error_assert_ok (&error);
+ mono_error_raise_exception (&error);
g_assert (addr);
addr = mini_add_method_wrappers_llvmonly (m, addr, FALSE, need_unbox_tramp, &arg);
/*
* This wastes memory but the memory usage is bounded since
- * mono_method_add_generic_virtual_invocation () eventually builds an imt thunk for
+ * mono_method_add_generic_virtual_invocation () eventually builds an imt trampoline for
* this vtable slot so we are not called any more for this instantiation.
*/
MonoFtnDesc *ftndesc = mini_create_llvmonly_ftndesc (mono_domain_get (), addr, arg);
* but we don't have a a structure which could own its memory.
*/
if (G_UNLIKELY (!ftndesc)) {
- gpointer addr = mono_compile_method_checked (del->method, &error);
+ MonoMethod *m = del->method;
+ if (m->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)
+ m = mono_marshal_get_synchronized_wrapper (m);
+
+ gpointer addr = mono_compile_method_checked (m, &error);
if (mono_error_set_pending_exception (&error))
return;
- if (del->method->klass->valuetype && mono_method_signature (del->method)->hasthis)
- addr = mono_aot_get_unbox_trampoline (del->method);
+ if (m->klass->valuetype && mono_method_signature (m)->hasthis)
+ addr = mono_aot_get_unbox_trampoline (m);
gpointer arg = mini_get_delegate_arg (del->method, addr);
method = mono_object_get_virtual_method (target, method);
+ if (method->iflags & METHOD_IMPL_ATTRIBUTE_SYNCHRONIZED)
+ method = mono_marshal_get_synchronized_wrapper (method);
+
del->method = method;
del->method_ptr = mono_compile_method_checked (method, &error);
if (mono_error_set_pending_exception (&error))
MonoObject*
mono_get_assembly_object (MonoImage *image)
{
- MonoError error;
- MonoObject *result;
- result = (MonoObject*)mono_assembly_get_object_checked (mono_domain_get (), image->assembly, &error);
- if (!result)
- mono_error_set_pending_exception (&error);
- return result;
+ ICALL_ENTRY();
+ MonoObjectHandle result = MONO_HANDLE_CAST (MonoObject, mono_assembly_get_object_handle (mono_domain_get (), image->assembly, &error));
+ ICALL_RETURN_OBJ (result);
}
MonoObject*
g_free (callee_name);
g_free (caller_name);
}
+
+void
+mono_dummy_jit_icall (void)
+{
+}