aboutsummaryrefslogtreecommitdiff
path: root/src/lj_asm_arm.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_asm_arm.h')
-rw-r--r--src/lj_asm_arm.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lj_asm_arm.h b/src/lj_asm_arm.h
index 087530b2..e884df5e 100644
--- a/src/lj_asm_arm.h
+++ b/src/lj_asm_arm.h
@@ -2040,6 +2040,9 @@ static void asm_stack_restore(ASMState *as, SnapShot *snap)
2040 2040
2041/* -- GC handling --------------------------------------------------------- */ 2041/* -- GC handling --------------------------------------------------------- */
2042 2042
2043/* Marker to prevent patching the GC check exit. */
2044#define ARM_NOPATCH_GC_CHECK (ARMI_BIC|ARMI_K12)
2045
2043/* Check GC threshold and do one or more GC steps. */ 2046/* Check GC threshold and do one or more GC steps. */
2044static void asm_gc_check(ASMState *as) 2047static void asm_gc_check(ASMState *as)
2045{ 2048{
@@ -2051,6 +2054,7 @@ static void asm_gc_check(ASMState *as)
2051 l_end = emit_label(as); 2054 l_end = emit_label(as);
2052 /* Exit trace if in GCSatomic or GCSfinalize. Avoids syncing GC objects. */ 2055 /* Exit trace if in GCSatomic or GCSfinalize. Avoids syncing GC objects. */
2053 asm_guardcc(as, CC_NE); /* Assumes asm_snap_prep() already done. */ 2056 asm_guardcc(as, CC_NE); /* Assumes asm_snap_prep() already done. */
2057 *--as->mcp = ARM_NOPATCH_GC_CHECK;
2054 emit_n(as, ARMI_CMP|ARMI_K12|0, RID_RET); 2058 emit_n(as, ARMI_CMP|ARMI_K12|0, RID_RET);
2055 args[0] = ASMREF_TMP1; /* global_State *g */ 2059 args[0] = ASMREF_TMP1; /* global_State *g */
2056 args[1] = ASMREF_TMP2; /* MSize steps */ 2060 args[1] = ASMREF_TMP2; /* MSize steps */
@@ -2349,7 +2353,8 @@ void lj_asm_patchexit(jit_State *J, GCtrace *T, ExitNo exitno, MCode *target)
2349 /* Look for bl_cc exitstub, replace with b_cc target. */ 2353 /* Look for bl_cc exitstub, replace with b_cc target. */
2350 uint32_t ins = *p; 2354 uint32_t ins = *p;
2351 if ((ins & 0x0f000000u) == 0x0b000000u && ins < 0xf0000000u && 2355 if ((ins & 0x0f000000u) == 0x0b000000u && ins < 0xf0000000u &&
2352 ((ins ^ (px-p)) & 0x00ffffffu) == 0) { 2356 ((ins ^ (px-p)) & 0x00ffffffu) == 0 &&
2357 p[-1] != ARM_NOPATCH_GC_CHECK) {
2353 *p = (ins & 0xfe000000u) | (((target-p)-2) & 0x00ffffffu); 2358 *p = (ins & 0xfe000000u) | (((target-p)-2) & 0x00ffffffu);
2354 cend = p+1; 2359 cend = p+1;
2355 if (!cstart) cstart = p; 2360 if (!cstart) cstart = p;