* (C) 2001-2003 Ximian, Inc.
* Copyright 2003-2011 Novell Inc
* Copyright 2011 Xamarin Inc
+ * Licensed under the MIT license. See LICENSE file in the project root for full license information.
*/
#include <config.h>
#include "mini.h"
#include "mini-arm.h"
#include "debugger-agent.h"
+#include "jit-icalls.h"
#define ALIGN_TO(val,align) ((((guint64)val) + ((align) - 1)) & ~((align) - 1))
#ifdef USE_JUMP_TABLES
gpointer *load_get_lmf_addr = NULL, *load_trampoline = NULL;
#else
- guint8 *load_get_lmf_addr = NULL, *load_trampoline = NULL;
+ guint8 *load_get_lmf_addr = NULL, *load_trampoline = NULL;
gpointer *constants;
#endif
-
- int cfa_offset, regsave_size, lr_offset;
+ int i, cfa_offset, regsave_size, lr_offset;
GSList *unwind_ops = NULL;
MonoJumpInfo *ji = NULL;
int buf_len;
mono_add_unwind_op_def_cfa (unwind_ops, code, buf, ARMREG_SP, cfa_offset);
// PC saved at sp+LR_OFFSET
mono_add_unwind_op_offset (unwind_ops, code, buf, ARMREG_LR, -4);
+ /* Callee saved regs */
+ for (i = 0; i < 8; ++i)
+ mono_add_unwind_op_offset (unwind_ops, code, buf, ARMREG_R4 + i, -regsave_size + ((4 + i) * 4));
if (aot) {
/*
* preceeding the got slot where the value is stored. The offset can be
* found at [lr + 0].
*/
+ /* See if emit_trampolines () in aot-compiler.c for the '2' */
if (aot == 2) {
ARM_MOV_REG_REG (code, ARMREG_V2, ARMREG_R1);
} else {
* Have to call the _force_ variant, since there could be a protected wrapper on the top of the stack.
*/
if (aot) {
- ji = mono_patch_info_list_prepend (ji, code - buf, MONO_PATCH_INFO_JIT_ICALL_ADDR, "mono_thread_force_interruption_checkpoint");
+ ji = mono_patch_info_list_prepend (ji, code - buf, MONO_PATCH_INFO_JIT_ICALL_ADDR, "mono_interruption_checkpoint_from_trampoline");
ARM_LDR_IMM (code, ARMREG_IP, ARMREG_PC, 0);
ARM_B (code, 0);
*(gpointer*)code = NULL;
#ifdef USE_JUMP_TABLES
gpointer *jte = mono_jumptable_add_entry ();
code = mono_arm_load_jumptable_entry (code, jte, ARMREG_IP);
- jte [0] = mono_thread_force_interruption_checkpoint;
+ jte [0] = mono_interruption_checkpoint_from_trampoline;
#else
ARM_LDR_IMM (code, ARMREG_IP, ARMREG_PC, 0);
ARM_B (code, 0);
- *(gpointer*)code = mono_thread_force_interruption_checkpoint;
+ *(gpointer*)code = mono_interruption_checkpoint_from_trampoline;
code += 4;
#endif
}
ARM_STR_IMM (code, ARMREG_R0, ARMREG_FP, MONO_STRUCT_OFFSET (MonoContext, regs) + 4 * ARMREG_SP);
/* make ctx.eip hold the address of the call. */
- ARM_SUB_REG_IMM8 (code, ARMREG_LR, ARMREG_LR, 4);
+ //ARM_SUB_REG_IMM8 (code, ARMREG_LR, ARMREG_LR, 4);
ARM_STR_IMM (code, ARMREG_LR, ARMREG_FP, MONO_STRUCT_OFFSET (MonoContext, pc));
/* r0 now points to the MonoContext */
}
#endif
-
-#if defined(ENABLE_GSHAREDVT)
-
-#include "../../../mono-extensions/mono/mini/tramp-arm-gsharedvt.c"
-
-#else
-
-gpointer
-mono_arm_start_gsharedvt_call (GSharedVtCallInfo *info, gpointer *caller, gpointer *callee, gpointer mrgctx_reg)
-{
- g_assert_not_reached ();
- return NULL;
-}
-
-gpointer
-mono_arch_get_gsharedvt_trampoline (MonoTrampInfo **info, gboolean aot)
-{
- *info = NULL;
- return NULL;
-}
-
-#endif /* !MONOTOUCH */