diff options
Diffstat (limited to '')
-rw-r--r-- | src/lj_asm_arm.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lj_asm_arm.h b/src/lj_asm_arm.h index e7d2bf17..44dc02e4 100644 --- a/src/lj_asm_arm.h +++ b/src/lj_asm_arm.h | |||
@@ -2033,6 +2033,9 @@ static void asm_stack_restore(ASMState *as, SnapShot *snap) | |||
2033 | 2033 | ||
2034 | /* -- GC handling --------------------------------------------------------- */ | 2034 | /* -- GC handling --------------------------------------------------------- */ |
2035 | 2035 | ||
2036 | /* Marker to prevent patching the GC check exit. */ | ||
2037 | #define ARM_NOPATCH_GC_CHECK (ARMI_BIC|ARMI_K12) | ||
2038 | |||
2036 | /* Check GC threshold and do one or more GC steps. */ | 2039 | /* Check GC threshold and do one or more GC steps. */ |
2037 | static void asm_gc_check(ASMState *as) | 2040 | static void asm_gc_check(ASMState *as) |
2038 | { | 2041 | { |
@@ -2044,6 +2047,7 @@ static void asm_gc_check(ASMState *as) | |||
2044 | l_end = emit_label(as); | 2047 | l_end = emit_label(as); |
2045 | /* Exit trace if in GCSatomic or GCSfinalize. Avoids syncing GC objects. */ | 2048 | /* Exit trace if in GCSatomic or GCSfinalize. Avoids syncing GC objects. */ |
2046 | asm_guardcc(as, CC_NE); /* Assumes asm_snap_prep() already done. */ | 2049 | asm_guardcc(as, CC_NE); /* Assumes asm_snap_prep() already done. */ |
2050 | *--as->mcp = ARM_NOPATCH_GC_CHECK; | ||
2047 | emit_n(as, ARMI_CMP|ARMI_K12|0, RID_RET); | 2051 | emit_n(as, ARMI_CMP|ARMI_K12|0, RID_RET); |
2048 | args[0] = ASMREF_TMP1; /* global_State *g */ | 2052 | args[0] = ASMREF_TMP1; /* global_State *g */ |
2049 | args[1] = ASMREF_TMP2; /* MSize steps */ | 2053 | args[1] = ASMREF_TMP2; /* MSize steps */ |
@@ -2212,7 +2216,8 @@ void lj_asm_patchexit(jit_State *J, GCtrace *T, ExitNo exitno, MCode *target) | |||
2212 | /* Look for bl_cc exitstub, replace with b_cc target. */ | 2216 | /* Look for bl_cc exitstub, replace with b_cc target. */ |
2213 | uint32_t ins = *p; | 2217 | uint32_t ins = *p; |
2214 | if ((ins & 0x0f000000u) == 0x0b000000u && ins < 0xf0000000u && | 2218 | if ((ins & 0x0f000000u) == 0x0b000000u && ins < 0xf0000000u && |
2215 | ((ins ^ (px-p)) & 0x00ffffffu) == 0) { | 2219 | ((ins ^ (px-p)) & 0x00ffffffu) == 0 && |
2220 | p[-1] != ARM_NOPATCH_GC_CHECK) { | ||
2216 | *p = (ins & 0xfe000000u) | (((target-p)-2) & 0x00ffffffu); | 2221 | *p = (ins & 0xfe000000u) | (((target-p)-2) & 0x00ffffffu); |
2217 | cend = p+1; | 2222 | cend = p+1; |
2218 | if (!cstart) cstart = p; | 2223 | if (!cstart) cstart = p; |