mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 15:14:08 +00:00
Emit sunk IR_NEWREF only once per key on snapshot replay.
Thanks to Sergey Kaplun and Peter Cawley. #1128
This commit is contained in:
parent
644723649e
commit
1761fd2ef7
@ -575,9 +575,21 @@ void lj_snap_replay(jit_State *J, GCtrace *T)
|
|||||||
if (irr->o == IR_HREFK || irr->o == IR_AREF) {
|
if (irr->o == IR_HREFK || irr->o == IR_AREF) {
|
||||||
IRIns *irf = &T->ir[irr->op1];
|
IRIns *irf = &T->ir[irr->op1];
|
||||||
tmp = emitir(irf->ot, tmp, irf->op2);
|
tmp = emitir(irf->ot, tmp, irf->op2);
|
||||||
|
} else if (irr->o == IR_NEWREF) {
|
||||||
|
IRRef allocref = tref_ref(tr);
|
||||||
|
IRRef keyref = tref_ref(key);
|
||||||
|
IRRef newref_ref = J->chain[IR_NEWREF];
|
||||||
|
IRIns *newref = &J->cur.ir[newref_ref];
|
||||||
|
lua_assert(irref_isk(keyref));
|
||||||
|
if (newref_ref > allocref && newref->op2 == keyref) {
|
||||||
|
lua_assert(newref->op1 == allocref);
|
||||||
|
tmp = newref_ref;
|
||||||
|
goto skip_newref;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tmp = emitir(irr->ot, tmp, key);
|
tmp = emitir(irr->ot, tmp, key);
|
||||||
|
skip_newref:
|
||||||
val = snap_pref(J, T, map, nent, seen, irs->op2);
|
val = snap_pref(J, T, map, nent, seen, irs->op2);
|
||||||
if (val == 0) {
|
if (val == 0) {
|
||||||
IRIns *irc = &T->ir[irs->op2];
|
IRIns *irc = &T->ir[irs->op2];
|
||||||
|
Loading…
Reference in New Issue
Block a user