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

@@ -318,6 +318,9 @@ typedef struct GCproto {
/* Only used during parsing. */
#define PROTO_HAS_RETURN 0x20 /* Already emitted a return. */
#define PROTO_FIXUP_RETURN 0x40 /* Need to fixup emitted returns. */
/* Top bits used for counting created closures. */
#define PROTO_CLCOUNT 0x20 /* Base of saturating 3 bit counter. */
#define PROTO_CLC_BITS 3
#define proto_kgc(pt, idx) \
check_exp((uintptr_t)(intptr_t)(idx) >= (uintptr_t)-(intptr_t)(pt)->sizekgc, \