diff options
-rw-r--r-- | src/lj_asm_arm.h | 7 | ||||
-rw-r--r-- | src/lj_asm_mips.h | 5 | ||||
-rw-r--r-- | src/lj_asm_ppc.h | 5 | ||||
-rw-r--r-- | src/lj_asm_x86.h | 5 |
4 files changed, 14 insertions, 8 deletions
diff --git a/src/lj_asm_arm.h b/src/lj_asm_arm.h index 0ab3a567..72f205d9 100644 --- a/src/lj_asm_arm.h +++ b/src/lj_asm_arm.h | |||
@@ -493,6 +493,7 @@ static void asm_retf(ASMState *as, IRIns *ir) | |||
493 | int32_t delta = 1+bc_a(*((const BCIns *)pc - 1)); | 493 | int32_t delta = 1+bc_a(*((const BCIns *)pc - 1)); |
494 | as->topslot -= (BCReg)delta; | 494 | as->topslot -= (BCReg)delta; |
495 | if ((int32_t)as->topslot < 0) as->topslot = 0; | 495 | if ((int32_t)as->topslot < 0) as->topslot = 0; |
496 | irt_setmark(IR(REF_BASE)->t); /* Children must not coalesce with BASE reg. */ | ||
496 | /* Need to force a spill on REF_BASE now to update the stack slot. */ | 497 | /* Need to force a spill on REF_BASE now to update the stack slot. */ |
497 | emit_lso(as, ARMI_STR, base, RID_SP, ra_spill(as, IR(REF_BASE))); | 498 | emit_lso(as, ARMI_STR, base, RID_SP, ra_spill(as, IR(REF_BASE))); |
498 | emit_setgl(as, base, jit_base); | 499 | emit_setgl(as, base, jit_base); |
@@ -2102,7 +2103,8 @@ static void asm_head_root_base(ASMState *as) | |||
2102 | IRIns *ir; | 2103 | IRIns *ir; |
2103 | asm_head_lreg(as); | 2104 | asm_head_lreg(as); |
2104 | ir = IR(REF_BASE); | 2105 | ir = IR(REF_BASE); |
2105 | if (ra_hasreg(ir->r) && rset_test(as->modset, ir->r)) ra_spill(as, ir); | 2106 | if (ra_hasreg(ir->r) && (rset_test(as->modset, ir->r) || irt_ismarked(ir->t))) |
2107 | ra_spill(as, ir); | ||
2106 | ra_destreg(as, ir, RID_BASE); | 2108 | ra_destreg(as, ir, RID_BASE); |
2107 | } | 2109 | } |
2108 | 2110 | ||
@@ -2112,7 +2114,8 @@ static RegSet asm_head_side_base(ASMState *as, IRIns *irp, RegSet allow) | |||
2112 | IRIns *ir; | 2114 | IRIns *ir; |
2113 | asm_head_lreg(as); | 2115 | asm_head_lreg(as); |
2114 | ir = IR(REF_BASE); | 2116 | ir = IR(REF_BASE); |
2115 | if (ra_hasreg(ir->r) && rset_test(as->modset, ir->r)) ra_spill(as, ir); | 2117 | if (ra_hasreg(ir->r) && (rset_test(as->modset, ir->r) || irt_ismarked(ir->t))) |
2118 | ra_spill(as, ir); | ||
2116 | if (ra_hasspill(irp->s)) { | 2119 | if (ra_hasspill(irp->s)) { |
2117 | rset_clear(allow, ra_dest(as, ir, allow)); | 2120 | rset_clear(allow, ra_dest(as, ir, allow)); |
2118 | } else { | 2121 | } else { |
diff --git a/src/lj_asm_mips.h b/src/lj_asm_mips.h index f5b0bab6..e5c67b53 100644 --- a/src/lj_asm_mips.h +++ b/src/lj_asm_mips.h | |||
@@ -394,6 +394,7 @@ static void asm_retf(ASMState *as, IRIns *ir) | |||
394 | int32_t delta = 1+bc_a(*((const BCIns *)pc - 1)); | 394 | int32_t delta = 1+bc_a(*((const BCIns *)pc - 1)); |
395 | as->topslot -= (BCReg)delta; | 395 | as->topslot -= (BCReg)delta; |
396 | if ((int32_t)as->topslot < 0) as->topslot = 0; | 396 | if ((int32_t)as->topslot < 0) as->topslot = 0; |
397 | irt_setmark(IR(REF_BASE)->t); /* Children must not coalesce with BASE reg. */ | ||
397 | emit_setgl(as, base, jit_base); | 398 | emit_setgl(as, base, jit_base); |
398 | emit_addptr(as, base, -8*delta); | 399 | emit_addptr(as, base, -8*delta); |
399 | asm_guard(as, MIPSI_BNE, RID_TMP, | 400 | asm_guard(as, MIPSI_BNE, RID_TMP, |
@@ -1723,7 +1724,7 @@ static void asm_head_root_base(ASMState *as) | |||
1723 | if (as->loopinv) as->mctop--; | 1724 | if (as->loopinv) as->mctop--; |
1724 | if (ra_hasreg(r)) { | 1725 | if (ra_hasreg(r)) { |
1725 | ra_free(as, r); | 1726 | ra_free(as, r); |
1726 | if (rset_test(as->modset, r)) | 1727 | if (rset_test(as->modset, r) || irt_ismarked(ir->t)) |
1727 | ir->r = RID_INIT; /* No inheritance for modified BASE register. */ | 1728 | ir->r = RID_INIT; /* No inheritance for modified BASE register. */ |
1728 | if (r != RID_BASE) | 1729 | if (r != RID_BASE) |
1729 | emit_move(as, r, RID_BASE); | 1730 | emit_move(as, r, RID_BASE); |
@@ -1738,7 +1739,7 @@ static RegSet asm_head_side_base(ASMState *as, IRIns *irp, RegSet allow) | |||
1738 | if (as->loopinv) as->mctop--; | 1739 | if (as->loopinv) as->mctop--; |
1739 | if (ra_hasreg(r)) { | 1740 | if (ra_hasreg(r)) { |
1740 | ra_free(as, r); | 1741 | ra_free(as, r); |
1741 | if (rset_test(as->modset, r)) | 1742 | if (rset_test(as->modset, r) || irt_ismarked(ir->t)) |
1742 | ir->r = RID_INIT; /* No inheritance for modified BASE register. */ | 1743 | ir->r = RID_INIT; /* No inheritance for modified BASE register. */ |
1743 | if (irp->r == r) { | 1744 | if (irp->r == r) { |
1744 | rset_clear(allow, r); /* Mark same BASE register as coalesced. */ | 1745 | rset_clear(allow, r); /* Mark same BASE register as coalesced. */ |
diff --git a/src/lj_asm_ppc.h b/src/lj_asm_ppc.h index 57fd2513..e1a496a7 100644 --- a/src/lj_asm_ppc.h +++ b/src/lj_asm_ppc.h | |||
@@ -381,6 +381,7 @@ static void asm_retf(ASMState *as, IRIns *ir) | |||
381 | int32_t delta = 1+bc_a(*((const BCIns *)pc - 1)); | 381 | int32_t delta = 1+bc_a(*((const BCIns *)pc - 1)); |
382 | as->topslot -= (BCReg)delta; | 382 | as->topslot -= (BCReg)delta; |
383 | if ((int32_t)as->topslot < 0) as->topslot = 0; | 383 | if ((int32_t)as->topslot < 0) as->topslot = 0; |
384 | irt_setmark(IR(REF_BASE)->t); /* Children must not coalesce with BASE reg. */ | ||
384 | emit_setgl(as, base, jit_base); | 385 | emit_setgl(as, base, jit_base); |
385 | emit_addptr(as, base, -8*delta); | 386 | emit_addptr(as, base, -8*delta); |
386 | asm_guardcc(as, CC_NE); | 387 | asm_guardcc(as, CC_NE); |
@@ -1901,7 +1902,7 @@ static void asm_head_root_base(ASMState *as) | |||
1901 | Reg r = ir->r; | 1902 | Reg r = ir->r; |
1902 | if (ra_hasreg(r)) { | 1903 | if (ra_hasreg(r)) { |
1903 | ra_free(as, r); | 1904 | ra_free(as, r); |
1904 | if (rset_test(as->modset, r)) | 1905 | if (rset_test(as->modset, r) || irt_ismarked(ir->t)) |
1905 | ir->r = RID_INIT; /* No inheritance for modified BASE register. */ | 1906 | ir->r = RID_INIT; /* No inheritance for modified BASE register. */ |
1906 | if (r != RID_BASE) | 1907 | if (r != RID_BASE) |
1907 | emit_mr(as, r, RID_BASE); | 1908 | emit_mr(as, r, RID_BASE); |
@@ -1915,7 +1916,7 @@ static RegSet asm_head_side_base(ASMState *as, IRIns *irp, RegSet allow) | |||
1915 | Reg r = ir->r; | 1916 | Reg r = ir->r; |
1916 | if (ra_hasreg(r)) { | 1917 | if (ra_hasreg(r)) { |
1917 | ra_free(as, r); | 1918 | ra_free(as, r); |
1918 | if (rset_test(as->modset, r)) | 1919 | if (rset_test(as->modset, r) || irt_ismarked(ir->t)) |
1919 | ir->r = RID_INIT; /* No inheritance for modified BASE register. */ | 1920 | ir->r = RID_INIT; /* No inheritance for modified BASE register. */ |
1920 | if (irp->r == r) { | 1921 | if (irp->r == r) { |
1921 | rset_clear(allow, r); /* Mark same BASE register as coalesced. */ | 1922 | rset_clear(allow, r); /* Mark same BASE register as coalesced. */ |
diff --git a/src/lj_asm_x86.h b/src/lj_asm_x86.h index 98a08d97..fda911e5 100644 --- a/src/lj_asm_x86.h +++ b/src/lj_asm_x86.h | |||
@@ -647,6 +647,7 @@ static void asm_retf(ASMState *as, IRIns *ir) | |||
647 | int32_t delta = 1+bc_a(*((const BCIns *)pc - 1)); | 647 | int32_t delta = 1+bc_a(*((const BCIns *)pc - 1)); |
648 | as->topslot -= (BCReg)delta; | 648 | as->topslot -= (BCReg)delta; |
649 | if ((int32_t)as->topslot < 0) as->topslot = 0; | 649 | if ((int32_t)as->topslot < 0) as->topslot = 0; |
650 | irt_setmark(IR(REF_BASE)->t); /* Children must not coalesce with BASE reg. */ | ||
650 | emit_setgl(as, base, jit_base); | 651 | emit_setgl(as, base, jit_base); |
651 | emit_addptr(as, base, -8*delta); | 652 | emit_addptr(as, base, -8*delta); |
652 | asm_guardcc(as, CC_NE); | 653 | asm_guardcc(as, CC_NE); |
@@ -2481,7 +2482,7 @@ static void asm_head_root_base(ASMState *as) | |||
2481 | Reg r = ir->r; | 2482 | Reg r = ir->r; |
2482 | if (ra_hasreg(r)) { | 2483 | if (ra_hasreg(r)) { |
2483 | ra_free(as, r); | 2484 | ra_free(as, r); |
2484 | if (rset_test(as->modset, r)) | 2485 | if (rset_test(as->modset, r) || irt_ismarked(ir->t)) |
2485 | ir->r = RID_INIT; /* No inheritance for modified BASE register. */ | 2486 | ir->r = RID_INIT; /* No inheritance for modified BASE register. */ |
2486 | if (r != RID_BASE) | 2487 | if (r != RID_BASE) |
2487 | emit_rr(as, XO_MOV, r, RID_BASE); | 2488 | emit_rr(as, XO_MOV, r, RID_BASE); |
@@ -2495,7 +2496,7 @@ static RegSet asm_head_side_base(ASMState *as, IRIns *irp, RegSet allow) | |||
2495 | Reg r = ir->r; | 2496 | Reg r = ir->r; |
2496 | if (ra_hasreg(r)) { | 2497 | if (ra_hasreg(r)) { |
2497 | ra_free(as, r); | 2498 | ra_free(as, r); |
2498 | if (rset_test(as->modset, r)) | 2499 | if (rset_test(as->modset, r) || irt_ismarked(ir->t)) |
2499 | ir->r = RID_INIT; /* No inheritance for modified BASE register. */ | 2500 | ir->r = RID_INIT; /* No inheritance for modified BASE register. */ |
2500 | if (irp->r == r) { | 2501 | if (irp->r == r) { |
2501 | rset_clear(allow, r); /* Mark same BASE register as coalesced. */ | 2502 | rset_clear(allow, r); /* Mark same BASE register as coalesced. */ |