In metadata/
authorZoltan Varga <vargaz@gmail.com>
Thu, 4 Jun 2009 17:30:02 +0000 (17:30 -0000)
committerZoltan Varga <vargaz@gmail.com>
Thu, 4 Jun 2009 17:30:02 +0000 (17:30 -0000)
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.

In mini/
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.

svn path=/trunk/mono/; revision=135459

mono/metadata/ChangeLog
mono/metadata/generic-sharing.c
mono/metadata/icall.c
mono/metadata/marshal.c
mono/metadata/marshal.h
mono/metadata/wrapper-types.h
mono/mini/ChangeLog
mono/mini/aot-compiler.c
mono/mini/aot-runtime.c

index 289b872e3043bb29acce76e0f510e16651d90788..1b8da5e980f241b83f6955b676de6803bb8bd342 100644 (file)
 
        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.
index 69c3c902b27479cf2eb9b4bda2fa087f2ba7005f..7f13a82c88a3e8f25ae440416e4ec1601890620c 100644 (file)
@@ -552,7 +552,6 @@ inflate_other_data (gpointer data, int info_type, MonoGenericContext *context, M
 
                        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 ||
index 257d5c87f69cc4b1d54932eadd1fa77bac93fca3..8b99a6dfa25eb3e6dd7e9493d8e36c56ac9c2d85 100644 (file)
@@ -6019,10 +6019,7 @@ ves_icall_System_Delegate_CreateDelegate_internal (MonoReflectionType *type, Mon
 
        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 {
index 3e4e738920b87edd13652007ffe12d4cda40e347..8a2dbb646a60c20c3d446e29d590495fb208e7f8 100644 (file)
@@ -4345,62 +4345,6 @@ handle_enum:
        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)
 {
index 95a38d5c7cb22a5ecb8de5ae20a9ced9a7712cf5..a08f36a6255c163076512704bb76ada54e0fda67 100644 (file)
@@ -184,9 +184,6 @@ mono_marshal_get_delegate_invoke (MonoMethod *method, MonoDelegate *del) MONO_IN
 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;
 
index 6858aaed11cd857f0d66f14e4492a2aa8dc82247..b8a36438690c30c2d4feff74bdb89f9e1e4df14b 100644 (file)
@@ -32,5 +32,5 @@ WRAPPER(UNKNOWN, "unknown")
 WRAPPER(COMINTEROP_INVOKE, "cominterop-invoke")
 WRAPPER(COMINTEROP, "cominterop")
 WRAPPER(ALLOC, "alloc")
-WRAPPER(STATIC_RGCTX_INVOKE, "static-rgctx-invoke")
+
 
index b4fd1a7ac3d517ec0e6208774e3aa5607c662c93..c01ed7a44352381c740e4cc0c3432ef70c770859 100644 (file)
@@ -1,3 +1,8 @@
+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
index 4a93646894c22af998fa88468873e3c406f27679..0c566b7e890675d512fb477e846414e5feac6f54 100644 (file)
@@ -1754,15 +1754,6 @@ add_generic_class (MonoAotCompile *acfg, MonoClass *klass)
        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))
index 13a5db80e4bf766bd44924b54f6ad6fc5237f3f6..d8bd61db15aacce87ffc2c13ee9adac6edede095 100644 (file)
@@ -521,14 +521,6 @@ decode_method_ref (MonoAotModule *module, guint32 *token, MonoMethod **method, g
                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);