diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-04-28 17:57:45 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-04-28 17:57:45 -0300 |
commit | 502a1d1108d4e3b97e012d2ed9a496fd003b08db (patch) | |
tree | 0d1daa63ebe8af89a35ec5ecbc48f7e055eb0374 /lopcodes.h | |
parent | 173e41b2ebed59a716d299470de25e50aee3b921 (diff) | |
download | lua-502a1d1108d4e3b97e012d2ed9a496fd003b08db.tar.gz lua-502a1d1108d4e3b97e012d2ed9a496fd003b08db.tar.bz2 lua-502a1d1108d4e3b97e012d2ed9a496fd003b08db.zip |
new opcodes for table access with constant keys (strings and integers)
Diffstat (limited to 'lopcodes.h')
-rw-r--r-- | lopcodes.h | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lopcodes.h,v 1.151 2017/04/24 20:26:39 roberto Exp roberto $ | 2 | ** $Id: lopcodes.h,v 1.152 2017/04/26 17:46:52 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 | */ |
@@ -178,17 +178,21 @@ OP_LOADKX,/* A R(A) := Kst(extra arg) */ | |||
178 | OP_LOADBOOL,/* A B C R(A) := (Bool)B; if (C) pc++ */ | 178 | OP_LOADBOOL,/* A B C R(A) := (Bool)B; if (C) pc++ */ |
179 | OP_LOADNIL,/* A B R(A), R(A+1), ..., R(A+B) := nil */ | 179 | OP_LOADNIL,/* A B R(A), R(A+1), ..., R(A+B) := nil */ |
180 | OP_GETUPVAL,/* A B R(A) := UpValue[B] */ | 180 | OP_GETUPVAL,/* A B R(A) := UpValue[B] */ |
181 | OP_SETUPVAL,/* A B UpValue[B] := R(A) */ | ||
181 | 182 | ||
182 | OP_GETTABUP,/* A B C R(A) := UpValue[B][RK(C)] */ | 183 | OP_GETTABUP,/* A B C R(A) := UpValue[B][K(C):string] */ |
183 | OP_GETTABLE,/* A B C R(A) := R(B)[RK(C)] */ | 184 | OP_GETTABLE,/* A B C R(A) := R(B)[R(C)] */ |
185 | OP_GETI,/* A B C R(A) := R(B)[C] */ | ||
186 | OP_GETFIELD,/* A B C R(A) := R(B)[Kst(C):string] */ | ||
184 | 187 | ||
185 | OP_SETTABUP,/* A B C UpValue[A][RK(B)] := RK(C) */ | 188 | OP_SETTABUP,/* A B C UpValue[A][K(B):string] := RK(C) */ |
186 | OP_SETUPVAL,/* A B UpValue[B] := R(A) */ | 189 | OP_SETTABLE,/* A B C R(A)[R(B)] := RK(C) */ |
187 | OP_SETTABLE,/* A B C R(A)[RK(B)] := RK(C) */ | 190 | OP_SETI,/* A B C R(A)[B] := RK(C) */ |
191 | OP_SETFIELD,/* A B C R(A)[K(B):string] := RK(C) */ | ||
188 | 192 | ||
189 | OP_NEWTABLE,/* A B C R(A) := {} (size = B,C) */ | 193 | OP_NEWTABLE,/* A B C R(A) := {} (size = B,C) */ |
190 | 194 | ||
191 | OP_SELF,/* A B C R(A+1) := R(B); R(A) := R(B)[RK(C)] */ | 195 | OP_SELF,/* A B C R(A+1) := R(B); R(A) := R(B)[RK(C):string] */ |
192 | 196 | ||
193 | OP_ADDI,/* A B C R(A) := R(B) + C */ | 197 | OP_ADDI,/* A B C R(A) := R(B) + C */ |
194 | OP_ADD,/* A B C R(A) := RK(B) + RK(C) */ | 198 | OP_ADD,/* A B C R(A) := RK(B) + RK(C) */ |
@@ -259,8 +263,6 @@ OP_EXTRAARG/* Ax extra (larger) argument for previous opcode */ | |||
259 | 263 | ||
260 | (*) In OP_LOADKX, the next 'instruction' is always EXTRAARG. | 264 | (*) In OP_LOADKX, the next 'instruction' is always EXTRAARG. |
261 | 265 | ||
262 | (*) In OP_GETTABUP, OP_SETTABUP, and OP_SELF, the index must be a string. | ||
263 | |||
264 | (*) For comparisons, A specifies what condition the test should accept | 266 | (*) For comparisons, A specifies what condition the test should accept |
265 | (true or false). | 267 | (true or false). |
266 | 268 | ||