aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Pall <mike>2016-05-20 20:26:39 +0200
committerMike Pall <mike>2016-05-20 20:26:39 +0200
commit475a6ae33fc4b28d4c1c7a5f663ea933e0ccbdfd (patch)
treec6f2cc8862e7e4db1a8afc0bc73a6fef56878f99
parentd4f3b1136b08ec65cf7e76691d63a7730d832ddc (diff)
parent37e1e70313367d0264be9a2b9e563a8a94745303 (diff)
downloadluajit-475a6ae33fc4b28d4c1c7a5f663ea933e0ccbdfd.tar.gz
luajit-475a6ae33fc4b28d4c1c7a5f663ea933e0ccbdfd.tar.bz2
luajit-475a6ae33fc4b28d4c1c7a5f663ea933e0ccbdfd.zip
Merge branch 'master' into v2.1
Diffstat (limited to '')
-rw-r--r--doc/status.html6
-rw-r--r--src/lj_asm_arm.h1
-rw-r--r--src/lj_asm_mips.h1
-rw-r--r--src/lj_asm_ppc.h1
-rw-r--r--src/lj_asm_x86.h1
-rw-r--r--src/lj_record.c10
6 files changed, 8 insertions, 12 deletions
diff --git a/doc/status.html b/doc/status.html
index 6f57db1b..d10033b0 100644
--- a/doc/status.html
+++ b/doc/status.html
@@ -91,12 +91,6 @@ hooks for non-Lua functions) and shows slightly different behavior
91in LuaJIT (no per-coroutine hooks, no tail call counting). 91in LuaJIT (no per-coroutine hooks, no tail call counting).
92</li> 92</li>
93<li> 93<li>
94Some checks are missing in the JIT-compiled code for obscure situations
95with <b>open upvalues aliasing</b> one of the SSA slots later on (or
96vice versa). Bonus points, if you can find a real world test case for
97this.
98</li>
99<li>
100Currently some <b>out-of-memory</b> errors from <b>on-trace code</b> are not 94Currently some <b>out-of-memory</b> errors from <b>on-trace code</b> are not
101handled correctly. The error may fall through an on-trace 95handled correctly. The error may fall through an on-trace
102<tt>pcall</tt> or it may be passed on to the function set with 96<tt>pcall</tt> or it may be passed on to the function set with
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
910static void asm_uref(ASMState *as, IRIns *ir) 910static 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
811static void asm_uref(ASMState *as, IRIns *ir) 811static 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
718static void asm_uref(ASMState *as, IRIns *ir) 718static 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
1158static void asm_uref(ASMState *as, IRIns *ir) 1158static 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));