aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lj_jit.h10
-rw-r--r--src/lj_opt_loop.c8
-rw-r--r--src/lj_snap.c6
3 files changed, 12 insertions, 12 deletions
diff --git a/src/lj_jit.h b/src/lj_jit.h
index f37e7927..5d41ef4b 100644
--- a/src/lj_jit.h
+++ b/src/lj_jit.h
@@ -166,7 +166,7 @@ typedef struct MCLink {
166 166
167/* Stack snapshot header. */ 167/* Stack snapshot header. */
168typedef struct SnapShot { 168typedef struct SnapShot {
169 uint16_t mapofs; /* Offset into snapshot map. */ 169 uint32_t mapofs; /* Offset into snapshot map. */
170 IRRef1 ref; /* First IR ref for this snapshot. */ 170 IRRef1 ref; /* First IR ref for this snapshot. */
171 uint8_t nslots; /* Number of valid slots. */ 171 uint8_t nslots; /* Number of valid slots. */
172 uint8_t topslot; /* Maximum frame extent. */ 172 uint8_t topslot; /* Maximum frame extent. */
@@ -233,8 +233,7 @@ typedef enum {
233/* Trace object. */ 233/* Trace object. */
234typedef struct GCtrace { 234typedef struct GCtrace {
235 GCHeader; 235 GCHeader;
236 uint8_t topslot; /* Top stack slot already checked to be allocated. */ 236 uint16_t nsnap; /* Number of snapshots. */
237 uint8_t linktype; /* Type of link. */
238 IRRef nins; /* Next IR instruction. Biased with REF_BIAS. */ 237 IRRef nins; /* Next IR instruction. Biased with REF_BIAS. */
239#if LJ_GC64 238#if LJ_GC64
240 uint32_t unused_gc64; 239 uint32_t unused_gc64;
@@ -242,8 +241,7 @@ typedef struct GCtrace {
242 GCRef gclist; 241 GCRef gclist;
243 IRIns *ir; /* IR instructions/constants. Biased with REF_BIAS. */ 242 IRIns *ir; /* IR instructions/constants. Biased with REF_BIAS. */
244 IRRef nk; /* Lowest IR constant. Biased with REF_BIAS. */ 243 IRRef nk; /* Lowest IR constant. Biased with REF_BIAS. */
245 uint16_t nsnap; /* Number of snapshots. */ 244 uint32_t nsnapmap; /* Number of snapshot map elements. */
246 uint16_t nsnapmap; /* Number of snapshot map elements. */
247 SnapShot *snap; /* Snapshot array. */ 245 SnapShot *snap; /* Snapshot array. */
248 SnapEntry *snapmap; /* Snapshot map. */ 246 SnapEntry *snapmap; /* Snapshot map. */
249 GCRef startpt; /* Starting prototype. */ 247 GCRef startpt; /* Starting prototype. */
@@ -260,6 +258,8 @@ typedef struct GCtrace {
260 TraceNo1 nextroot; /* Next root trace for same prototype. */ 258 TraceNo1 nextroot; /* Next root trace for same prototype. */
261 TraceNo1 nextside; /* Next side trace of same root trace. */ 259 TraceNo1 nextside; /* Next side trace of same root trace. */
262 uint8_t sinktags; /* Trace has SINK tags. */ 260 uint8_t sinktags; /* Trace has SINK tags. */
261 uint8_t topslot; /* Top stack slot already checked to be allocated. */
262 uint8_t linktype; /* Type of link. */
263 uint8_t unused1; 263 uint8_t unused1;
264#ifdef LUAJIT_USE_GDBJIT 264#ifdef LUAJIT_USE_GDBJIT
265 void *gdbjit_entry; /* GDB JIT entry. */ 265 void *gdbjit_entry; /* GDB JIT entry. */
diff --git a/src/lj_opt_loop.c b/src/lj_opt_loop.c
index 04c6d06d..441b8add 100644
--- a/src/lj_opt_loop.c
+++ b/src/lj_opt_loop.c
@@ -223,7 +223,7 @@ static void loop_subst_snap(jit_State *J, SnapShot *osnap,
223 } 223 }
224 J->guardemit.irt = 0; 224 J->guardemit.irt = 0;
225 /* Setup new snapshot. */ 225 /* Setup new snapshot. */
226 snap->mapofs = (uint16_t)nmapofs; 226 snap->mapofs = (uint32_t)nmapofs;
227 snap->ref = (IRRef1)J->cur.nins; 227 snap->ref = (IRRef1)J->cur.nins;
228 snap->nslots = nslots; 228 snap->nslots = nslots;
229 snap->topslot = osnap->topslot; 229 snap->topslot = osnap->topslot;
@@ -251,7 +251,7 @@ static void loop_subst_snap(jit_State *J, SnapShot *osnap,
251 nmap += nn; 251 nmap += nn;
252 while (omap < nextmap) /* Copy PC + frame links. */ 252 while (omap < nextmap) /* Copy PC + frame links. */
253 *nmap++ = *omap++; 253 *nmap++ = *omap++;
254 J->cur.nsnapmap = (uint16_t)(nmap - J->cur.snapmap); 254 J->cur.nsnapmap = (uint32_t)(nmap - J->cur.snapmap);
255} 255}
256 256
257typedef struct LoopState { 257typedef struct LoopState {
@@ -369,7 +369,7 @@ static void loop_unroll(LoopState *lps)
369 } 369 }
370 } 370 }
371 if (!irt_isguard(J->guardemit)) /* Drop redundant snapshot. */ 371 if (!irt_isguard(J->guardemit)) /* Drop redundant snapshot. */
372 J->cur.nsnapmap = (uint16_t)J->cur.snap[--J->cur.nsnap].mapofs; 372 J->cur.nsnapmap = (uint32_t)J->cur.snap[--J->cur.nsnap].mapofs;
373 lua_assert(J->cur.nsnapmap <= J->sizesnapmap); 373 lua_assert(J->cur.nsnapmap <= J->sizesnapmap);
374 *psentinel = J->cur.snapmap[J->cur.snap[0].nent]; /* Restore PC. */ 374 *psentinel = J->cur.snapmap[J->cur.snap[0].nent]; /* Restore PC. */
375 375
@@ -383,7 +383,7 @@ static void loop_undo(jit_State *J, IRRef ins, SnapNo nsnap, MSize nsnapmap)
383 SnapShot *snap = &J->cur.snap[nsnap-1]; 383 SnapShot *snap = &J->cur.snap[nsnap-1];
384 SnapEntry *map = J->cur.snapmap; 384 SnapEntry *map = J->cur.snapmap;
385 map[snap->mapofs + snap->nent] = map[J->cur.snap[0].nent]; /* Restore PC. */ 385 map[snap->mapofs + snap->nent] = map[J->cur.snap[0].nent]; /* Restore PC. */
386 J->cur.nsnapmap = (uint16_t)nsnapmap; 386 J->cur.nsnapmap = (uint32_t)nsnapmap;
387 J->cur.nsnap = nsnap; 387 J->cur.nsnap = nsnap;
388 J->guardemit.irt = 0; 388 J->guardemit.irt = 0;
389 lj_ir_rollback(J, ins); 389 lj_ir_rollback(J, ins);
diff --git a/src/lj_snap.c b/src/lj_snap.c
index 44fa379f..ceaf2ca5 100644
--- a/src/lj_snap.c
+++ b/src/lj_snap.c
@@ -161,11 +161,11 @@ static void snapshot_stack(jit_State *J, SnapShot *snap, MSize nsnapmap)
161 nent = snapshot_slots(J, p, nslots); 161 nent = snapshot_slots(J, p, nslots);
162 snap->nent = (uint8_t)nent; 162 snap->nent = (uint8_t)nent;
163 nent += snapshot_framelinks(J, p + nent, &snap->topslot); 163 nent += snapshot_framelinks(J, p + nent, &snap->topslot);
164 snap->mapofs = (uint16_t)nsnapmap; 164 snap->mapofs = (uint32_t)nsnapmap;
165 snap->ref = (IRRef1)J->cur.nins; 165 snap->ref = (IRRef1)J->cur.nins;
166 snap->nslots = (uint8_t)nslots; 166 snap->nslots = (uint8_t)nslots;
167 snap->count = 0; 167 snap->count = 0;
168 J->cur.nsnapmap = (uint16_t)(nsnapmap + nent); 168 J->cur.nsnapmap = (uint32_t)(nsnapmap + nent);
169} 169}
170 170
171/* Add or merge a snapshot. */ 171/* Add or merge a snapshot. */
@@ -326,7 +326,7 @@ void lj_snap_shrink(jit_State *J)
326 snap->nent = (uint8_t)m; 326 snap->nent = (uint8_t)m;
327 nlim = J->cur.nsnapmap - snap->mapofs - 1; 327 nlim = J->cur.nsnapmap - snap->mapofs - 1;
328 while (n <= nlim) map[m++] = map[n++]; /* Move PC + frame links down. */ 328 while (n <= nlim) map[m++] = map[n++]; /* Move PC + frame links down. */
329 J->cur.nsnapmap = (uint16_t)(snap->mapofs + m); /* Free up space in map. */ 329 J->cur.nsnapmap = (uint32_t)(snap->mapofs + m); /* Free up space in map. */
330} 330}
331 331
332/* -- Snapshot access ----------------------------------------------------- */ 332/* -- Snapshot access ----------------------------------------------------- */