summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-08-03 17:40:26 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-08-03 17:40:26 -0300
commit8f25d08637749316fd30d96ad874f1400088abee (patch)
treeabca1f33e93eb36b70fd94e0d4cda88acc9e40ba
parent3b795541c488c7e633567897c9112312007a20a0 (diff)
downloadlua-8f25d08637749316fd30d96ad874f1400088abee.tar.gz
lua-8f25d08637749316fd30d96ad874f1400088abee.tar.bz2
lua-8f25d08637749316fd30d96ad874f1400088abee.zip
'invalidateTMcache' not needed in all 'settable' uses
-rw-r--r--lapi.c3
-rw-r--r--lvm.c3
-rw-r--r--lvm.h7
3 files changed, 7 insertions, 6 deletions
diff --git a/lapi.c b/lapi.c
index f3c2b2f3..80e89f12 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 2.251 2015/07/20 18:24:50 roberto Exp roberto $ 2** $Id: lapi.c,v 2.252 2015/08/03 19:50:49 roberto Exp roberto $
3** Lua API 3** Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -736,6 +736,7 @@ static void auxsetstr (lua_State *L, const TValue *t, const char *k) {
736 TString *str = luaS_new(L, k); 736 TString *str = luaS_new(L, k);
737 api_checknelems(L, 1); 737 api_checknelems(L, 1);
738 if (luaV_fastset(L, t, str, aux, luaH_getstr, L->top)) { 738 if (luaV_fastset(L, t, str, aux, luaH_getstr, L->top)) {
739 invalidateTMcache(hvalue(t));
739 setobj2t(L, cast(TValue *, aux), L->top - 1); 740 setobj2t(L, cast(TValue *, aux), L->top - 1);
740 L->top--; /* pop value */ 741 L->top--; /* pop value */
741 } 742 }
diff --git a/lvm.c b/lvm.c
index 706acc43..6a6710b3 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.c,v 2.248 2015/07/20 18:24:50 roberto Exp roberto $ 2** $Id: lvm.c,v 2.249 2015/08/03 19:50:49 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*/
@@ -217,6 +217,7 @@ void luaV_finishset (lua_State *L, const TValue *t, TValue *key,
217 } 217 }
218 t = tm; /* else repeat assignment over 'tm' */ 218 t = tm; /* else repeat assignment over 'tm' */
219 if (luaV_fastset(L, t, key, oldval, luaH_get, val)) { 219 if (luaV_fastset(L, t, key, oldval, luaH_get, val)) {
220 invalidateTMcache(hvalue(t));
220 setobj2t(L, cast(TValue *, oldval), val); 221 setobj2t(L, cast(TValue *, oldval), val);
221 return; 222 return;
222 } 223 }
diff --git a/lvm.h b/lvm.h
index 50927c70..ccdacd4a 100644
--- a/lvm.h
+++ b/lvm.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.h,v 2.36 2015/07/20 18:24:50 roberto Exp roberto $ 2** $Id: lvm.h,v 2.37 2015/08/03 19:50:49 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*/
@@ -75,12 +75,11 @@
75 ? (aux = NULL, 0) \ 75 ? (aux = NULL, 0) \
76 : (aux = f(hvalue(t), k), \ 76 : (aux = f(hvalue(t), k), \
77 ttisnil(aux) ? 0 \ 77 ttisnil(aux) ? 0 \
78 : (invalidateTMcache(hvalue(t)), \ 78 : (luaC_barrierback(L, hvalue(t), v), 1)))
79 luaC_barrierback(L, hvalue(t), v), 1)))
80 79
81#define luaV_settable(L,t,k,v) { const TValue *aux; \ 80#define luaV_settable(L,t,k,v) { const TValue *aux; \
82 if (luaV_fastset(L,t,k,aux,luaH_get,v)) \ 81 if (luaV_fastset(L,t,k,aux,luaH_get,v)) \
83 { setobj2t(L, cast(TValue *,aux), v); } \ 82 { invalidateTMcache(hvalue(t)); setobj2t(L, cast(TValue *,aux), v); } \
84 else luaV_finishset(L,t,k,v,aux); } 83 else luaV_finishset(L,t,k,v,aux); }
85 84
86 85