Use direct method addresses in the unbox trampoline table as well on ios.
authorZoltan Varga <vargaz@gmail.com>
Tue, 12 Feb 2013 11:24:15 +0000 (12:24 +0100)
committerZoltan Varga <vargaz@gmail.com>
Tue, 12 Feb 2013 11:24:27 +0000 (12:24 +0100)
mono/mini/aot-compiler.c
mono/mini/aot-runtime.c

index 132c449cd61eedb17172508ce54ee93403c02b40..529706ba1b6a4911f98134fdb8aa4ba15547a489 100644 (file)
@@ -222,9 +222,7 @@ typedef struct MonoAotCompile {
        gboolean thumb_mixed, need_no_dead_strip, need_pt_gnu_stack;
        GHashTable *ginst_hash;
        gboolean global_symbols;
-#ifdef MONOTOUCH
        gboolean direct_method_addresses;
-#endif
 } MonoAotCompile;
 
 typedef struct {
@@ -6637,7 +6635,10 @@ emit_code (MonoAotCompile *acfg)
                        sprintf (symbol, "ut_%d", index);
 
                        emit_int32 (acfg, index);
-                       emit_symbol_diff (acfg, symbol, end_symbol, 0);
+                       if (acfg->direct_method_addresses)
+                               emit_pointer (acfg, symbol);
+                       else
+                               emit_symbol_diff (acfg, symbol, end_symbol, 0);
                        /* Make sure the table is sorted by index */
                        g_assert (index > prev_index);
                        prev_index = index;
index f98b0de6ba5c720aecb3a73a03bd254218103448..d6665c208eb6d853d59a6366eabcc9b567af2030 100644 (file)
@@ -4323,7 +4323,10 @@ mono_aot_get_unbox_trampoline (MonoMethod *method)
                } else if (entry [0] > method_index) {
                        high = entry_index;
                } else {
-                       code = amodule->code + entry [1];
+                       if (amodule->info.flags & MONO_AOT_FILE_FLAG_DIRECT_METHOD_ADDRESSES)
+                               code = (gpointer)(gsize)entry [1];
+                       else
+                               code = amodule->code + entry [1];
                        break;
                }
        }