diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-06-28 16:58:57 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-06-28 16:58:57 -0300 |
commit | 2a4afb97c8a3f64dccad86fa848855616ea2c254 (patch) | |
tree | e343fd15c387e6975b7a680130ee09735666ea2d /ltests.c | |
parent | 87a5fae45322dde56306de92d8eb8050506fb9ba (diff) | |
download | lua-2a4afb97c8a3f64dccad86fa848855616ea2c254.tar.gz lua-2a4afb97c8a3f64dccad86fa848855616ea2c254.tar.bz2 lua-2a4afb97c8a3f64dccad86fa848855616ea2c254.zip |
new module lopcodes.c for tables describing opcodes
Diffstat (limited to 'ltests.c')
-rw-r--r-- | ltests.c | 47 |
1 files changed, 2 insertions, 45 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ltests.c,v 1.84 2001/06/26 13:20:45 roberto Exp roberto $ | 2 | ** $Id: ltests.c,v 1.85 2001/06/28 15:06:20 roberto Exp roberto $ |
3 | ** Internal Module for Debugging of the Lua Implementation | 3 | ** Internal Module for Debugging of the Lua Implementation |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -139,53 +139,10 @@ void *debug_realloc (void *block, size_t oldsize, size_t size) { | |||
139 | */ | 139 | */ |
140 | 140 | ||
141 | 141 | ||
142 | static const l_char *const instrname[NUM_OPCODES] = { | ||
143 | l_s("OP_MOVE"), | ||
144 | l_s("OP_LOADK"), | ||
145 | l_s("OP_LOADINT"), | ||
146 | l_s("OP_LOADNIL"), | ||
147 | l_s("OP_LOADUPVAL"), | ||
148 | l_s("OP_GETGLOBAL"), | ||
149 | l_s("OP_GETTABLE"), | ||
150 | l_s("OP_SETGLOBAL"), | ||
151 | l_s("OP_SETTABLE"), | ||
152 | l_s("OP_NEWTABLE"), | ||
153 | l_s("OP_SELF"), | ||
154 | l_s("OP_ADD"), | ||
155 | l_s("OP_SUB"), | ||
156 | l_s("OP_MUL"), | ||
157 | l_s("OP_DIV"), | ||
158 | l_s("OP_POW"), | ||
159 | l_s("OP_UNM"), | ||
160 | l_s("OP_NOT"), | ||
161 | l_s("OP_CONCAT"), | ||
162 | l_s("OP_JMP"), | ||
163 | l_s("OP_CJMP"), | ||
164 | l_s("OP_TESTEQ"), | ||
165 | l_s("OP_TESTNE"), | ||
166 | l_s("OP_TESTLT"), | ||
167 | l_s("OP_TESTLE"), | ||
168 | l_s("OP_TESTGT"), | ||
169 | l_s("OP_TESTGE"), | ||
170 | l_s("OP_TESTT"), | ||
171 | l_s("OP_TESTF"), | ||
172 | l_s("OP_NILJMP"), | ||
173 | l_s("OP_CALL"), | ||
174 | l_s("OP_RETURN"), | ||
175 | l_s("OP_FORPREP"), | ||
176 | l_s("OP_FORLOOP"), | ||
177 | l_s("OP_LFORPREP"), | ||
178 | l_s("OP_LFORLOOP"), | ||
179 | l_s("OP_SETLIST"), | ||
180 | l_s("OP_SETLIST0"), | ||
181 | l_s("OP_CLOSURE") | ||
182 | }; | ||
183 | |||
184 | |||
185 | static l_char *buildop (Proto *p, int pc, l_char *buff) { | 142 | static l_char *buildop (Proto *p, int pc, l_char *buff) { |
186 | Instruction i = p->code[pc]; | 143 | Instruction i = p->code[pc]; |
187 | OpCode o = GET_OPCODE(i); | 144 | OpCode o = GET_OPCODE(i); |
188 | const l_char *name = instrname[o]; | 145 | const l_char *name = luaP_opnames[o]; |
189 | sprintf(buff, l_s("%4d - "), pc); | 146 | sprintf(buff, l_s("%4d - "), pc); |
190 | switch (getOpMode(o)) { | 147 | switch (getOpMode(o)) { |
191 | case iABC: | 148 | case iABC: |