aboutsummaryrefslogtreecommitdiff
path: root/src/lj_asm_mips.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_asm_mips.h')
-rw-r--r--src/lj_asm_mips.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lj_asm_mips.h b/src/lj_asm_mips.h
index 513bd5ca..8abb2544 100644
--- a/src/lj_asm_mips.h
+++ b/src/lj_asm_mips.h
@@ -2528,6 +2528,9 @@ static void asm_stack_restore(ASMState *as, SnapShot *snap)
2528 2528
2529/* -- GC handling --------------------------------------------------------- */ 2529/* -- GC handling --------------------------------------------------------- */
2530 2530
2531/* Marker to prevent patching the GC check exit. */
2532#define MIPS_NOPATCH_GC_CHECK MIPSI_OR
2533
2531/* Check GC threshold and do one or more GC steps. */ 2534/* Check GC threshold and do one or more GC steps. */
2532static void asm_gc_check(ASMState *as) 2535static void asm_gc_check(ASMState *as)
2533{ 2536{
@@ -2543,6 +2546,7 @@ static void asm_gc_check(ASMState *as)
2543 args[0] = ASMREF_TMP1; /* global_State *g */ 2546 args[0] = ASMREF_TMP1; /* global_State *g */
2544 args[1] = ASMREF_TMP2; /* MSize steps */ 2547 args[1] = ASMREF_TMP2; /* MSize steps */
2545 asm_gencall(as, ci, args); 2548 asm_gencall(as, ci, args);
2549 l_end[-3] = MIPS_NOPATCH_GC_CHECK; /* Replace the nop after the call. */
2546 emit_tsi(as, MIPSI_AADDIU, ra_releasetmp(as, ASMREF_TMP1), RID_JGL, -32768); 2550 emit_tsi(as, MIPSI_AADDIU, ra_releasetmp(as, ASMREF_TMP1), RID_JGL, -32768);
2547 tmp = ra_releasetmp(as, ASMREF_TMP2); 2551 tmp = ra_releasetmp(as, ASMREF_TMP2);
2548 emit_loadi(as, tmp, as->gcsteps); 2552 emit_loadi(as, tmp, as->gcsteps);
@@ -2694,7 +2698,7 @@ void lj_asm_patchexit(jit_State *J, GCtrace *T, ExitNo exitno, MCode *target)
2694#else 2698#else
2695 (p[-1] & 0xff600000u) == MIPSI_BC1EQZ 2699 (p[-1] & 0xff600000u) == MIPSI_BC1EQZ
2696#endif 2700#endif
2697 )) { 2701 ) && p[-2] != MIPS_NOPATCH_GC_CHECK) {
2698 ptrdiff_t delta = target - p; 2702 ptrdiff_t delta = target - p;
2699 if (((delta + 0x8000) >> 16) == 0) { /* Patch in-range branch. */ 2703 if (((delta + 0x8000) >> 16) == 0) { /* Patch in-range branch. */
2700 patchbranch: 2704 patchbranch: