diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-10-28 12:50:09 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-10-28 12:50:09 -0200 |
commit | 257961c601fdec1ea1f9640d460e0d31c39333a1 (patch) | |
tree | 233f1f2678a105e5e81dd5eda9626fe784811443 | |
parent | ae515a346ca6422750b985a68975fb4bd9de7be9 (diff) | |
download | lua-github-257961c601fdec1ea1f9640d460e0d31c39333a1.tar.gz |
OP_SELF can use 'luaV_fastget' specialized for strings, as it
is applied only to string keys
-rw-r--r-- | lvm.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -1,5 +1,5 @@ /* -** $Id: lvm.c,v 2.255 2015/10/20 17:56:21 roberto Exp roberto $ +** $Id: lvm.c,v 2.256 2015/10/22 14:40:47 roberto Exp roberto $ ** Lua virtual machine ** See Copyright Notice in lua.h */ @@ -855,10 +855,15 @@ void luaV_execute (lua_State *L) { vmbreak; } vmcase(OP_SELF) { + const TValue *aux; StkId rb = RB(i); TValue *rc = RKC(i); + TString *key = tsvalue(rc); /* key must be a string */ setobjs2s(L, ra + 1, rb); - gettableProtected(L, rb, rc, ra); + if (luaV_fastget(L, rb, key, aux, luaH_getstr)) { + setobj2s(L, ra, aux); + } + else Protect(luaV_finishget(L, rb, rc, ra, aux)); vmbreak; } vmcase(OP_ADD) { @@ -1060,7 +1065,7 @@ void luaV_execute (lua_State *L) { TValue *rb = RKB(i); TValue *rc = RKC(i); Protect( - if (cast_int(luaV_equalobj(L, rb, rc)) != GETARG_A(i)) + if (luaV_equalobj(L, rb, rc) != GETARG_A(i)) ci->u.l.savedpc++; else donextjump(ci); |