Specialize to prototype for non-monomorphic functions.

Solves the trace-explosion problem with closure-heavy programming.
This commit is contained in:
Mike Pall
2011-11-20 19:14:39 +01:00
parent cc7a12be93
commit cecbe3c15f
6 changed files with 31 additions and 15 deletions

View File

@@ -1392,7 +1392,7 @@ static GCproto *fs_finish(LexState *ls, BCLine line)
pt->gct = ~LJ_TPROTO;
pt->sizept = (MSize)sizept;
pt->trace = 0;
pt->flags = fs->flags;
pt->flags = (uint8_t)(fs->flags & ~(PROTO_HAS_RETURN|PROTO_FIXUP_RETURN));
pt->numparams = fs->numparams;
pt->framesize = fs->framesize;
setgcref(pt->chunkname, obj2gco(ls->chunkname));