diff options
Diffstat (limited to '')
-rw-r--r-- | src/lj_asm_arm.h | 1 | ||||
-rw-r--r-- | src/lj_asm_mips.h | 1 | ||||
-rw-r--r-- | src/lj_asm_ppc.h | 1 | ||||
-rw-r--r-- | src/lj_asm_x86.h | 1 | ||||
-rw-r--r-- | src/lj_record.c | 10 |
5 files changed, 8 insertions, 6 deletions
diff --git a/src/lj_asm_arm.h b/src/lj_asm_arm.h index ff4068a3..c64d59e7 100644 --- a/src/lj_asm_arm.h +++ b/src/lj_asm_arm.h | |||
@@ -909,7 +909,6 @@ static void asm_hrefk(ASMState *as, IRIns *ir) | |||
909 | 909 | ||
910 | static void asm_uref(ASMState *as, IRIns *ir) | 910 | static void asm_uref(ASMState *as, IRIns *ir) |
911 | { | 911 | { |
912 | /* NYI: Check that UREFO is still open and not aliasing a slot. */ | ||
913 | Reg dest = ra_dest(as, ir, RSET_GPR); | 912 | Reg dest = ra_dest(as, ir, RSET_GPR); |
914 | if (irref_isk(ir->op1)) { | 913 | if (irref_isk(ir->op1)) { |
915 | GCfunc *fn = ir_kfunc(IR(ir->op1)); | 914 | GCfunc *fn = ir_kfunc(IR(ir->op1)); |
diff --git a/src/lj_asm_mips.h b/src/lj_asm_mips.h index 7bd72fda..ecb38c5d 100644 --- a/src/lj_asm_mips.h +++ b/src/lj_asm_mips.h | |||
@@ -810,7 +810,6 @@ nolo: | |||
810 | 810 | ||
811 | static void asm_uref(ASMState *as, IRIns *ir) | 811 | static void asm_uref(ASMState *as, IRIns *ir) |
812 | { | 812 | { |
813 | /* NYI: Check that UREFO is still open and not aliasing a slot. */ | ||
814 | Reg dest = ra_dest(as, ir, RSET_GPR); | 813 | Reg dest = ra_dest(as, ir, RSET_GPR); |
815 | if (irref_isk(ir->op1)) { | 814 | if (irref_isk(ir->op1)) { |
816 | GCfunc *fn = ir_kfunc(IR(ir->op1)); | 815 | GCfunc *fn = ir_kfunc(IR(ir->op1)); |
diff --git a/src/lj_asm_ppc.h b/src/lj_asm_ppc.h index 0ebed40f..4cf1649a 100644 --- a/src/lj_asm_ppc.h +++ b/src/lj_asm_ppc.h | |||
@@ -717,7 +717,6 @@ static void asm_hrefk(ASMState *as, IRIns *ir) | |||
717 | 717 | ||
718 | static void asm_uref(ASMState *as, IRIns *ir) | 718 | static void asm_uref(ASMState *as, IRIns *ir) |
719 | { | 719 | { |
720 | /* NYI: Check that UREFO is still open and not aliasing a slot. */ | ||
721 | Reg dest = ra_dest(as, ir, RSET_GPR); | 720 | Reg dest = ra_dest(as, ir, RSET_GPR); |
722 | if (irref_isk(ir->op1)) { | 721 | if (irref_isk(ir->op1)) { |
723 | GCfunc *fn = ir_kfunc(IR(ir->op1)); | 722 | GCfunc *fn = ir_kfunc(IR(ir->op1)); |
diff --git a/src/lj_asm_x86.h b/src/lj_asm_x86.h index 66fb4403..6cd3800d 100644 --- a/src/lj_asm_x86.h +++ b/src/lj_asm_x86.h | |||
@@ -1157,7 +1157,6 @@ static void asm_hrefk(ASMState *as, IRIns *ir) | |||
1157 | 1157 | ||
1158 | static void asm_uref(ASMState *as, IRIns *ir) | 1158 | static void asm_uref(ASMState *as, IRIns *ir) |
1159 | { | 1159 | { |
1160 | /* NYI: Check that UREFO is still open and not aliasing a slot. */ | ||
1161 | Reg dest = ra_dest(as, ir, RSET_GPR); | 1160 | Reg dest = ra_dest(as, ir, RSET_GPR); |
1162 | if (irref_isk(ir->op1)) { | 1161 | if (irref_isk(ir->op1)) { |
1163 | GCfunc *fn = ir_kfunc(IR(ir->op1)); | 1162 | GCfunc *fn = ir_kfunc(IR(ir->op1)); |
diff --git a/src/lj_record.c b/src/lj_record.c index 8a72b0c9..568b73aa 100644 --- a/src/lj_record.c +++ b/src/lj_record.c | |||
@@ -1541,13 +1541,17 @@ noconstify: | |||
1541 | /* Note: this effectively limits LJ_MAX_UPVAL to 127. */ | 1541 | /* Note: this effectively limits LJ_MAX_UPVAL to 127. */ |
1542 | uv = (uv << 8) | (hashrot(uvp->dhash, uvp->dhash + HASH_BIAS) & 0xff); | 1542 | uv = (uv << 8) | (hashrot(uvp->dhash, uvp->dhash + HASH_BIAS) & 0xff); |
1543 | if (!uvp->closed) { | 1543 | if (!uvp->closed) { |
1544 | uref = tref_ref(emitir(IRTG(IR_UREFO, IRT_P32), fn, uv)); | ||
1544 | /* In current stack? */ | 1545 | /* In current stack? */ |
1545 | if (uvval(uvp) >= tvref(J->L->stack) && | 1546 | if (uvval(uvp) >= tvref(J->L->stack) && |
1546 | uvval(uvp) < tvref(J->L->maxstack)) { | 1547 | uvval(uvp) < tvref(J->L->maxstack)) { |
1547 | int32_t slot = (int32_t)(uvval(uvp) - (J->L->base - J->baseslot)); | 1548 | int32_t slot = (int32_t)(uvval(uvp) - (J->L->base - J->baseslot)); |
1548 | if (slot >= 0) { /* Aliases an SSA slot? */ | 1549 | if (slot >= 0) { /* Aliases an SSA slot? */ |
1550 | emitir(IRTG(IR_EQ, IRT_P32), | ||
1551 | REF_BASE, | ||
1552 | emitir(IRT(IR_ADD, IRT_P32), uref, | ||
1553 | lj_ir_kint(J, (slot - 1 - LJ_FR2) * -8))); | ||
1549 | slot -= (int32_t)J->baseslot; /* Note: slot number may be negative! */ | 1554 | slot -= (int32_t)J->baseslot; /* Note: slot number may be negative! */ |
1550 | /* NYI: add IR to guard that it's still aliasing the same slot. */ | ||
1551 | if (val == 0) { | 1555 | if (val == 0) { |
1552 | return getslot(J, slot); | 1556 | return getslot(J, slot); |
1553 | } else { | 1557 | } else { |
@@ -1557,7 +1561,9 @@ noconstify: | |||
1557 | } | 1561 | } |
1558 | } | 1562 | } |
1559 | } | 1563 | } |
1560 | uref = tref_ref(emitir(IRTG(IR_UREFO, IRT_P32), fn, uv)); | 1564 | emitir(IRTG(IR_UGT, IRT_P32), |
1565 | emitir(IRT(IR_SUB, IRT_P32), uref, REF_BASE), | ||
1566 | lj_ir_kint(J, (J->baseslot + J->maxslot) * 8)); | ||
1561 | } else { | 1567 | } else { |
1562 | needbarrier = 1; | 1568 | needbarrier = 1; |
1563 | uref = tref_ref(emitir(IRTG(IR_UREFC, IRT_P32), fn, uv)); | 1569 | uref = tref_ref(emitir(IRTG(IR_UREFC, IRT_P32), fn, uv)); |