aboutsummaryrefslogtreecommitdiff
path: root/lopcodes.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-04-28 17:57:45 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2017-04-28 17:57:45 -0300
commit502a1d1108d4e3b97e012d2ed9a496fd003b08db (patch)
tree0d1daa63ebe8af89a35ec5ecbc48f7e055eb0374 /lopcodes.h
parent173e41b2ebed59a716d299470de25e50aee3b921 (diff)
downloadlua-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.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/lopcodes.h b/lopcodes.h
index c359581d..6c9df6f3 100644
--- a/lopcodes.h
+++ b/lopcodes.h
@@ -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) */
178OP_LOADBOOL,/* A B C R(A) := (Bool)B; if (C) pc++ */ 178OP_LOADBOOL,/* A B C R(A) := (Bool)B; if (C) pc++ */
179OP_LOADNIL,/* A B R(A), R(A+1), ..., R(A+B) := nil */ 179OP_LOADNIL,/* A B R(A), R(A+1), ..., R(A+B) := nil */
180OP_GETUPVAL,/* A B R(A) := UpValue[B] */ 180OP_GETUPVAL,/* A B R(A) := UpValue[B] */
181OP_SETUPVAL,/* A B UpValue[B] := R(A) */
181 182
182OP_GETTABUP,/* A B C R(A) := UpValue[B][RK(C)] */ 183OP_GETTABUP,/* A B C R(A) := UpValue[B][K(C):string] */
183OP_GETTABLE,/* A B C R(A) := R(B)[RK(C)] */ 184OP_GETTABLE,/* A B C R(A) := R(B)[R(C)] */
185OP_GETI,/* A B C R(A) := R(B)[C] */
186OP_GETFIELD,/* A B C R(A) := R(B)[Kst(C):string] */
184 187
185OP_SETTABUP,/* A B C UpValue[A][RK(B)] := RK(C) */ 188OP_SETTABUP,/* A B C UpValue[A][K(B):string] := RK(C) */
186OP_SETUPVAL,/* A B UpValue[B] := R(A) */ 189OP_SETTABLE,/* A B C R(A)[R(B)] := RK(C) */
187OP_SETTABLE,/* A B C R(A)[RK(B)] := RK(C) */ 190OP_SETI,/* A B C R(A)[B] := RK(C) */
191OP_SETFIELD,/* A B C R(A)[K(B):string] := RK(C) */
188 192
189OP_NEWTABLE,/* A B C R(A) := {} (size = B,C) */ 193OP_NEWTABLE,/* A B C R(A) := {} (size = B,C) */
190 194
191OP_SELF,/* A B C R(A+1) := R(B); R(A) := R(B)[RK(C)] */ 195OP_SELF,/* A B C R(A+1) := R(B); R(A) := R(B)[RK(C):string] */
192 196
193OP_ADDI,/* A B C R(A) := R(B) + C */ 197OP_ADDI,/* A B C R(A) := R(B) + C */
194OP_ADD,/* A B C R(A) := RK(B) + RK(C) */ 198OP_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