aboutsummaryrefslogtreecommitdiff
path: root/lopcodes.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-12-11 13:56:03 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2024-12-11 13:56:03 -0300
commit25a491fe349fc52b69ece2ecbcb0b0189decb36f (patch)
tree1d7e61274c587e0838e2ea1fa1905bbc4d74c5f8 /lopcodes.h
parentb4b616bdf2beb161b89930cc71a06936e8531b2c (diff)
downloadlua-25a491fe349fc52b69ece2ecbcb0b0189decb36f.tar.gz
lua-25a491fe349fc52b69ece2ecbcb0b0189decb36f.tar.bz2
lua-25a491fe349fc52b69ece2ecbcb0b0189decb36f.zip
OP_SELF restricted to constant short strings
Optimize this opcode for the common case. For long names or method calls after too many constants, operation can be coded as a move followed by 'gettable'.
Diffstat (limited to 'lopcodes.h')
-rw-r--r--lopcodes.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lopcodes.h b/lopcodes.h
index 31f6fac0..7511eb22 100644
--- a/lopcodes.h
+++ b/lopcodes.h
@@ -256,7 +256,7 @@ OP_SETFIELD,/* A B C R[A][K[B]:shortstring] := RK(C) */
256 256
257OP_NEWTABLE,/* A B C k R[A] := {} */ 257OP_NEWTABLE,/* A B C k R[A] := {} */
258 258
259OP_SELF,/* A B C R[A+1] := R[B]; R[A] := R[B][RK(C):string] */ 259OP_SELF,/* A B C R[A+1] := R[B]; R[A] := R[B][K[C]:shortstring] */
260 260
261OP_ADDI,/* A B sC R[A] := R[B] + sC */ 261OP_ADDI,/* A B sC R[A] := R[B] + sC */
262 262