Add shadow frame link stack for trace recorder.

Simplifies snapshots. Prerequisite for pre-call snapshots.
Increases consistency for fast function calls, too.
This commit is contained in:
Mike Pall
2010-02-04 03:08:29 +01:00
parent 78f5e2ffd3
commit 7256690364
6 changed files with 82 additions and 56 deletions

View File

@@ -3042,7 +3042,7 @@ static void asm_tail_sync(ASMState *as)
SnapShot *snap = &as->T->snap[as->T->nsnap-1]; /* Last snapshot. */
MSize n, nent = snap->nent;
SnapEntry *map = &as->T->snapmap[snap->mapofs];
SnapEntry *flinks = map + nent + snap->nframelinks;
SnapEntry *flinks = map + nent + 1;
BCReg newbase = 0;
BCReg nslots, topslot = 0;
@@ -3116,11 +3116,11 @@ static void asm_tail_sync(ASMState *as)
if (!(sn & (SNAP_CONT|SNAP_FRAME)))
emit_movmroi(as, RID_BASE, ofs+4, irt_toitype(ir->t));
else if (s != 0) /* Do not overwrite link to previous frame. */
emit_movmroi(as, RID_BASE, ofs+4, (int32_t)(*--flinks));
emit_movmroi(as, RID_BASE, ofs+4, (int32_t)(*flinks++));
}
checkmclim(as);
}
lua_assert(map + nent == flinks-1);
lua_assert(map + nent + 1 + snap->depth == flinks);
}
/* Fixup the tail code. */