diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-02-01 16:03:10 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2011-02-01 16:03:10 -0200 |
| commit | dd547c55c85ba48f481836ba76ecdfe69960bcd0 (patch) | |
| tree | d75d864ae35fc5bafacf3c206eaa20885b03a3d1 /lopcodes.h | |
| parent | f6bd8b1147d58c35e73225b4adc5499c11d2bf0f (diff) | |
| download | lua-dd547c55c85ba48f481836ba76ecdfe69960bcd0.tar.gz lua-dd547c55c85ba48f481836ba76ecdfe69960bcd0.tar.bz2 lua-dd547c55c85ba48f481836ba76ecdfe69960bcd0.zip | |
new scheme to close upvalues in 'break'; jump instructions may
do the close, avoiding the need for a OP_CLOSE instruction
Diffstat (limited to 'lopcodes.h')
| -rw-r--r-- | lopcodes.h | 7 |
1 files changed, 3 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lopcodes.h,v 1.136 2010/10/13 16:45:54 roberto Exp roberto $ | 2 | ** $Id: lopcodes.h,v 1.137 2010/10/25 12:24:55 roberto Exp roberto $ |
| 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 | */ |
| @@ -195,8 +195,7 @@ OP_LEN,/* A B R(A) := length of R(B) */ | |||
| 195 | 195 | ||
| 196 | OP_CONCAT,/* A B C R(A) := R(B).. ... ..R(C) */ | 196 | OP_CONCAT,/* A B C R(A) := R(B).. ... ..R(C) */ |
| 197 | 197 | ||
| 198 | OP_JMP,/* sBx pc+=sBx */ | 198 | OP_JMP,/* A sBx pc+=sBx; if (A) close all upvalues >= R(A) + 1 */ |
| 199 | |||
| 200 | OP_EQ,/* A B C if ((RK(B) == RK(C)) ~= A) then pc++ */ | 199 | OP_EQ,/* A B C if ((RK(B) == RK(C)) ~= A) then pc++ */ |
| 201 | OP_LT,/* A B C if ((RK(B) < RK(C)) ~= A) then pc++ */ | 200 | OP_LT,/* A B C if ((RK(B) < RK(C)) ~= A) then pc++ */ |
| 202 | OP_LE,/* A B C if ((RK(B) <= RK(C)) ~= A) then pc++ */ | 201 | OP_LE,/* A B C if ((RK(B) <= RK(C)) ~= A) then pc++ */ |
| @@ -217,7 +216,7 @@ OP_TFORLOOP,/* A sBx if R(A+1) ~= nil then { R(A)=R(A+1); pc += sBx }*/ | |||
| 217 | 216 | ||
| 218 | OP_SETLIST,/* A B C R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B */ | 217 | OP_SETLIST,/* A B C R(A)[(C-1)*FPF+i] := R(A+i), 1 <= i <= B */ |
| 219 | 218 | ||
| 220 | OP_CLOSE,/* A close all variables in the stack up to (>=) R(A)*/ | 219 | OP_CLOSE,/* A close all upvalues >= R(A) */ |
| 221 | OP_CLOSURE,/* A Bx R(A) := closure(KPROTO[Bx]) */ | 220 | OP_CLOSURE,/* A Bx R(A) := closure(KPROTO[Bx]) */ |
| 222 | 221 | ||
| 223 | OP_VARARG,/* A B R(A), R(A+1), ..., R(A+B-2) = vararg */ | 222 | OP_VARARG,/* A B R(A), R(A+1), ..., R(A+B-2) = vararg */ |
