Redesign of prototype generation, part 1: varinfo and uvname.

Use a growable, per-chunk variable stack.
Collect varinfo/uvname for prototype at the end.
This commit is contained in:
Mike Pall
2010-02-08 05:26:52 +01:00
parent 1307f49137
commit 60b5af4422
6 changed files with 109 additions and 96 deletions

View File

@@ -256,11 +256,9 @@ static void gc_traverse_proto(global_State *g, GCproto *pt)
for (i = -(ptrdiff_t)pt->sizekgc; i < 0; i++) /* Mark collectable consts. */
gc_markobj(g, proto_kgc(pt, i));
for (i = 0; i < (ptrdiff_t)pt->sizeuvname; i++) /* Mark upvalue names. */
if (proto_uvname(pt, i))
gc_mark_str(gco2str(proto_uvname(pt, i)));
gc_mark_str(gco2str(proto_uvname(pt, i)));
for (i = 0; i < (ptrdiff_t)pt->sizevarinfo; i++) /* Mark names of locals. */
if (gcref(proto_varinfo(pt)[i].name))
gc_mark_str(gco2str(gcref(proto_varinfo(pt)[i].name)));
gc_mark_str(gco2str(gcref(proto_varinfo(pt)[i].name)));
}
/* Traverse the frame structure of a stack. */