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

@@ -104,9 +104,15 @@ typedef enum {
LJ_TRACE_START, /* New trace started. */
LJ_TRACE_END, /* End of trace. */
LJ_TRACE_ASM, /* Assemble trace. */
LJ_TRACE_ERR, /* Trace aborted with error. */
LJ_TRACE_ERR /* Trace aborted with error. */
} TraceState;
/* Post-processing action. */
typedef enum {
LJ_POST_NONE, /* No action. */
LJ_POST_FIXGUARD /* Fixup and emit pending guard. */
} PostProc;
/* Machine code type. */
typedef uint8_t MCode;
@@ -284,6 +290,8 @@ typedef struct jit_State {
SnapEntry *snapmapbuf; /* Temp. snapshot map buffer. */
MSize sizesnapmap; /* Size of temp. snapshot map buffer. */
PostProc postproc; /* Required post-processing after execution. */
GCRef *trace; /* Array of traces. */
TraceNo freetrace; /* Start of scan for next free trace. */
MSize sizetrace; /* Size of trace array. */