return buf;
}
-static gpointer
-handler_block_trampoline_helper (gpointer *ptr)
+gpointer
+mono_arm_handler_block_trampoline_helper (gpointer *ptr)
{
MonoJitTlsData *jit_tls = mono_tls_get_jit_tls ();
return jit_tls->handler_block_return_address;
MonoJumpInfo *ji = NULL;
GSList *unwind_ops = NULL;
- g_assert (!aot);
-
code = buf = mono_global_codeman_reserve (tramp_size);
unwind_ops = mono_arch_get_cie_program ();
* We are in a method frame after the call emitted by OP_CALL_HANDLER.
*/
/* Obtain jit_tls->handler_block_return_address */
- ARM_LDR_IMM (code, ARMREG_R0, ARMREG_PC, 0);
- ARM_B (code, 0);
- *(gpointer*)code = handler_block_trampoline_helper;
- code += 4;
+ if (aot) {
+ code = mono_arm_emit_aotconst (&ji, code, buf, ARMREG_R0, MONO_PATCH_INFO_JIT_ICALL_ADDR, "mono_arm_handler_block_trampoline_helper");
+ ARM_B (code, 0);
+ } else {
+ ARM_LDR_IMM (code, ARMREG_R0, ARMREG_PC, 0);
+ ARM_B (code, 0);
+ *(gpointer*)code = mono_arm_handler_block_trampoline_helper;
+ code += 4;
+ }
/* Set it as the return address so the trampoline will return to it */
ARM_MOV_REG_REG (code, ARMREG_LR, ARMREG_R0);
/* Call the trampoline */
- ARM_LDR_IMM (code, ARMREG_R0, ARMREG_PC, 0);
- code = emit_bx (code, ARMREG_R0);
- *(gpointer*)code = tramp;
- code += 4;
+ if (aot) {
+ char *name = g_strdup_printf ("trampoline_func_%d", MONO_TRAMPOLINE_HANDLER_BLOCK_GUARD);
+ code = mono_arm_emit_aotconst (&ji, code, buf, ARMREG_R0, MONO_PATCH_INFO_JIT_ICALL_ADDR, name);
+ code = emit_bx (code, ARMREG_R0);
+ } else {
+ ARM_LDR_IMM (code, ARMREG_R0, ARMREG_PC, 0);
+ code = emit_bx (code, ARMREG_R0);
+ *(gpointer*)code = tramp;
+ code += 4;
+ }
mono_arch_flush_icache (buf, code - buf);
mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);