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 /testes | |
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 'testes')
-rw-r--r-- | testes/errors.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/testes/errors.lua b/testes/errors.lua index 0925fe58..027e1b03 100644 --- a/testes/errors.lua +++ b/testes/errors.lua | |||
@@ -321,7 +321,8 @@ t = nil | |||
321 | checkmessage(s.."; aaa = bbb + 1", "global 'bbb'") | 321 | checkmessage(s.."; aaa = bbb + 1", "global 'bbb'") |
322 | checkmessage("local _ENV=_ENV;"..s.."; aaa = bbb + 1", "global 'bbb'") | 322 | checkmessage("local _ENV=_ENV;"..s.."; aaa = bbb + 1", "global 'bbb'") |
323 | checkmessage(s.."; local t = {}; aaa = t.bbb + 1", "field 'bbb'") | 323 | checkmessage(s.."; local t = {}; aaa = t.bbb + 1", "field 'bbb'") |
324 | checkmessage(s.."; local t = {}; t:bbb()", "method 'bbb'") | 324 | -- cannot use 'self' opcode |
325 | checkmessage(s.."; local t = {}; t:bbb()", "field 'bbb'") | ||
325 | 326 | ||
326 | checkmessage([[aaa=9 | 327 | checkmessage([[aaa=9 |
327 | repeat until 3==3 | 328 | repeat until 3==3 |