aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lj_record.c1
-rw-r--r--src/lj_snap.c9
2 files changed, 8 insertions, 2 deletions
diff --git a/src/lj_record.c b/src/lj_record.c
index df428818..9e41ce05 100644
--- a/src/lj_record.c
+++ b/src/lj_record.c
@@ -211,6 +211,7 @@ static TRef getcurrf(jit_State *J)
211{ 211{
212 if (J->base[-1-LJ_FR2]) 212 if (J->base[-1-LJ_FR2])
213 return J->base[-1-LJ_FR2]; 213 return J->base[-1-LJ_FR2];
214 /* Non-base frame functions ought to be loaded already. */
214 lj_assertJ(J->baseslot == 1+LJ_FR2, "bad baseslot"); 215 lj_assertJ(J->baseslot == 1+LJ_FR2, "bad baseslot");
215 return sloadt(J, -1-LJ_FR2, IRT_FUNC, IRSLOAD_READONLY); 216 return sloadt(J, -1-LJ_FR2, IRT_FUNC, IRSLOAD_READONLY);
216} 217}
diff --git a/src/lj_snap.c b/src/lj_snap.c
index a21894f6..36f81528 100644
--- a/src/lj_snap.c
+++ b/src/lj_snap.c
@@ -85,8 +85,13 @@ static MSize snapshot_slots(jit_State *J, SnapEntry *map, BCReg nslots)
85 IRIns *ir = &J->cur.ir[ref]; 85 IRIns *ir = &J->cur.ir[ref];
86 if ((LJ_FR2 || !(sn & (SNAP_CONT|SNAP_FRAME))) && 86 if ((LJ_FR2 || !(sn & (SNAP_CONT|SNAP_FRAME))) &&
87 ir->o == IR_SLOAD && ir->op1 == s && ref > retf) { 87 ir->o == IR_SLOAD && ir->op1 == s && ref > retf) {
88 /* No need to snapshot unmodified non-inherited slots. */ 88 /*
89 if (!(ir->op2 & IRSLOAD_INHERIT)) 89 ** No need to snapshot unmodified non-inherited slots.
90 ** But always snapshot the function below a frame in LJ_FR2 mode.
91 */
92 if (!(ir->op2 & IRSLOAD_INHERIT) &&
93 (!LJ_FR2 || s == 0 || s+1 == nslots ||
94 !(J->slot[s+1] & (TREF_CONT|TREF_FRAME))))
90 continue; 95 continue;
91 /* No need to restore readonly slots and unmodified non-parent slots. */ 96 /* No need to restore readonly slots and unmodified non-parent slots. */
92 if (!(LJ_DUALNUM && (ir->op2 & IRSLOAD_CONVERT)) && 97 if (!(LJ_DUALNUM && (ir->op2 & IRSLOAD_CONVERT)) &&