2009-02-05 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Thu, 5 Feb 2009 19:29:04 +0000 (19:29 -0000)
committerZoltan Varga <vargaz@gmail.com>
Thu, 5 Feb 2009 19:29:04 +0000 (19:29 -0000)
* class.c (mono_class_inflate_generic_method_full): Set is_mb_open again
after the original method is copied to the inflated method.
(mono_class_get_vtable_entry): Handle rgctx invoke wrappers more efficiently.

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

mono/metadata/ChangeLog
mono/metadata/class.c

index fb9afe0df2518d2f89b72e5b74ff8eaa753135a7..e84f9c195fca494111d5afa0553f4258f4bb41ba 100644 (file)
@@ -1,5 +1,9 @@
 2009-02-05  Zoltan Varga  <vargaz@gmail.com>
 
+       * class.c (mono_class_inflate_generic_method_full): Set is_mb_open again
+       after the original method is copied to the inflated method.
+       (mono_class_get_vtable_entry): Handle rgctx invoke wrappers more efficiently.
+
        * class-internals.h (struct _MonoMethodInflated): Move the is_mb_open
        field to MonoMethod since it only consumes 1 bit there, and 4/8 bytes here.
 
index 0fddc98f47cde92bc150c227917e8937afad8ae5..b564b9c5621b1fb4ce56eaaa58e9ad39a28b453c 100644 (file)
@@ -862,6 +862,7 @@ mono_class_inflate_generic_method_full (MonoMethod *method, MonoClass *klass_hin
        result->is_inflated = TRUE;
        result->is_generic = FALSE;
        result->signature = NULL;
+       result->is_mb_open = is_mb_open;
 
        if (!context->method_inst) {
                /* Set the generic_container of the result to the generic_container of method */
@@ -1732,8 +1733,13 @@ mono_class_get_vtable_entry (MonoClass *class, int offset)
        if (class->generic_class) {
                MonoClass *gklass = class->generic_class->container_class;
                mono_class_setup_vtable (gklass);
-               if (gklass->vtable [offset]->wrapper_type != MONO_WRAPPER_STATIC_RGCTX_INVOKE)
+               if (gklass->vtable [offset]->wrapper_type == MONO_WRAPPER_STATIC_RGCTX_INVOKE) {
+                       MonoMethod *method = mono_marshal_method_from_wrapper (gklass->vtable [offset]);
+                       method = mono_class_inflate_generic_method_full (method, class, mono_class_get_context (class));
+                       return mono_marshal_get_static_rgctx_invoke (method);
+               } else {
                        return mono_class_inflate_generic_method_full (gklass->vtable [offset], class, mono_class_get_context (class));
+               }
        }
 
        if (class->rank == 1) {