aboutsummaryrefslogtreecommitdiff
path: root/lvm.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-08-03 16:50:49 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-08-03 16:50:49 -0300
commit3b795541c488c7e633567897c9112312007a20a0 (patch)
treebaa671c28bef6a13def34e5872fb81594a168861 /lvm.h
parent20b9e594419787cceaa04c645e485b13a2a9f4dc (diff)
downloadlua-3b795541c488c7e633567897c9112312007a20a0.tar.gz
lua-3b795541c488c7e633567897c9112312007a20a0.tar.bz2
lua-3b795541c488c7e633567897c9112312007a20a0.zip
fast track for 'settable'
Diffstat (limited to 'lvm.h')
-rw-r--r--lvm.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/lvm.h b/lvm.h
index 9f7d028f..50927c70 100644
--- a/lvm.h
+++ b/lvm.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lvm.h,v 2.35 2015/02/20 14:27:53 roberto Exp roberto $ 2** $Id: lvm.h,v 2.36 2015/07/20 18:24:50 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*/
@@ -70,6 +70,21 @@
70 else luaV_finishget(L,t,k,v,aux); } 70 else luaV_finishget(L,t,k,v,aux); }
71 71
72 72
73#define luaV_fastset(L,t,k,aux,f,v) \
74 (!ttistable(t) \
75 ? (aux = NULL, 0) \
76 : (aux = f(hvalue(t), k), \
77 ttisnil(aux) ? 0 \
78 : (invalidateTMcache(hvalue(t)), \
79 luaC_barrierback(L, hvalue(t), v), 1)))
80
81#define luaV_settable(L,t,k,v) { const TValue *aux; \
82 if (luaV_fastset(L,t,k,aux,luaH_get,v)) \
83 { setobj2t(L, cast(TValue *,aux), v); } \
84 else luaV_finishset(L,t,k,v,aux); }
85
86
87
73LUAI_FUNC int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2); 88LUAI_FUNC int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2);
74LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); 89LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r);
75LUAI_FUNC int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r); 90LUAI_FUNC int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r);
@@ -77,8 +92,8 @@ LUAI_FUNC int luaV_tonumber_ (const TValue *obj, lua_Number *n);
77LUAI_FUNC int luaV_tointeger (const TValue *obj, lua_Integer *p, int mode); 92LUAI_FUNC int luaV_tointeger (const TValue *obj, lua_Integer *p, int mode);
78LUAI_FUNC void luaV_finishget (lua_State *L, const TValue *t, TValue *key, 93LUAI_FUNC void luaV_finishget (lua_State *L, const TValue *t, TValue *key,
79 StkId val, const TValue *tm); 94 StkId val, const TValue *tm);
80LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key, 95LUAI_FUNC void luaV_finishset (lua_State *L, const TValue *t, TValue *key,
81 StkId val); 96 StkId val, const TValue *oldval);
82LUAI_FUNC void luaV_finishOp (lua_State *L); 97LUAI_FUNC void luaV_finishOp (lua_State *L);
83LUAI_FUNC void luaV_execute (lua_State *L); 98LUAI_FUNC void luaV_execute (lua_State *L);
84LUAI_FUNC void luaV_concat (lua_State *L, int total); 99LUAI_FUNC void luaV_concat (lua_State *L, int total);