From 0ba599321bd544404d5da1f20508b3eacc9121f3 Mon Sep 17 00:00:00 2001 From: simonmar Date: Mon, 13 Nov 2000 14:41:13 +0000 Subject: [PATCH] [project @ 2000-11-13 14:41:13 by simonmar] common up INTLIKE and CHARLIKE closures during GC. --- ghc/rts/GC.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/ghc/rts/GC.c b/ghc/rts/GC.c index 7d41331..49fb687 100644 --- a/ghc/rts/GC.c +++ b/ghc/rts/GC.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: GC.c,v 1.87 2000/11/13 14:40:37 simonmar Exp $ + * $Id: GC.c,v 1.88 2000/11/13 14:41:13 simonmar Exp $ * * (c) The GHC Team 1998-1999 * @@ -1362,10 +1362,24 @@ loop: recordMutable((StgMutClosure *)to); return to; + case CONSTR_0_1: + { + StgWord w = (StgWord)q->payload[0]; + if (q->header.info == Czh_con_info && + /* unsigned, so always true: (StgChar)w >= MIN_CHARLIKE && */ + (StgChar)w <= MAX_CHARLIKE) { + return (StgClosure *)CHARLIKE_CLOSURE((StgChar)w); + } + if (q->header.info == Izh_con_info && + (StgInt)w >= MIN_INTLIKE && (StgInt)w <= MAX_INTLIKE) { + return (StgClosure *)INTLIKE_CLOSURE((StgInt)w); + } + /* else, fall through ... */ + } + case FUN_1_0: case FUN_0_1: case CONSTR_1_0: - case CONSTR_0_1: return copy(q,sizeofW(StgHeader)+1,step); case THUNK_1_0: /* here because of MIN_UPD_SIZE */ -- 1.7.10.4