aboutsummaryrefslogtreecommitdiff
path: root/src/lj_record.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lj_record.c10
1 files changed, 8 insertions, 2 deletions
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));