Skip to content

Commit

Permalink
lj_obj.h: Explicitly define implicit VM states
Browse files Browse the repository at this point in the history
Define enums for implicit VM states that make sense even though they
are never explicitly stored in the g->vmstate field: jit head, jit
loop, jit garbage collection, and ffi.
  • Loading branch information
lukego committed Nov 17, 2017
1 parent 39680ca commit 089c55a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/lj_obj.h
Original file line number Diff line number Diff line change
Expand Up @@ -438,13 +438,22 @@ typedef struct GCtab {

/* VM states. */
enum {
/* VM states. */
LJ_VMST_INTERP, /* Interpreter. */
LJ_VMST_C, /* C function. */
LJ_VMST_GC, /* Garbage collector. */
LJ_VMST_EXIT, /* Trace exit handler. */
LJ_VMST_RECORD, /* Trace recorder. */
LJ_VMST_OPT, /* Optimizer. */
LJ_VMST_ASM, /* Assembler. */
/* JIT trace states.
** These are "abstract" states that logically exist but are never
** directly used for the value of global_State.vmstate.
*/
LJ_VMST_HEAD, /* Trace mcode before loop */
LJ_VMST_LOOP, /* Trace mcode inside loop */
LJ_VMST_JGC, /* GC invoked from JIT mcode. */
LJ_VMST_FFI, /* Other code outside trace mcode */
LJ_VMST__MAX
};

Expand Down

0 comments on commit 089c55a

Please sign in to comment.