2010-01-16 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Sat, 16 Jan 2010 08:32:55 +0000 (08:32 -0000)
committerZoltan Varga <vargaz@gmail.com>
Sat, 16 Jan 2010 08:32:55 +0000 (08:32 -0000)
        * mini-trampolines.c (mono_create_static_rgctx_trampoline): Add an assert.

        * aot-runtime.c (mono_aot_get_method): Handle ftnptr's correctly for the
        ICollection<T> wrappers.

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

mono/mini/ChangeLog
mono/mini/aot-runtime.c
mono/mini/mini-trampolines.c

index 47f76c5d71be3c2b047680826b83259d19d1c57a..8e89f99e8a5d7111138054ad05e7fd8d353103f3 100755 (executable)
@@ -1,3 +1,10 @@
+2010-01-16  Zoltan Varga  <vargaz@gmail.com>
+
+       * mini-trampolines.c (mono_create_static_rgctx_trampoline): Add an assert.
+
+        * aot-runtime.c (mono_aot_get_method): Handle ftnptr's correctly for the
+        ICollection<T> wrappers.
+
 2010-01-16  Zoltan Varga  <vargaz@gmail.com>
 
        * debugger-agent.c (decode_value): Fix the decoding of I/U/PTR.
index a06762c2ebfaae6db46ac627d2e470ca62da71e3..0fdcff0395da9b5ce8c88916eaa51df9cf0312cd 100644 (file)
@@ -2841,8 +2841,11 @@ mono_aot_get_method (MonoDomain *domain, MonoMethod *method)
 
                        code = mono_aot_get_method (domain, m);
                        if (code) {
-                               if (mono_method_needs_static_rgctx_invoke (m, FALSE))
-                                       code = mono_create_static_rgctx_trampoline (m, code);
+                               if (mono_method_needs_static_rgctx_invoke (m, FALSE)) {
+                                       code = mono_create_static_rgctx_trampoline (m, mono_create_ftnptr (domain, code));
+                                       /* The call above returns an ftnptr */
+                                       code = mono_get_addr_from_ftnptr (code);
+                               }
 
                                return code;
                        }
index dd581a2dbd19b197018e7b55f35ba017a38a0cfe..46010dd4194fb48af02a7d13acda86d5fc17be5e 100644 (file)
@@ -81,6 +81,7 @@ rgctx_tramp_info_hash (gconstpointer data)
  * methods code. These trampolines are similar to the unbox trampolines, they
  * perform the same task as the static rgctx wrappers, but they are smaller/faster,
  * and can be made to work with full AOT.
+ * On PPC addr should be an ftnptr and the return value is an ftnptr too.
  */
 gpointer
 mono_create_static_rgctx_trampoline (MonoMethod *m, gpointer addr)
@@ -91,6 +92,10 @@ mono_create_static_rgctx_trampoline (MonoMethod *m, gpointer addr)
        RgctxTrampInfo tmp_info;
        RgctxTrampInfo *info;
 
+#ifdef PPC_USES_FUNCTION_DESCRIPTOR
+       g_assert (((gpointer*)addr) [2] == 0);
+#endif
+
        if (mini_method_get_context (m)->method_inst)
                ctx = mono_method_lookup_rgctx (mono_class_vtable (mono_domain_get (), m->klass), mini_method_get_context (m)->method_inst);
        else