diff options
author | Mike Pall <mike> | 2010-01-27 20:06:03 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2010-01-27 20:06:03 +0100 |
commit | 09b8f67cd8d181fdb0f4af3b72b6030f5496cb8b (patch) | |
tree | 418e199ae542e9cc7a0f222a91bb071c98acdfc2 /src | |
parent | 3aeb89226202439c0be07830ae6e71007a7b5dd3 (diff) | |
download | luajit-09b8f67cd8d181fdb0f4af3b72b6030f5496cb8b.tar.gz luajit-09b8f67cd8d181fdb0f4af3b72b6030f5496cb8b.tar.bz2 luajit-09b8f67cd8d181fdb0f4af3b72b6030f5496cb8b.zip |
Expose compressed snapshot map to reflection API.
Update jit.dump module and restore printing of frame separators.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib_jit.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/lib_jit.c b/src/lib_jit.c index f3425d98..4da079c8 100644 --- a/src/lib_jit.c +++ b/src/lib_jit.c | |||
@@ -333,25 +333,14 @@ LJLIB_CF(jit_util_tracesnap) | |||
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 | MSize n, nent = snap->nent; | 335 | MSize n, nent = snap->nent; |
336 | BCReg nslots = snap->nslots; | ||
337 | GCtab *t; | 336 | GCtab *t; |
338 | lua_createtable(L, nslots ? (int)nslots : 1, 0); | 337 | lua_createtable(L, nent+2, 0); |
339 | t = tabV(L->top-1); | 338 | t = tabV(L->top-1); |
340 | setintV(lj_tab_setint(L, t, 0), (int32_t)snap->ref - REF_BIAS); | 339 | setintV(lj_tab_setint(L, t, 0), (int32_t)snap->ref - REF_BIAS); |
341 | /* NYI: get rid of this and expose the compressed slot map. */ | 340 | setintV(lj_tab_setint(L, t, 1), (int32_t)snap->nslots); |
342 | { | 341 | for (n = 0; n < nent; n++) |
343 | BCReg s; | 342 | setintV(lj_tab_setint(L, t, (int32_t)(n+2)), (int32_t)map[n]); |
344 | for (s = 0; s < nslots; s++) { | 343 | setintV(lj_tab_setint(L, t, (int32_t)(nent+2)), (int32_t)SNAP(255, 0, 0)); |
345 | TValue *o = lj_tab_setint(L, t, (int32_t)(s+1)); | ||
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); | ||
354 | } | ||
355 | return 1; | 344 | return 1; |
356 | } | 345 | } |
357 | return 0; | 346 | return 0; |