From 25a491fe349fc52b69ece2ecbcb0b0189decb36f Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 11 Dec 2024 13:56:03 -0300 Subject: 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'. --- testes/errors.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'testes') 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 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 -- cgit v1.2.3-55-g6feb