[jit] Simplify the code generation for the mkrefany opcode, the same code can handle...
[mono.git] / mono / mini / exceptions-arm.c
index 4c2b5ce821db200b5cbb1765ac463eb54cde8463..c7f01aab9f5283dfac811bff9672f4135540e7a4 100644 (file)
@@ -14,9 +14,9 @@
 #include <string.h>
 
 #ifndef MONO_CROSS_COMPILE
-#ifdef HAVE_ASM_SIGCONTEXT_H
+#ifdef PLATFORM_ANDROID
 #include <asm/sigcontext.h>
-#endif  /* def HAVE_ASM_SIGCONTEXT_H */
+#endif  /* def PLATFORM_ANDROID */
 #endif
 
 #ifdef HAVE_UCONTEXT_H
@@ -111,6 +111,8 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
        ARM_MOV_REG_REG (code, ARMREG_IP, ARMREG_SP);
        ARM_PUSH (code, MONO_ARM_REGSAVE_MASK);
 
+       ARM_SUB_REG_IMM8 (code, ARMREG_SP, ARMREG_SP, 8);
+
        /* restore all the regs from ctx (in r0), but not sp, the stack pointer */
        ctx_reg = ARMREG_R0;
        ARM_LDR_IMM (code, ARMREG_IP, ctx_reg, MONO_STRUCT_OFFSET (MonoContext, pc));
@@ -121,6 +123,8 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot)
        ARM_MOV_REG_REG (code, ARMREG_LR, ARMREG_PC);
        ARM_MOV_REG_REG (code, ARMREG_PC, ARMREG_R1);
 
+       ARM_ADD_REG_IMM8 (code, ARMREG_SP, ARMREG_SP, 8);
+
        /* epilog */
        ARM_POP_NWB (code, 0xff0 | ((1 << ARMREG_SP) | (1 << ARMREG_PC)));
 
@@ -601,8 +605,6 @@ mono_arch_ip_from_context (void *sigctx)
 {
 #ifdef MONO_CROSS_COMPILE
        g_assert_not_reached ();
-#elif defined(__native_client__)
-       g_assert_not_reached ();
 #else
        arm_ucontext *my_uc = sigctx;
        return (void*) UCONTEXT_REG_PC (my_uc);