diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-10-04 16:01:53 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2004-10-04 16:01:53 -0300 |
| commit | 5ee87acd6b920a6a122277cd817aea4cfd618671 (patch) | |
| tree | 5e931c1db32c2be6378fde498ffcc5ee9dec0d6a /lopcodes.h | |
| parent | 5d834bdf571ef3ee343b21fde2d49de1e4ea08b4 (diff) | |
| download | lua-5ee87acd6b920a6a122277cd817aea4cfd618671.tar.gz lua-5ee87acd6b920a6a122277cd817aea4cfd618671.tar.bz2 lua-5ee87acd6b920a6a122277cd817aea4cfd618671.zip | |
small optimization for boolean constants + new format for SETLIST opcode
Diffstat (limited to 'lopcodes.h')
| -rw-r--r-- | lopcodes.h | 13 |
1 files changed, 8 insertions, 5 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lopcodes.h,v 1.110 2004/06/29 18:49:02 roberto Exp roberto $ | 2 | ** $Id: lopcodes.h,v 1.111 2004/08/04 20:18:13 roberto Exp $ |
| 3 | ** Opcodes for Lua virtual machine | 3 | ** Opcodes for Lua virtual machine |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -198,8 +198,7 @@ OP_TFORLOOP,/* A C R(A+2), ... ,R(A+2+C) := R(A)(R(A+1), R(A+2)); | |||
| 198 | OP_TFORPREP,/* A sBx if type(R(A)) == table then R(A+1):=R(A), R(A):=next; | 198 | OP_TFORPREP,/* A sBx if type(R(A)) == table then R(A+1):=R(A), R(A):=next; |
| 199 | pc+=sBx */ | 199 | pc+=sBx */ |
| 200 | 200 | ||
| 201 | OP_SETLIST,/* A Bx R(A)[Bx-Bx%FPF+i] := R(A+i), 1 <= i <= Bx%FPF+1 */ | 201 | OP_SETLIST,/* A B C R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B */ |
| 202 | OP_SETLISTO,/* A Bx */ | ||
| 203 | 202 | ||
| 204 | OP_CLOSE,/* A close all variables in the stack up to (>=) R(A)*/ | 203 | OP_CLOSE,/* A close all variables in the stack up to (>=) R(A)*/ |
| 205 | OP_CLOSURE,/* A Bx R(A) := closure(KPROTO[Bx], R(A), ... ,R(A+n)) */ | 204 | OP_CLOSURE,/* A Bx R(A) := closure(KPROTO[Bx], R(A), ... ,R(A+n)) */ |
| @@ -219,11 +218,15 @@ OP_VARARG/* A B R(A), R(A+1), ..., R(A+B-1) = vararg */ | |||
| 219 | next open instruction (OP_CALL, OP_RETURN, OP_SETLIST) may use `top'. | 218 | next open instruction (OP_CALL, OP_RETURN, OP_SETLIST) may use `top'. |
| 220 | 219 | ||
| 221 | (*) In OP_VARARG, if (B == 0) then use actual number of varargs and | 220 | (*) In OP_VARARG, if (B == 0) then use actual number of varargs and |
| 222 | set top (like in OP_CALL). | 221 | set top (like in OP_CALL with C == 0). |
| 223 | 222 | ||
| 224 | (*) In OP_RETURN, if (B == 0) then return up to `top' | 223 | (*) In OP_RETURN, if (B == 0) then return up to `top' |
| 225 | 224 | ||
| 226 | (*) For comparisons, B specifies what conditions the test should accept. | 225 | (*) In OP_SETLIST, if (B == 0) then B = `top'; |
| 226 | if (C == 0) then next `instruction' is real C | ||
| 227 | |||
| 228 | (*) For comparisons, A specifies what condition the test should accept | ||
| 229 | (true or false). | ||
| 227 | 230 | ||
| 228 | (*) All `skips' (pc++) assume that next instruction is a jump | 231 | (*) All `skips' (pc++) assume that next instruction is a jump |
| 229 | ===========================================================================*/ | 232 | ===========================================================================*/ |
