summaryrefslogtreecommitdiff
path: root/src/lj_lex.h
diff options
context:
space:
mode:
authorMike Pall <mike>2010-02-08 05:28:57 +0100
committerMike Pall <mike>2010-02-08 05:28:57 +0100
commit4424027844bdcdb76e90e0994efafeee7ea5cc1f (patch)
treec23e3595ae292e669cb39b8d377e790df57c9591 /src/lj_lex.h
parent48d93d8c84eb72e720d90ed7861f353a2c417470 (diff)
downloadluajit-4424027844bdcdb76e90e0994efafeee7ea5cc1f.tar.gz
luajit-4424027844bdcdb76e90e0994efafeee7ea5cc1f.tar.bz2
luajit-4424027844bdcdb76e90e0994efafeee7ea5cc1f.zip
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.h8
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)
32 32
33typedef int LexToken; 33typedef int LexToken;
34 34
35/* Combined bytecode ins/line. Only used during bytecode generation. */
36typedef struct BCInsLine {
37 BCIns ins; /* Bytecode instruction. */
38 BCLine line; /* Line number for this bytecode. */
39} BCInsLine;
40
35/* Lua lexer state. */ 41/* Lua lexer state. */
36typedef struct LexState { 42typedef struct LexState {
37 struct FuncState *fs; /* Current FuncState. Defined in lj_parse.c. */ 43 struct FuncState *fs; /* Current FuncState. Defined in lj_parse.c. */
@@ -53,6 +59,8 @@ typedef struct LexState {
53 VarInfo *vstack; /* Stack for names and extents of local variables. */ 59 VarInfo *vstack; /* Stack for names and extents of local variables. */
54 MSize sizevstack; /* Size of variable stack. */ 60 MSize sizevstack; /* Size of variable stack. */
55 MSize vtop; /* Top of variable stack. */ 61 MSize vtop; /* Top of variable stack. */
62 BCInsLine *bcstack; /* Stack for bytecode instructions/line numbers. */
63 MSize sizebcstack; /* Size of bytecode stack. */
56 uint32_t level; /* Syntactical nesting level. */ 64 uint32_t level; /* Syntactical nesting level. */
57} LexState; 65} LexState;
58 66