summaryrefslogtreecommitdiff
path: root/src/lib_jit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib_jit.c')
-rw-r--r--src/lib_jit.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/lib_jit.c b/src/lib_jit.c
index aa421613..f3425d98 100644
--- a/src/lib_jit.c
+++ b/src/lib_jit.c
@@ -332,18 +332,25 @@ LJLIB_CF(jit_util_tracesnap)
332 if (T && sn < T->nsnap) { 332 if (T && sn < T->nsnap) {
333 SnapShot *snap = &T->snap[sn]; 333 SnapShot *snap = &T->snap[sn];
334 SnapEntry *map = &T->snapmap[snap->mapofs]; 334 SnapEntry *map = &T->snapmap[snap->mapofs];
335 BCReg s, nslots = snap->nslots; 335 MSize n, nent = snap->nent;
336 BCReg nslots = snap->nslots;
336 GCtab *t; 337 GCtab *t;
337 lua_createtable(L, nslots ? (int)nslots : 1, 0); 338 lua_createtable(L, nslots ? (int)nslots : 1, 0);
338 t = tabV(L->top-1); 339 t = tabV(L->top-1);
339 setintV(lj_tab_setint(L, t, 0), (int32_t)snap->ref - REF_BIAS); 340 setintV(lj_tab_setint(L, t, 0), (int32_t)snap->ref - REF_BIAS);
340 for (s = 0; s < nslots; s++) { 341 /* NYI: get rid of this and expose the compressed slot map. */
341 TValue *o = lj_tab_setint(L, t, (int32_t)(s+1)); 342 {
342 IRRef ref = snap_ref(map[s]); 343 BCReg s;
343 if (ref) 344 for (s = 0; s < nslots; s++) {
344 setintV(o, (int32_t)ref - REF_BIAS); 345 TValue *o = lj_tab_setint(L, t, (int32_t)(s+1));
345 else
346 setboolV(o, 0); 346 setboolV(o, 0);
347 }
348 }
349 for (n = 0; n < nent; n++) {
350 BCReg s = snap_slot(map[n]);
351 IRRef ref = snap_ref(map[n]);
352 TValue *o = lj_tab_setint(L, t, (int32_t)(s+1));
353 setintV(o, (int32_t)ref - REF_BIAS);
347 } 354 }
348 return 1; 355 return 1;
349 } 356 }