summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-10-28 12:50:09 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-10-28 12:50:09 -0200
commit257961c601fdec1ea1f9640d460e0d31c39333a1 (patch)
tree233f1f2678a105e5e81dd5eda9626fe784811443
parentae515a346ca6422750b985a68975fb4bd9de7be9 (diff)
downloadlua-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.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lvm.c b/lvm.c
index 98129b24..2dcd6143 100644
--- a/lvm.c
+++ b/lvm.c
@@ -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);