mono_ldftn (MonoMethod *method)
{
gpointer addr;
+ MonoError error;
if (mono_llvm_only) {
// FIXME: No error handling
return addr;
}
- addr = mono_create_jump_trampoline (mono_domain_get (), method, FALSE);
-
+ addr = mono_create_jump_trampoline (mono_domain_get (), method, FALSE, &error);
+ if (!mono_error_ok (&error)) {
+ mono_error_set_pending_exception (&error);
+ return NULL;
+ }
return mono_create_ftnptr (mono_domain_get (), addr);
}
gpointer
mono_class_static_field_address (MonoDomain *domain, MonoClassField *field)
{
+ MonoError error;
MonoVTable *vtable;
gpointer addr;
mono_class_init (field->parent);
- vtable = mono_class_vtable_full (domain, field->parent, TRUE);
- if (!vtable->initialized)
- mono_runtime_class_init (vtable);
+ vtable = mono_class_vtable_full (domain, field->parent, &error);
+ if (!is_ok (&error)) {
+ mono_error_set_pending_exception (&error);
+ return NULL;
+ }
+ if (!vtable->initialized) {
+ if (!mono_runtime_class_init_full (vtable, &error)) {
+ mono_error_set_pending_exception (&error);
+ return NULL;
+ }
+ }
//printf ("SFLDA1 %p\n", (char*)vtable->data + field->offset);
* mono_gsharedvt_constrained_call:
*
* Make a call to CMETHOD using the receiver MP, which is assumed to be of type KLASS. ARGS contains
- * the arguments to the method in the format used by mono_runtime_invoke ().
+ * the arguments to the method in the format used by mono_runtime_invoke_checked ().
*/
MonoObject*
mono_gsharedvt_constrained_call (gpointer mp, MonoMethod *cmethod, MonoClass *klass, gboolean deref_arg, gpointer *args)
{
MonoError error;
+ MonoObject *o;
MonoMethod *m;
gpointer this_arg;
gpointer new_args [16];
args [0] = this_arg;
this_arg = NULL;
}
- return mono_runtime_invoke (m, this_arg, args, NULL);
+
+ o = mono_runtime_invoke_checked (m, this_arg, args, &error);
+ if (!mono_error_ok (&error)) {
+ mono_error_set_pending_exception (&error);
+ return NULL;
+ }
+
+ return o;
}
void
mono_gc_wbarrier_generic_store (dest, *(MonoObject**)src);
}
+void
+ves_icall_runtime_class_init (MonoVTable *vtable)
+{
+ MONO_REQ_GC_UNSAFE_MODE;
+ MonoError error;
+
+ mono_runtime_class_init_full (vtable, &error);
+ mono_error_set_pending_exception (&error);
+}
+
+
void
mono_generic_class_init (MonoVTable *vtable)
{
- mono_runtime_class_init (vtable);
+ MonoError error;
+ mono_runtime_class_init_full (vtable, &error);
+ mono_error_set_pending_exception (&error);
}
gpointer
*/
if (G_UNLIKELY (!ftndesc)) {
gpointer addr = mono_compile_method (del->method);
+
+ if (del->method->klass->valuetype && mono_method_signature (del->method)->hasthis)
+ addr = mono_aot_get_unbox_trampoline (del->method);
+
gpointer arg = mini_get_delegate_arg (del->method, addr);
ftndesc = mini_create_llvmonly_ftndesc (mono_domain_get (), addr, arg);
del->method = method;
del->method_ptr = mono_compile_method (method);
+ if (method->klass->valuetype)
+ del->method_ptr = mono_aot_get_unbox_trampoline (method);
del->extra_arg = mini_get_delegate_arg (del->method, del->method_ptr);
}