g_log ("mono-gc-finalizers", G_LOG_LEVEL_MESSAGE, "<%s at %p> Compiling finalizer.", o->vtable->klass->name, o);
if (!domain->finalize_runtime_invoke) {
- MonoMethod *invoke = mono_marshal_get_runtime_invoke (mono_class_get_method_from_name_flags (mono_defaults.object_class, "Finalize", 0, 0), TRUE, FALSE);
+ MonoMethod *invoke = mono_marshal_get_runtime_invoke (mono_class_get_method_from_name_flags (mono_defaults.object_class, "Finalize", 0, 0), TRUE);
domain->finalize_runtime_invoke = mono_compile_method (invoke);
}
* it means that the compiled code for METHOD does not have to be looked up
* before calling the runtime invoke wrapper. In this case, the wrapper ignores
* its METHOD argument.
- * If PASS_RGCTX is TRUE, the signature of the called method is changed to include a 'gpointer rgctx' as the
- * last argument (after 'this').
*/
MonoMethod *
-mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual_, gboolean pass_rgctx)
+mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual_)
{
MonoMethodSignature *sig, *csig, *callsig;
MonoMethodBuilder *mb;
sig = mono_method_signature (method);
- if (pass_rgctx) {
- sig = sig_to_rgctx_sig (sig);
- callsig = sig_to_rgctx_sig (callsig);
- }
-
target_klass = get_wrapper_target_class (method->klass->image);
/* Try to share wrappers for non-corlib methods with simple signatures */
csig->call_convention = MONO_CALL_C;
#endif
- name = mono_signature_to_name (callsig, pass_rgctx ? (virtual_ ? "runtime_invoke_virtual_rgctx" : "runtime_invoke_rgctx") : (virtual_ ? "runtime_invoke_virtual" : "runtime_invoke"));
+ name = mono_signature_to_name (callsig, virtual_ ? "runtime_invoke_virtual" : "runtime_invoke");
mb = mono_mb_new (target_klass, name, MONO_WRAPPER_RUNTIME_INVOKE);
g_free (name);
info = mono_wrapper_info_create (mb, WRAPPER_SUBTYPE_RUNTIME_INVOKE_NORMAL);
info->d.runtime_invoke.sig = callsig;
- info->d.runtime_invoke.pass_rgctx = pass_rgctx;
/* Somebody may have created it before us */
if (!res) {
MonoMethod *method;
/* For WRAPPER_SUBTYPE_RUNTIME_INVOKE_NORMAL */
MonoMethodSignature *sig;
- gboolean pass_rgctx;
} RuntimeInvokeWrapperInfo;
typedef struct {
mono_marshal_get_delegate_invoke_internal (MonoMethod *method, gboolean callvirt, gboolean static_method_with_first_arg_bound, MonoMethod *target_method);
MonoMethod *
-mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean is_virtual, gboolean pass_rgctx);
+mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean is_virtual);
MonoMethod*
mono_marshal_get_runtime_invoke_dynamic (void);
MonoMethod *wrapper;
if (!method)
return NULL;
- wrapper = mono_marshal_get_runtime_invoke (method, FALSE, FALSE);
+ wrapper = mono_marshal_get_runtime_invoke (method, FALSE);
domain->capture_context_runtime_invoke = mono_compile_method (wrapper);
domain->capture_context_method = mono_compile_method (method);
}
case MONO_WRAPPER_RUNTIME_INVOKE: {
g_assert (info);
encode_value (info->subtype, p, &p);
- encode_value (info->d.runtime_invoke.pass_rgctx, p, &p);
if (info->subtype == WRAPPER_SUBTYPE_RUNTIME_INVOKE_DIRECT || info->subtype == WRAPPER_SUBTYPE_RUNTIME_INVOKE_VIRTUAL)
encode_method_ref (acfg, info->d.runtime_invoke.method, p, &p);
else if (info->subtype == WRAPPER_SUBTYPE_RUNTIME_INVOKE_NORMAL)
mb = mono_mb_new (mono_defaults.object_class, "FOO", MONO_WRAPPER_NONE);
m = mono_mb_create_method (mb, sig, 16);
- return mono_marshal_get_runtime_invoke (m, FALSE, FALSE);
+ return mono_marshal_get_runtime_invoke (m, FALSE);
}
static MonoMethod*
get_runtime_invoke (MonoAotCompile *acfg, MonoMethod *method, gboolean virtual_)
{
- return mono_marshal_get_runtime_invoke (method, virtual_, acfg->aot_opts.llvm_only && mono_method_needs_static_rgctx_invoke (method, TRUE));
+ return mono_marshal_get_runtime_invoke (method, virtual_);
}
static gboolean
}
case MONO_WRAPPER_RUNTIME_INVOKE: {
int subtype = decode_value (p, &p);
- int pass_rgctx = decode_value (p, &p);
if (!target)
return FALSE;
if (!m)
return FALSE;
- ref->method = mono_marshal_get_runtime_invoke (m, FALSE, pass_rgctx);
+ ref->method = mono_marshal_get_runtime_invoke (m, FALSE);
} else if (subtype == WRAPPER_SUBTYPE_RUNTIME_INVOKE_VIRTUAL) {
/* Virtual direct wrapper */
MonoMethod *m = decode_resolve_method_ref (module, p, &p);
if (!m)
return FALSE;
- ref->method = mono_marshal_get_runtime_invoke (m, TRUE, pass_rgctx);
+ ref->method = mono_marshal_get_runtime_invoke (m, TRUE);
} else {
MonoMethodSignature *sig;
if (info->subtype != subtype)
return FALSE;
- if (info->d.runtime_invoke.pass_rgctx != pass_rgctx)
- return FALSE;
g_assert (info->d.runtime_invoke.sig);
if (mono_metadata_signature_equal (sig, info->d.runtime_invoke.sig))
ref->method = target;
MonoVTable *vtable;
MonoDynCallInfo *dyn_call_info;
MonoClass *ret_box_class;
- gboolean needs_rgctx;
MonoMethodSignature *sig;
gboolean gsharedvt_invoke;
gpointer *wrapper_arg;
{
gboolean supported = TRUE;
+ // FIXME:
if (sig->ret->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type (sig->ret)))
supported = FALSE;
RuntimeInvokeInfo *info;
info = g_new0 (RuntimeInvokeInfo, 1);
- info->needs_rgctx = mono_llvm_only && mono_method_needs_static_rgctx_invoke (method, TRUE);
info->compiled_method = compiled_method;
- invoke = mono_marshal_get_runtime_invoke (method, FALSE, info->needs_rgctx);
+ invoke = mono_marshal_get_runtime_invoke (method, FALSE);
info->vtable = mono_class_vtable_full (domain, method->klass, TRUE);
g_assert (info->vtable);
if (method->string_ctor)
sig = mono_marshal_get_string_ctor_signature (method);
- g_assert (!info->needs_rgctx);
for (i = 0; i < sig->param_count; ++i) {
MonoType *t = sig->params [i];
MonoMethod *wrapper;
wrapper = mono_marshal_get_array_accessor_wrapper (method);
- invoke = mono_marshal_get_runtime_invoke (wrapper, FALSE, FALSE);
+ invoke = mono_marshal_get_runtime_invoke (wrapper, FALSE);
callee = wrapper;
} else {
callee = NULL;
int i, pindex;
guint8 buf [512];
guint8 retval [256];
- gpointer rgctx;
if (!dyn_runtime_invoke) {
invoke = mono_marshal_get_runtime_invoke_dynamic ();
}
/* Convert the arguments to the format expected by start_dyn_call () */
- args = (void **)g_alloca ((sig->param_count + sig->hasthis + info->needs_rgctx) * sizeof (gpointer));
+ args = (void **)g_alloca ((sig->param_count + sig->hasthis) * sizeof (gpointer));
pindex = 0;
if (sig->hasthis)
args [pindex ++] = &obj;
args [pindex ++] = params [i];
}
}
- if (info->needs_rgctx) {
- rgctx = mini_method_get_rgctx (method);
- args [pindex ++] = &rgctx;
- }
//printf ("M: %s\n", mono_method_full_name (method, TRUE));
return *(MonoObject**)retval;
}
- // FIXME: Cache this
- if (info->needs_rgctx) {
- MonoMethodSignature *sig = mono_method_signature (method);
- gpointer rgctx;
- gpointer *args;
- int i, pindex;
-
- args = (void **)g_alloca ((sig->param_count + sig->hasthis + info->needs_rgctx) * sizeof (gpointer));
- pindex = 0;
- rgctx = mini_method_get_rgctx (method);
- for (i = 0; i < sig->param_count; ++i)
- args [pindex ++] = params [i];
- args [pindex ++] = &rgctx;
- return runtime_invoke ((MonoObject *)obj, args, exc, info->compiled_method);
- } else {
- return runtime_invoke ((MonoObject *)obj, params, exc, info->compiled_method);
- }
+ return runtime_invoke ((MonoObject *)obj, params, exc, info->compiled_method);
}
typedef struct {
}
mono_compile_method (method);
if (strcmp (method->name, "Finalize") == 0) {
- invoke = mono_marshal_get_runtime_invoke (method, FALSE, FALSE);
+ invoke = mono_marshal_get_runtime_invoke (method, FALSE);
mono_compile_method (invoke);
}
#ifndef DISABLE_REMOTING