Redesign of prototype generation, part 3: bc and lineinfo.
Use a growable, per-chunk bytecode instruction/line stack. Collect bc/lineinfo for prototype at the end.
This commit is contained in:
@@ -32,6 +32,12 @@ TKDEF(TKENUM1, TKENUM2)
|
||||
|
||||
typedef int LexToken;
|
||||
|
||||
/* Combined bytecode ins/line. Only used during bytecode generation. */
|
||||
typedef struct BCInsLine {
|
||||
BCIns ins; /* Bytecode instruction. */
|
||||
BCLine line; /* Line number for this bytecode. */
|
||||
} BCInsLine;
|
||||
|
||||
/* Lua lexer state. */
|
||||
typedef struct LexState {
|
||||
struct FuncState *fs; /* Current FuncState. Defined in lj_parse.c. */
|
||||
@@ -53,6 +59,8 @@ typedef struct LexState {
|
||||
VarInfo *vstack; /* Stack for names and extents of local variables. */
|
||||
MSize sizevstack; /* Size of variable stack. */
|
||||
MSize vtop; /* Top of variable stack. */
|
||||
BCInsLine *bcstack; /* Stack for bytecode instructions/line numbers. */
|
||||
MSize sizebcstack; /* Size of bytecode stack. */
|
||||
uint32_t level; /* Syntactical nesting level. */
|
||||
} LexState;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user