Compress snapshots using a simple, extensible 1D-compression.

Typically reduces storage overhead for snapshot maps by 60%.
The extensible format is a prerequisite for the next redesign steps:
Eliminate IR_FRAME and implement return-to-lower-frame.
This commit is contained in:
Mike Pall
2010-01-26 21:49:04 +01:00
parent e058714a2e
commit 67ca399a30
11 changed files with 366 additions and 320 deletions

View File

@@ -161,8 +161,8 @@ void lj_trace_reenableproto(GCproto *pt)
static void trace_unpatch(jit_State *J, Trace *T)
{
BCOp op = bc_op(T->startins);
uint32_t pcofs = T->snap[0].mapofs + T->snap[0].nslots;
BCIns *pc = ((BCIns *)(uintptr_t)T->snapmap[pcofs]) - 1;
MSize pcofs = T->snap[0].mapofs + T->snap[0].nent;
BCIns *pc = ((BCIns *)snap_pc(T->snapmap[pcofs])) - 1;
switch (op) {
case BC_FORL:
lua_assert(bc_op(*pc) == BC_JFORI);
@@ -352,7 +352,6 @@ static void trace_start(jit_State *J)
J->cur.ir = J->irbuf;
J->cur.snap = J->snapbuf;
J->cur.snapmap = J->snapmapbuf;
/* J->cur.nsnapmap = 0; */
J->mergesnap = 0;
J->needsnap = 0;
J->guardemit.irt = 0;