Add trace recorder infrastructure for instruction post-processing.

This commit is contained in:
Mike Pall
2011-01-17 01:20:10 +01:00
parent b2ff889c6e
commit 66ba1e68aa
3 changed files with 32 additions and 1 deletions

View File

@@ -388,6 +388,7 @@ static void trace_start(jit_State *J)
J->needsnap = 0;
J->bcskip = 0;
J->guardemit.irt = 0;
J->postproc = LJ_POST_NONE;
setgcref(J->cur.startpt, obj2gco(J->pt));
L = J->L;
@@ -454,6 +455,7 @@ static void trace_stop(jit_State *J)
/* Commit new mcode only after all patching is done. */
lj_mcode_commit(J, J->cur.mcode);
J->postproc = LJ_POST_NONE;
trace_save(J);
L = J->L;
@@ -485,6 +487,7 @@ static int trace_abort(jit_State *J)
TraceError e = LJ_TRERR_RECERR;
TraceNo traceno;
J->postproc = LJ_POST_NONE;
lj_mcode_abort(J);
if (tvisnum(L->top-1))
e = (TraceError)lj_num2int(numV(L->top-1));