X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Ftramp-arm64.c;h=6cc8be320f68e950e6f36e929aa1d68cb2fd0ab4;hb=fa7f66c939d6a52b951920d4f2616c898c5a8bc6;hp=4bd7ac33474b3f31f592213448c9774f3f3cbfe5;hpb=ba3384aa88a389c308d8258e4ae66caaa2856221;p=mono.git diff --git a/mono/mini/tramp-arm64.c b/mono/mini/tramp-arm64.c index 4bd7ac33474..6cc8be320f6 100644 --- a/mono/mini/tramp-arm64.c +++ b/mono/mini/tramp-arm64.c @@ -507,10 +507,10 @@ mono_arch_create_general_rgctx_lazy_fetch_trampoline (MonoTrampInfo **info, gboo return buf; } -static gpointer -handler_block_trampoline_helper (gpointer *ptr) +gpointer +mono_arm_handler_block_trampoline_helper (gpointer *ptr) { - MonoJitTlsData *jit_tls = mono_native_tls_get_value (mono_jit_tls_id); + MonoJitTlsData *jit_tls = mono_tls_get_jit_tls (); return jit_tls->handler_block_return_address; } @@ -523,14 +523,10 @@ mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot) MonoJumpInfo *ji = NULL; GSList *unwind_ops = NULL; - g_assert (!aot); - code = buf = mono_global_codeman_reserve (tramp_size); unwind_ops = NULL; - tramp = mono_arch_create_specific_trampoline (NULL, MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD, NULL, NULL); - /* This trampoline restore the call chain of the handler block then jumps into the code that deals with it. */ @@ -538,12 +534,21 @@ mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot) /* * We are in a method frame after the call emitted by OP_CALL_HANDLER. */ - code = mono_arm_emit_imm64 (code, ARMREG_IP0, (guint64)handler_block_trampoline_helper); + if (aot) + code = mono_arm_emit_aotconst (&ji, code, buf, ARMREG_IP0, MONO_PATCH_INFO_JIT_ICALL_ADDR, "mono_arm_handler_block_trampoline_helper"); + else + code = mono_arm_emit_imm64 (code, ARMREG_IP0, (guint64)mono_arm_handler_block_trampoline_helper); /* Set it as the return address so the trampoline will return to it */ arm_movx (code, ARMREG_LR, ARMREG_IP0); /* Call the trampoline */ - code = mono_arm_emit_imm64 (code, ARMREG_IP0, (guint64)tramp); + if (aot) { + char *name = g_strdup_printf ("trampoline_func_%d", MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD); + code = mono_arm_emit_aotconst (&ji, code, buf, ARMREG_IP0, MONO_PATCH_INFO_JIT_ICALL_ADDR, name); + } else { + tramp = mono_arch_create_specific_trampoline (NULL, MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD, NULL, NULL); + code = mono_arm_emit_imm64 (code, ARMREG_IP0, (guint64)tramp); + } arm_brx (code, ARMREG_IP0); mono_arch_flush_icache (buf, code - buf);