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:
6
lvm.c
6
lvm.c
@@ -1382,10 +1382,10 @@ void luaV_execute (lua_State *L, CallInfo *ci) {
|
||||
StkId ra = RA(i);
|
||||
lu_byte tag;
|
||||
TValue *rb = vRB(i);
|
||||
TValue *rc = RKC(i);
|
||||
TString *key = tsvalue(rc); /* key must be a string */
|
||||
TValue *rc = KC(i);
|
||||
TString *key = tsvalue(rc); /* key must be a short string */
|
||||
setobj2s(L, ra + 1, rb);
|
||||
luaV_fastget(rb, key, s2v(ra), luaH_getstr, tag);
|
||||
luaV_fastget(rb, key, s2v(ra), luaH_getshortstr, tag);
|
||||
if (tagisempty(tag))
|
||||
Protect(luaV_finishget(L, rb, rc, ra, tag));
|
||||
vmbreak;
|
||||
|
||||
Reference in New Issue
Block a user