diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-01-15 14:13:24 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-01-15 14:13:24 -0200 |
commit | a04de4f0adc0b14aa4ad88136ef82f6e277653c7 (patch) | |
tree | f21b1cc0e28b2d0ce4f8df076328269dfac96589 /lcode.c | |
parent | a653d93a4365eb413d31bd058ef0c9822d6a1d4d (diff) | |
download | lua-a04de4f0adc0b14aa4ad88136ef82f6e277653c7.tar.gz lua-a04de4f0adc0b14aa4ad88136ef82f6e277653c7.tar.bz2 lua-a04de4f0adc0b14aa4ad88136ef82f6e277653c7.zip |
no more END opcode
Diffstat (limited to 'lcode.c')
-rw-r--r-- | lcode.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lcode.c,v 1.54 2000/12/26 18:46:09 roberto Exp roberto $ | 2 | ** $Id: lcode.c,v 1.55 2000/12/28 12:55:41 roberto Exp roberto $ |
3 | ** Code generator for Lua | 3 | ** Code generator for Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -32,7 +32,7 @@ static Instruction previous_instruction (FuncState *fs) { | |||
32 | if (fs->pc > fs->lasttarget) /* no jumps to current position? */ | 32 | if (fs->pc > fs->lasttarget) /* no jumps to current position? */ |
33 | return fs->f->code[fs->pc-1]; /* returns previous instruction */ | 33 | return fs->f->code[fs->pc-1]; /* returns previous instruction */ |
34 | else | 34 | else |
35 | return CREATE_0(OP_END); /* no optimizations after an `END' */ | 35 | return CREATE_0(-1); /* no optimizations after an invalid instruction */ |
36 | } | 36 | } |
37 | 37 | ||
38 | 38 | ||
@@ -206,7 +206,7 @@ static OpCode invertjump (OpCode op) { | |||
206 | case OP_JMPF: case OP_JMPONF: return OP_JMPT; | 206 | case OP_JMPF: case OP_JMPONF: return OP_JMPT; |
207 | default: | 207 | default: |
208 | LUA_INTERNALERROR("invalid jump instruction"); | 208 | LUA_INTERNALERROR("invalid jump instruction"); |
209 | return OP_END; /* to avoid warnings */ | 209 | return OP_JMP; /* to avoid warnings */ |
210 | } | 210 | } |
211 | } | 211 | } |
212 | 212 | ||
@@ -236,7 +236,7 @@ void luaK_patchlist (FuncState *fs, int list, int target) { | |||
236 | if (target == fs->lasttarget) /* same target that list `jlt'? */ | 236 | if (target == fs->lasttarget) /* same target that list `jlt'? */ |
237 | luaK_concat(fs, &fs->jlt, list); /* delay fixing */ | 237 | luaK_concat(fs, &fs->jlt, list); /* delay fixing */ |
238 | else | 238 | else |
239 | luaK_patchlistaux(fs, list, target, OP_END, 0); | 239 | luaK_patchlistaux(fs, list, target, OP_ADD, 0); |
240 | } | 240 | } |
241 | 241 | ||
242 | 242 | ||
@@ -653,7 +653,6 @@ int luaK_code2 (FuncState *fs, OpCode o, int arg1, int arg2) { | |||
653 | 653 | ||
654 | 654 | ||
655 | const OpProperties luaK_opproperties[NUM_OPCODES] = { | 655 | const OpProperties luaK_opproperties[NUM_OPCODES] = { |
656 | {iO, 0, 0}, /* OP_END */ | ||
657 | {iU, 0, 0}, /* OP_RETURN */ | 656 | {iU, 0, 0}, /* OP_RETURN */ |
658 | {iAB, 0, 0}, /* OP_CALL */ | 657 | {iAB, 0, 0}, /* OP_CALL */ |
659 | {iAB, 0, 0}, /* OP_TAILCALL */ | 658 | {iAB, 0, 0}, /* OP_TAILCALL */ |