[aot] Use the info->tramp_page_code_offsets array on arm as well.
authorZoltan Varga <vargaz@gmail.com>
Thu, 30 Oct 2014 21:52:33 +0000 (17:52 -0400)
committerZoltan Varga <vargaz@gmail.com>
Thu, 30 Oct 2014 21:52:33 +0000 (17:52 -0400)
mono/mini/aot-compiler.c
mono/mini/aot-runtime.c

index 4b53f0cae197a61f4991636cd2179bafe4f0b333..b6b74d3e5696199a34e4568368274f6e90386dd9 100644 (file)
@@ -1274,6 +1274,11 @@ arch_emit_specific_trampoline_pages (MonoAotCompile *acfg)
                g_assert (code - buf == 8);
                emit_bytes (acfg, buf, code - buf);
        }
+
+       acfg->tramp_page_code_offsets [MONO_AOT_TRAMP_SPECIFIC] = 16;
+       acfg->tramp_page_code_offsets [MONO_AOT_TRAMP_STATIC_RGCTX] = 16;
+       acfg->tramp_page_code_offsets [MONO_AOT_TRAMP_IMT_THUNK] = 72;
+       acfg->tramp_page_code_offsets [MONO_AOT_TRAMP_GSHAREDVT_ARG] = 16;
 #elif defined(TARGET_ARM64)
        arm64_emit_specific_trampoline_pages (acfg);
 #endif
index e9b5f42668a6b634bee63d6e68043e4c050669d1..97d22706db0440ac1d2d695d1bdcd26a93a57f43 100644 (file)
@@ -4476,13 +4476,6 @@ mono_aot_get_trampoline (const char *name)
 #include <mach/mach.h>
 
 static TrampolinePage* trampoline_pages [MONO_AOT_TRAMP_NUM];
-/* these sizes are for ARM code, parametrize if porting to other architectures (see arch_emit_specific_trampoline_pages)
- * trampoline size is assumed to be 8 bytes below as well (8 is the minimum for 32 bit archs, since we need to store
- * two pointers for trampoline in the data page).
- * the minimum for the common code must be at least sizeof(TrampolinePage), since we store the page info at the
- * beginning of the data page.
- */
-static const int trampolines_pages_code_offsets [MONO_AOT_TRAMP_NUM] = {16, 16, 72, 16};
 
 static unsigned char*
 get_new_trampoline_from_page (int tramp_type)
@@ -4571,11 +4564,7 @@ get_new_trampoline_from_page (int tramp_type)
                page = (TrampolinePage*)addr;
                page->next = trampoline_pages [tramp_type];
                trampoline_pages [tramp_type] = page;
-#ifdef TARGET_ARM64
                page->trampolines = (void*)(taddr + amodule->info.tramp_page_code_offsets [tramp_type]);
-#else
-               page->trampolines = (void*)(taddr + trampolines_pages_code_offsets [tramp_type]);
-#endif
                page->trampolines_end = (void*)(taddr + psize - 64);
                code = page->trampolines;
                page->trampolines += specific_trampoline_size;