diff options
author | Mike Pall <mike> | 2010-02-08 05:28:57 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2010-02-08 05:28:57 +0100 |
commit | 4424027844bdcdb76e90e0994efafeee7ea5cc1f (patch) | |
tree | c23e3595ae292e669cb39b8d377e790df57c9591 /src/lj_lex.h | |
parent | 48d93d8c84eb72e720d90ed7861f353a2c417470 (diff) | |
download | luajit2-4424027844bdcdb76e90e0994efafeee7ea5cc1f.tar.gz |
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.
Diffstat (limited to 'src/lj_lex.h')
-rw-r--r-- | src/lj_lex.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lj_lex.h b/src/lj_lex.h index ee183b40..9bcd3cdb 100644 --- a/src/lj_lex.h +++ b/src/lj_lex.h @@ -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; |