diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-12-11 13:56:03 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2024-12-11 13:56:03 -0300 |
| commit | 25a491fe349fc52b69ece2ecbcb0b0189decb36f (patch) | |
| tree | 1d7e61274c587e0838e2ea1fa1905bbc4d74c5f8 /lopcodes.h | |
| parent | b4b616bdf2beb161b89930cc71a06936e8531b2c (diff) | |
| download | lua-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.h | 2 |
1 files changed, 1 insertions, 1 deletions
| @@ -256,7 +256,7 @@ OP_SETFIELD,/* A B C R[A][K[B]:shortstring] := RK(C) */ | |||
| 256 | 256 | ||
| 257 | OP_NEWTABLE,/* A B C k R[A] := {} */ | 257 | OP_NEWTABLE,/* A B C k R[A] := {} */ |
| 258 | 258 | ||
| 259 | OP_SELF,/* A B C R[A+1] := R[B]; R[A] := R[B][RK(C):string] */ | 259 | OP_SELF,/* A B C R[A+1] := R[B]; R[A] := R[B][K[C]:shortstring] */ |
| 260 | 260 | ||
| 261 | OP_ADDI,/* A B sC R[A] := R[B] + sC */ | 261 | OP_ADDI,/* A B sC R[A] := R[B] + sC */ |
| 262 | 262 | ||
