Code is contributed under MIT/X11 license.
+2009-06-04 Zoltan Varga <vargaz@gmail.com>
+
+ * wrapper-types.h: Delete STATIC_RGCTX_INVOKE.
+
+ * marshal.c (mono_marshal_ret_static_rgctx_invoke): Remove, no longer
+ used.
+
+ * icall.c (ves_icall_System_Delegate_CreateDelegate_internal): Avoid
+ adding a static-rgctx invoke wrapper, it is done by the runtime trampolines.
+
+ * generic-sharing.c (inflate_other_data): Ditto.
+
2009-06-03 Rodrigo Kumpera <rkumpera@novell.com>
* metadata-verify.c: Implement property signature check.
method = mono_marshal_method_from_wrapper (method);
method = mono_class_inflate_generic_method (method, context);
- method = mono_marshal_get_static_rgctx_invoke (method);
}
if (inflated_class->byval_arg.type == MONO_TYPE_ARRAY ||
delegate = mono_object_new (mono_object_domain (type), delegate_class);
- if (mono_method_needs_static_rgctx_invoke (method, FALSE)) {
- method = mono_marshal_get_static_rgctx_invoke (method);
- func = mono_compile_method (method);
- } else if (method->dynamic) {
+ if (method->dynamic) {
/* Creating a trampoline would leak memory */
func = mono_compile_method (method);
} else {
return res;
}
-/*
- * mono_marshal_get_static_rgctx_invoke:
- * @method: a method
- *
- * Generates a wrapper for calling a generic shared method, either
- * static or generic. We need this for virtual generic method lookup
- * and ldftn when we do generic code sharing. Instead of producing
- * the address of the method we produce the address of a wrapper for
- * the method because the wrapper passes the (method) runtime generic
- * context argument which calli cannot do.
- */
-MonoMethod *
-mono_marshal_get_static_rgctx_invoke (MonoMethod *method)
-{
- static gboolean inited = FALSE;
- static int num_wrappers = 0;
-
- MonoMethodBuilder *mb;
- MonoMethod *res;
- MonoClass *target_klass = method->klass;
- MonoMethodSignature *sig = mono_method_signature (method);
- int i;
- char *name;
- GHashTable *cache;
- MonoImage *image = method->klass->image;
-
- cache = get_cache (&image->static_rgctx_invoke_cache, mono_aligned_addr_hash, NULL);
- if ((res = mono_marshal_find_in_cache (cache, method)))
- return res;
-
- if (!inited) {
- mono_counters_register ("Static rgctx invoke wrappers",
- MONO_COUNTER_GENERICS | MONO_COUNTER_INT, &num_wrappers);
- inited = TRUE;
- }
- ++num_wrappers;
-
- name = mono_signature_to_name (mono_method_signature (method), "static_rgctx_invoke");
- mb = mono_mb_new (target_klass, name, MONO_WRAPPER_STATIC_RGCTX_INVOKE);
- g_free (name);
-
- for (i = 0; i < sig->param_count + sig->hasthis; i++)
- mono_mb_emit_ldarg (mb, i);
- mono_mb_emit_op (mb, CEE_CALL, method);
- mono_mb_emit_byte (mb, CEE_RET);
-
- mb->skip_visibility = TRUE;
- res = mono_mb_create_and_cache (cache, method, mb, mono_method_signature (method),
- sig->param_count + sig->hasthis + 4);
- res->flags = method->flags;
-
- mono_mb_free (mb);
-
- return res;
-}
-
static void
mono_mb_emit_auto_layout_exception (MonoMethodBuilder *mb, MonoClass *klass)
{
MonoMethod *
mono_marshal_get_runtime_invoke (MonoMethod *method, gboolean virtual) MONO_INTERNAL;
-MonoMethod *
-mono_marshal_get_static_rgctx_invoke (MonoMethod *method) MONO_INTERNAL;
-
MonoMethod *
mono_marshal_get_managed_wrapper (MonoMethod *method, MonoClass *delegate_klass, MonoObject **this_loc) MONO_INTERNAL;
WRAPPER(COMINTEROP_INVOKE, "cominterop-invoke")
WRAPPER(COMINTEROP, "cominterop")
WRAPPER(ALLOC, "alloc")
-WRAPPER(STATIC_RGCTX_INVOKE, "static-rgctx-invoke")
+
+2009-06-04 Zoltan Varga <vargaz@gmail.com>
+
+ * aot-compiler.c aot-runtime.c: Delete references to static rgctx
+ invoke wrappers, we now use trampolines instead.
+
2009-06-04 Mark Probst <mark.probst@gmail.com>
* mini-darwin.c: The exception thread must not be registered with
if (!klass->generic_class && !klass->rank)
return;
- /*
- * Add rgctx wrappers for cctors since those are called by the runtime, so
- * there is no methodspec for them. This is needed even for shared classes,
- * since rgctx wrappers belong to inflated methods.
- */
- method = mono_class_get_cctor (klass);
- if (method && mono_method_needs_static_rgctx_invoke (method, FALSE))
- add_extra_method (acfg, mono_marshal_get_static_rgctx_invoke (method));
-
iter = NULL;
while ((method = mono_class_get_methods (klass, &iter))) {
if (mono_method_is_generic_sharable_impl (method, FALSE))
case MONO_WRAPPER_STELEMREF:
*method = mono_marshal_get_stelemref ();
break;
- case MONO_WRAPPER_STATIC_RGCTX_INVOKE: {
- MonoMethod *m = decode_method_ref_2 (module, p, &p);
-
- if (!m)
- return NULL;
- *method = mono_marshal_get_static_rgctx_invoke (m);
- break;
- }
case MONO_WRAPPER_SYNCHRONIZED: {
MonoMethod *m = decode_method_ref_2 (module, p, &p);