diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-04-11 15:41:09 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-04-11 15:41:09 -0300 |
commit | a3d36fe283c09d4e56474da98f22d13162cc9fec (patch) | |
tree | 1f6e2ed56d50dc14aa669fa5f31a63755abd4553 /lvm.c | |
parent | 9569ad6b0ddcde43eb893d2cfe5bcdb715c0ff20 (diff) | |
download | lua-a3d36fe283c09d4e56474da98f22d13162cc9fec.tar.gz lua-a3d36fe283c09d4e56474da98f22d13162cc9fec.tar.bz2 lua-a3d36fe283c09d4e56474da98f22d13162cc9fec.zip |
Upvalues collected like everything else (with mark-sweep) instead
of reference count (simpler and better for generational mode)
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.268 2016/02/05 19:59:14 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.269 2017/04/06 13:08:56 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 | */ |
@@ -642,7 +642,6 @@ static void pushclosure (lua_State *L, Proto *p, UpVal **encup, StkId base, | |||
642 | ncl->upvals[i] = luaF_findupval(L, base + uv[i].idx); | 642 | ncl->upvals[i] = luaF_findupval(L, base + uv[i].idx); |
643 | else /* get upvalue from enclosing function */ | 643 | else /* get upvalue from enclosing function */ |
644 | ncl->upvals[i] = encup[uv[i].idx]; | 644 | ncl->upvals[i] = encup[uv[i].idx]; |
645 | ncl->upvals[i]->refcount++; | ||
646 | /* new closure is white, so we do not need a barrier here */ | 645 | /* new closure is white, so we do not need a barrier here */ |
647 | } | 646 | } |
648 | if (!isblack(p)) /* cache will not break GC invariant? */ | 647 | if (!isblack(p)) /* cache will not break GC invariant? */ |
@@ -855,7 +854,7 @@ void luaV_execute (lua_State *L) { | |||
855 | vmcase(OP_SETUPVAL) { | 854 | vmcase(OP_SETUPVAL) { |
856 | UpVal *uv = cl->upvals[GETARG_B(i)]; | 855 | UpVal *uv = cl->upvals[GETARG_B(i)]; |
857 | setobj(L, uv->v, ra); | 856 | setobj(L, uv->v, ra); |
858 | luaC_upvalbarrier(L, uv, ra); | 857 | luaC_barrier(L, uv, ra); |
859 | vmbreak; | 858 | vmbreak; |
860 | } | 859 | } |
861 | vmcase(OP_SETTABLE) { | 860 | vmcase(OP_SETTABLE) { |