aboutsummaryrefslogtreecommitdiff
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-257961c601fdec1ea1f9640d460e0d31c39333a1.tar.gz
lua-257961c601fdec1ea1f9640d460e0d31c39333a1.tar.bz2
lua-257961c601fdec1ea1f9640d460e0d31c39333a1.zip
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 @@
1/* 1/*
2** $Id: lvm.c,v 2.255 2015/10/20 17:56:21 roberto Exp roberto $ 2** $Id: lvm.c,v 2.256 2015/10/22 14:40:47 roberto Exp roberto $
3** Lua virtual machine 3** Lua virtual machine
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -855,10 +855,15 @@ void luaV_execute (lua_State *L) {
855 vmbreak; 855 vmbreak;
856 } 856 }
857 vmcase(OP_SELF) { 857 vmcase(OP_SELF) {
858 const TValue *aux;
858 StkId rb = RB(i); 859 StkId rb = RB(i);
859 TValue *rc = RKC(i); 860 TValue *rc = RKC(i);
861 TString *key = tsvalue(rc); /* key must be a string */
860 setobjs2s(L, ra + 1, rb); 862 setobjs2s(L, ra + 1, rb);
861 gettableProtected(L, rb, rc, ra); 863 if (luaV_fastget(L, rb, key, aux, luaH_getstr)) {
864 setobj2s(L, ra, aux);
865 }
866 else Protect(luaV_finishget(L, rb, rc, ra, aux));
862 vmbreak; 867 vmbreak;
863 } 868 }
864 vmcase(OP_ADD) { 869 vmcase(OP_ADD) {
@@ -1060,7 +1065,7 @@ void luaV_execute (lua_State *L) {
1060 TValue *rb = RKB(i); 1065 TValue *rb = RKB(i);
1061 TValue *rc = RKC(i); 1066 TValue *rc = RKC(i);
1062 Protect( 1067 Protect(
1063 if (cast_int(luaV_equalobj(L, rb, rc)) != GETARG_A(i)) 1068 if (luaV_equalobj(L, rb, rc) != GETARG_A(i))
1064 ci->u.l.savedpc++; 1069 ci->u.l.savedpc++;
1065 else 1070 else
1066 donextjump(ci); 1071 donextjump(ci);