[interp] inflate also on CEE_CALL etc.
authorBernhard Urban <bernhard.urban@xamarin.com>
Tue, 7 Mar 2017 09:46:57 +0000 (10:46 +0100)
committerBernhard Urban <bernhard.urban@xamarin.com>
Wed, 8 Mar 2017 22:02:51 +0000 (23:02 +0100)
also, remove weird hack for delegate.invoke ()

mono/mini/generics.cs
mono/mini/interp/interp.c
mono/mini/interp/transform.c

index 8354e0ba3c104bdc84fc4a5071f49586b82ee7c0..ed5fe014ddf7fdfb2a20cf9816d83e79f71b78b9 100644 (file)
@@ -952,7 +952,6 @@ class Tests
                }
        }
 
-       [Category ("!INTERPRETER")]
        [Category ("GSHAREDVT")]
        static int test_0_synchronized_gshared () {
                var c = new SyncClass<string> ();
index 9c21f957355a86392576325c535753e26b4f4ef5..1101312c2741bd222ba615ea80ba61f41288c32d 100644 (file)
@@ -1654,7 +1654,7 @@ ves_exec_method_with_context (MonoInvocation *frame, ThreadContext *context)
        if (!frame->runtime_method->transformed) {
                context->managed_code = 0;
 #if DEBUG_INTERP
-               char *mn = mono_method_full_name (frame->runtime_method->method, FALSE);
+               char *mn = mono_method_full_name (frame->runtime_method->method, TRUE);
                g_print ("(%p) Transforming %s\n", mono_thread_internal_current (), mn);
                g_free (mn);
 #endif
index e5e2ec931d3b174b7980f0251cc5338381bf51fe..3083b9b0fc9dd73f842e9a0b09e8f2bd797426b0 100644 (file)
@@ -686,18 +686,17 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target
                                        op = MINT_ARRAY_RANK;
                                else if (strcmp (target_method->name, "get_Length") == 0)
                                        op = MINT_LDLEN;
+                       } else if (target_method && generic_context) {
+                               csignature = mono_inflate_generic_signature (csignature, generic_context, &error);
+                               mono_error_cleanup (&error); /* FIXME: don't swallow the error */
+                               target_method = mono_class_inflate_generic_method_checked (target_method, generic_context, &error);
+                               mono_error_cleanup (&error); /* FIXME: don't swallow the error */
                        }
                }
        } else {
                csignature = mono_method_signature (target_method);
        }
 
-       /* TODO: that's oddly specific? */
-       if (generic_context && target_method && !strcmp ("Invoke", target_method->name) && target_method->klass->parent == mono_defaults.multicastdelegate_class) {
-               csignature = mono_inflate_generic_signature (csignature, generic_context, &error);
-               mono_error_cleanup (&error); /* FIXME: don't swallow the error */
-       }
-
        if (constrained_class) {
                if (constrained_class->enumtype && !strcmp (target_method->name, "GetHashCode")) {
                        /* Use the corresponding method from the base type to avoid boxing */