mirror of
https://github.com/lua/lua
synced 2026-09-26 16:17:11 +03:00
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'.
This commit is contained in:
parent
b4b616bdf2
commit
25a491fe34
5 changed files with 35 additions and 34 deletions
|
|
@ -321,7 +321,8 @@ t = nil
|
|||
checkmessage(s.."; aaa = bbb + 1", "global 'bbb'")
|
||||
checkmessage("local _ENV=_ENV;"..s.."; aaa = bbb + 1", "global 'bbb'")
|
||||
checkmessage(s.."; local t = {}; aaa = t.bbb + 1", "field 'bbb'")
|
||||
checkmessage(s.."; local t = {}; t:bbb()", "method 'bbb'")
|
||||
-- cannot use 'self' opcode
|
||||
checkmessage(s.."; local t = {}; t:bbb()", "field 'bbb'")
|
||||
|
||||
checkmessage([[aaa=9
|
||||
repeat until 3==3
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue