Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / mini / tramp-arm64.c
index e8503e61c6c68da41fa2f9ef51cbd4db7e7f58d8..a09fed858fe73688f99cc3924a6c11637d7a10fd 100644 (file)
@@ -79,8 +79,7 @@ mono_arch_get_call_target (guint8 *code)
        code -= 4;
 
        imm = *(guint32*)code;
-       /* Should be a bl */
-       g_assert (((imm >> 31) & 0x1) == 0x1);
+       /* Should be a b/bl */
        g_assert (((imm >> 26) & 0x7) == 0x5);
 
        disp = (imm & 0x3ffffff);
@@ -98,13 +97,6 @@ mono_arch_get_plt_info_offset (guint8 *plt_entry, mgreg_t *regs, guint8 *code)
        return ((guint32*)plt_entry) [4];
 }
 
-gpointer
-mono_arm_handler_block_trampoline_helper (gpointer *ptr)
-{
-       MonoJitTlsData *jit_tls = mono_tls_get_jit_tls ();
-       return jit_tls->handler_block_return_address;
-}
-
 #ifndef DISABLE_JIT
 
 guchar*
@@ -520,52 +512,6 @@ mono_arch_create_general_rgctx_lazy_fetch_trampoline (MonoTrampInfo **info, gboo
        return buf;
 }
 
-gpointer
-mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot)
-{
-       guint8 *tramp;
-       guint8 *code, *buf;
-       int tramp_size = 64;
-       MonoJumpInfo *ji = NULL;
-       GSList *unwind_ops = NULL;
-
-       code = buf = mono_global_codeman_reserve (tramp_size);
-
-       unwind_ops = NULL;
-
-       /*
-       This trampoline restore the call chain of the handler block then jumps into the code that deals with it.
-       */
-
-       /*
-        * We are in a method frame after the call emitted by OP_CALL_HANDLER.
-        */
-       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 */
-       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);
-       mono_profiler_code_buffer_new (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL);
-       g_assert (code - buf <= tramp_size);
-
-       *info = mono_tramp_info_create ("handler_block_trampoline", buf, code - buf, ji, unwind_ops);
-
-       return buf;
-}
-
 /*
  * mono_arch_create_sdb_trampoline:
  *
@@ -807,7 +753,7 @@ mono_arch_get_enter_icall_trampoline (MonoTrampInfo **info)
        g_assert (code - start < buf_len);
 
        mono_arch_flush_icache (start, code - start);
-       mono_profiler_code_buffer_new (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL);
+       MONO_PROFILER_RAISE (jit_code_buffer, (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL));
 
        if (info)
                *info = mono_tramp_info_create ("enter_icall_trampoline", start, code - start, ji, unwind_ops);
@@ -835,13 +781,6 @@ mono_arch_create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_ty
        return NULL;
 }
 
-gpointer
-mono_arch_create_handler_block_trampoline (MonoTrampInfo **info, gboolean aot)
-{
-        g_assert_not_reached ();
-        return NULL;
-}
-
 gpointer
 mono_arch_get_unbox_trampoline (MonoMethod *m, gpointer addr)
 {