summaryrefslogtreecommitdiff
path: root/src/lj_asm_x86.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lj_asm_x86.h')
-rw-r--r--src/lj_asm_x86.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lj_asm_x86.h b/src/lj_asm_x86.h
index fb46b3ad..dfc853dd 100644
--- a/src/lj_asm_x86.h
+++ b/src/lj_asm_x86.h
@@ -2191,9 +2191,10 @@ static void asm_hiop(ASMState *as, IRIns *ir)
2191 2191
2192/* Check Lua stack size for overflow. Use exit handler as fallback. */ 2192/* Check Lua stack size for overflow. Use exit handler as fallback. */
2193static void asm_stack_check(ASMState *as, BCReg topslot, 2193static void asm_stack_check(ASMState *as, BCReg topslot,
2194 Reg pbase, RegSet allow, ExitNo exitno) 2194 IRIns *irp, RegSet allow, ExitNo exitno)
2195{ 2195{
2196 /* Try to get an unused temp. register, otherwise spill/restore eax. */ 2196 /* Try to get an unused temp. register, otherwise spill/restore eax. */
2197 Reg pbase = irp ? irp->r : RID_BASE;
2197 Reg r = allow ? rset_pickbot(allow) : RID_EAX; 2198 Reg r = allow ? rset_pickbot(allow) : RID_EAX;
2198 emit_jcc(as, CC_B, exitstub_addr(as->J, exitno)); 2199 emit_jcc(as, CC_B, exitstub_addr(as->J, exitno));
2199 if (allow == RSET_EMPTY) /* Restore temp. register. */ 2200 if (allow == RSET_EMPTY) /* Restore temp. register. */
@@ -2344,7 +2345,7 @@ static void asm_head_root_base(ASMState *as)
2344} 2345}
2345 2346
2346/* Coalesce or reload BASE register for a side trace. */ 2347/* Coalesce or reload BASE register for a side trace. */
2347static RegSet asm_head_side_base(ASMState *as, Reg pbase, RegSet allow) 2348static RegSet asm_head_side_base(ASMState *as, IRIns *irp, RegSet allow)
2348{ 2349{
2349 IRIns *ir = IR(REF_BASE); 2350 IRIns *ir = IR(REF_BASE);
2350 Reg r = ir->r; 2351 Reg r = ir->r;
@@ -2352,11 +2353,11 @@ static RegSet asm_head_side_base(ASMState *as, Reg pbase, RegSet allow)
2352 ra_free(as, r); 2353 ra_free(as, r);
2353 if (rset_test(as->modset, r)) 2354 if (rset_test(as->modset, r))
2354 ir->r = RID_INIT; /* No inheritance for modified BASE register. */ 2355 ir->r = RID_INIT; /* No inheritance for modified BASE register. */
2355 if (pbase == r) { 2356 if (irp->r == r) {
2356 rset_clear(allow, r); /* Mark same BASE register as coalesced. */ 2357 rset_clear(allow, r); /* Mark same BASE register as coalesced. */
2357 } else if (ra_hasreg(pbase) && rset_test(as->freeset, pbase)) { 2358 } else if (ra_hasreg(irp->r) && rset_test(as->freeset, irp->r)) {
2358 rset_clear(allow, pbase); 2359 rset_clear(allow, irp->r);
2359 emit_rr(as, XO_MOV, r, pbase); /* Move from coalesced parent register. */ 2360 emit_rr(as, XO_MOV, r, irp->r); /* Move from coalesced parent reg. */
2360 } else { 2361 } else {
2361 emit_getgl(as, r, jit_base); /* Otherwise reload BASE. */ 2362 emit_getgl(as, r, jit_base); /* Otherwise reload BASE. */
2362 } 2363 }