diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-07-21 13:02:10 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-07-21 13:02:10 -0300 |
commit | 17ee57f8e022be330d4c9de3754d7455f46a851d (patch) | |
tree | c18cbd9403686ec6cb26dc080b01ba38df7a1bcf | |
parent | 3c6d0aaa7d07de2cf24d09195b6678abbfee2268 (diff) | |
download | lua-17ee57f8e022be330d4c9de3754d7455f46a851d.tar.gz lua-17ee57f8e022be330d4c9de3754d7455f46a851d.tar.bz2 lua-17ee57f8e022be330d4c9de3754d7455f46a851d.zip |
'iswhite' and related macros now can work directly on any object
(no need to convert to 'GCObject')
-rw-r--r-- | lparser.c | 8 | ||||
-rw-r--r-- | lstring.c | 6 | ||||
-rw-r--r-- | lvm.c | 4 |
3 files changed, 9 insertions, 9 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lparser.c,v 2.140 2014/07/18 12:17:54 roberto Exp roberto $ | 2 | ** $Id: lparser.c,v 2.141 2014/07/18 13:36:14 roberto Exp roberto $ |
3 | ** Lua Parser | 3 | ** Lua Parser |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -164,7 +164,7 @@ static int registerlocalvar (LexState *ls, TString *varname) { | |||
164 | LocVar, SHRT_MAX, "local variables"); | 164 | LocVar, SHRT_MAX, "local variables"); |
165 | while (oldsize < f->sizelocvars) f->locvars[oldsize++].varname = NULL; | 165 | while (oldsize < f->sizelocvars) f->locvars[oldsize++].varname = NULL; |
166 | f->locvars[fs->nlocvars].varname = varname; | 166 | f->locvars[fs->nlocvars].varname = varname; |
167 | luaC_objbarrier(ls->L, f, obj2gco(varname)); | 167 | luaC_objbarrier(ls->L, f, varname); |
168 | return fs->nlocvars++; | 168 | return fs->nlocvars++; |
169 | } | 169 | } |
170 | 170 | ||
@@ -232,7 +232,7 @@ static int newupvalue (FuncState *fs, TString *name, expdesc *v) { | |||
232 | f->upvalues[fs->nups].instack = (v->k == VLOCAL); | 232 | f->upvalues[fs->nups].instack = (v->k == VLOCAL); |
233 | f->upvalues[fs->nups].idx = cast_byte(v->u.info); | 233 | f->upvalues[fs->nups].idx = cast_byte(v->u.info); |
234 | f->upvalues[fs->nups].name = name; | 234 | f->upvalues[fs->nups].name = name; |
235 | luaC_objbarrier(fs->ls->L, f, obj2gco(name)); | 235 | luaC_objbarrier(fs->ls->L, f, name); |
236 | return fs->nups++; | 236 | return fs->nups++; |
237 | } | 237 | } |
238 | 238 | ||
@@ -1630,7 +1630,7 @@ LClosure *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, | |||
1630 | incr_top(L); | 1630 | incr_top(L); |
1631 | funcstate.f = cl->p = luaF_newproto(L); | 1631 | funcstate.f = cl->p = luaF_newproto(L); |
1632 | funcstate.f->source = luaS_new(L, name); /* create and anchor TString */ | 1632 | funcstate.f->source = luaS_new(L, name); /* create and anchor TString */ |
1633 | luaC_objbarrier(L, funcstate.f, obj2gco(funcstate.f->source)); | 1633 | luaC_objbarrier(L, funcstate.f, funcstate.f->source); |
1634 | lexstate.buff = buff; | 1634 | lexstate.buff = buff; |
1635 | lexstate.dyd = dyd; | 1635 | lexstate.dyd = dyd; |
1636 | dyd->actvar.n = dyd->gt.n = dyd->label.n = 0; | 1636 | dyd->actvar.n = dyd->gt.n = dyd->label.n = 0; |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstring.c,v 2.42 2014/07/18 13:36:14 roberto Exp roberto $ | 2 | ** $Id: lstring.c,v 2.43 2014/07/18 14:46:47 roberto Exp roberto $ |
3 | ** String table (keeps all strings handled by Lua) | 3 | ** String table (keeps all strings handled by Lua) |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -126,8 +126,8 @@ static TString *internshrstr (lua_State *L, const char *str, size_t l) { | |||
126 | if (l == ts->len && | 126 | if (l == ts->len && |
127 | (memcmp(str, getstr(ts), l * sizeof(char)) == 0)) { | 127 | (memcmp(str, getstr(ts), l * sizeof(char)) == 0)) { |
128 | /* found! */ | 128 | /* found! */ |
129 | if (isdead(g, obj2gco(ts))) /* dead (but not collected yet)? */ | 129 | if (isdead(g, ts)) /* dead (but not collected yet)? */ |
130 | changewhite(obj2gco(ts)); /* resurrect it */ | 130 | changewhite(ts); /* resurrect it */ |
131 | return ts; | 131 | return ts; |
132 | } | 132 | } |
133 | } | 133 | } |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.218 2014/07/17 12:30:53 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.219 2014/07/18 13:36:14 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 | */ |
@@ -549,7 +549,7 @@ static void pushclosure (lua_State *L, Proto *p, UpVal **encup, StkId base, | |||
549 | ncl->upvals[i]->refcount++; | 549 | ncl->upvals[i]->refcount++; |
550 | /* new closure is white, so we do not need a barrier here */ | 550 | /* new closure is white, so we do not need a barrier here */ |
551 | } | 551 | } |
552 | if (!isblack(obj2gco(p))) /* cache will not break GC invariant? */ | 552 | if (!isblack(p)) /* cache will not break GC invariant? */ |
553 | p->cache = ncl; /* save it on cache for reuse */ | 553 | p->cache = ncl; /* save it on cache for reuse */ |
554 | } | 554 | } |
555 | 555 | ||