diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-09-28 13:32:50 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-09-28 13:32:50 -0300 |
commit | 5938212748636d21d6f4b372481ab3b6dd6c7538 (patch) | |
tree | fa5d0a28dac1ff6c087585bc684534eb1ae82298 /lgc.c | |
parent | 1829911d7c1c16cf01dfdbfc8e7a26cfa10ec797 (diff) | |
download | lua-5938212748636d21d6f4b372481ab3b6dd6c7538.tar.gz lua-5938212748636d21d6f4b372481ab3b6dd6c7538.tar.bz2 lua-5938212748636d21d6f4b372481ab3b6dd6c7538.zip |
information about upvalues (where they come from) kept in Proto structure,
instead of sequence of pseudo-opcodes after OP_CLOSURE
Diffstat (limited to 'lgc.c')
-rw-r--r-- | lgc.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lgc.c,v 2.55 2009/07/16 16:26:09 roberto Exp roberto $ | 2 | ** $Id: lgc.c,v 2.56 2009/09/28 13:50:34 roberto Exp roberto $ |
3 | ** Garbage Collector | 3 | ** Garbage Collector |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -349,8 +349,8 @@ static void traverseproto (global_State *g, Proto *f) { | |||
349 | for (i=0; i<f->sizek; i++) /* mark literals */ | 349 | for (i=0; i<f->sizek; i++) /* mark literals */ |
350 | markvalue(g, &f->k[i]); | 350 | markvalue(g, &f->k[i]); |
351 | for (i=0; i<f->sizeupvalues; i++) { /* mark upvalue names */ | 351 | for (i=0; i<f->sizeupvalues; i++) { /* mark upvalue names */ |
352 | if (f->upvalues[i]) | 352 | if (f->upvalues[i].name) |
353 | stringmark(f->upvalues[i]); | 353 | stringmark(f->upvalues[i].name); |
354 | } | 354 | } |
355 | for (i=0; i<f->sizep; i++) /* mark nested protos */ | 355 | for (i=0; i<f->sizep; i++) /* mark nested protos */ |
356 | markobject(g, f->p[i]); | 356 | markobject(g, f->p[i]); |
@@ -371,7 +371,7 @@ static void traverseclosure (global_State *g, Closure *cl) { | |||
371 | } | 371 | } |
372 | else { | 372 | else { |
373 | int i; | 373 | int i; |
374 | lua_assert(cl->l.nupvalues == cl->l.p->nups); | 374 | lua_assert(cl->l.nupvalues == cl->l.p->sizeupvalues); |
375 | markobject(g, cl->l.p); | 375 | markobject(g, cl->l.p); |
376 | for (i=0; i<cl->l.nupvalues; i++) /* mark its upvalues */ | 376 | for (i=0; i<cl->l.nupvalues; i++) /* mark its upvalues */ |
377 | markobject(g, cl->l.upvals[i]); | 377 | markobject(g, cl->l.upvals[i]); |