/* ----------------------------------------------------------------------------
- * $Id: ClosureMacros.h,v 1.14 1999/05/04 08:50:43 sof Exp $
+ * $Id: ClosureMacros.h,v 1.15 1999/05/11 16:47:39 keithw Exp $
*
* (c) The GHC Team, 1998-1999
*
#define SET_STATIC_PAR_HDR(stuff)
#endif
-#ifdef TICKY
-#define SET_TICKY_HDR(c,stuff) (c)->header.ticky.updated = stuff
-#define SET_STATIC_TICKY_HDR(stuff) ticky : { updated : stuff }
+#ifdef TICKY_TICKY
+#define SET_TICKY_HDR(c,stuff) /* old: (c)->header.ticky.updated = stuff */
+#define SET_STATIC_TICKY_HDR(stuff) /* old: ticky : { updated : stuff } */
#else
#define SET_TICKY_HDR(c,stuff)
#define SET_STATIC_TICKY_HDR(stuff)
/* ----------------------------------------------------------------------------
- * $Id: ClosureTypes.h,v 1.10 1999/03/15 16:30:24 simonm Exp $
+ * $Id: ClosureTypes.h,v 1.11 1999/05/11 16:47:40 keithw Exp $
*
* (c) The GHC Team, 1998-1999
*
#define SEQ_FRAME 46
#define BLACKHOLE 47
#define BLACKHOLE_BQ 48
-#define MVAR 49
-#define ARR_WORDS 50
-#define MUT_ARR_PTRS 51
-#define MUT_ARR_PTRS_FROZEN 52
-#define MUT_VAR 53
-#define WEAK 54
-#define FOREIGN 55
-#define STABLE_NAME 56
-#define TSO 57
-#define BLOCKED_FETCH 58
-#define FETCH_ME 59
-#define EVACUATED 60
-#define N_CLOSURE_TYPES 61
+#define SE_BLACKHOLE 49
+#define SE_CAF_BLACKHOLE 50
+#define MVAR 51
+#define ARR_WORDS 52
+#define MUT_ARR_PTRS 53
+#define MUT_ARR_PTRS_FROZEN 54
+#define MUT_VAR 55
+#define WEAK 56
+#define FOREIGN 57
+#define STABLE_NAME 58
+#define TSO 59
+#define BLOCKED_FETCH 60
+#define FETCH_ME 61
+#define EVACUATED 62
+#define N_CLOSURE_TYPES 63
#endif CLOSURETYPES_H
/* ----------------------------------------------------------------------------
- * $Id: Closures.h,v 1.12 1999/03/25 13:01:44 simonm Exp $
+ * $Id: Closures.h,v 1.13 1999/05/11 16:47:40 keithw Exp $
*
* (c) The GHC Team, 1998-1999
*
info tables to be @_Evacuate_1@ and @_Scavenge_1_0@.
-------------------------------------------------------------------------- */
-#ifdef TICKY
+#ifdef TICKY_TICKY
typedef struct {
- W_ updated;
+ /* old: W_ updated; */
} StgTickyHeader;
-#else /* !TICKY */
+#else /* !TICKY_TICKY */
typedef struct {
/* empty */
} StgTickyHeader;
-#endif /* TICKY */
+#endif /* TICKY_TICKY */
/* -----------------------------------------------------------------------------
The full fixed-size closure header
#ifdef GRAN
StgGranHeader par;
#endif
-#ifdef TICKY
+#ifdef TICKY_TICKY
StgTickyHeader ticky;
#endif
} StgHeader;
/* -----------------------------------------------------------------------------
- * $Id: StgMacros.h,v 1.9 1999/04/28 12:42:45 sewardj Exp $
+ * $Id: StgMacros.h,v 1.10 1999/05/11 16:47:41 keithw Exp $
*
* (c) The GHC Team, 1998-1999
*
#define R6_PTR 1<<5
#define R7_PTR 1<<6
#define R8_PTR 1<<7
-
#define HP_CHK_GEN(headroom,liveness,reentry,tag_assts) \
if ((Hp += (headroom)) > HpLim ) { \
EF_(stg_gen_chk); \
/* set the tag register (if we have one) */
#define SET_TAG(t) /* nothing */
-/* don't do eager blackholing for now */
-#define UPD_BH_UPDATABLE(thunk) /* nothing */
-#define UPD_BH_SINGLE_ENTRY(thunk) /* nothing */
+#ifdef EAGER_BLACKHOLING
+# define UPD_BH_UPDATABLE(thunk) \
+ TICK_UPD_BH_UPDATABLE(); \
+ SET_INFO((StgClosure *)thunk,&BLACKHOLE_info)
+# define UPD_BH_SINGLE_ENTRY(thunk) \
+ TICK_UPD_BH_SINGLE_ENTRY(); \
+ SET_INFO((StgClosure *)thunk,&SE_BLACKHOLE_info)
+#else /* !EAGER_BLACKHOLING */
+# define UPD_BH_UPDATABLE(thunk) /* nothing */
+# define UPD_BH_SINGLE_ENTRY(thunk) /* nothing */
+#endif /* EAGER_BLACKHOLING */
/* -----------------------------------------------------------------------------
Moving Floats and Doubles
/* -----------------------------------------------------------------------------
- * $Id: StgMiscClosures.h,v 1.11 1999/03/02 19:44:20 sof Exp $
+ * $Id: StgMiscClosures.h,v 1.12 1999/05/11 16:47:41 keithw Exp $
*
* (c) The GHC Team, 1998-1999
*
STGFUN(CAF_BLACKHOLE_entry);
STGFUN(BLACKHOLE_entry);
STGFUN(BLACKHOLE_BQ_entry);
+#ifdef TICKY_TICKY
+STGFUN(SE_BLACKHOLE_entry);
+STGFUN(SE_CAF_BLACKHOLE_entry);
+#endif
STGFUN(BCO_entry);
STGFUN(EVACUATED_entry);
STGFUN(FOREIGN_entry);
extern DLL_IMPORT_RTS const StgInfoTable CAF_BLACKHOLE_info;
extern DLL_IMPORT_RTS const StgInfoTable BLACKHOLE_info;
extern DLL_IMPORT_RTS const StgInfoTable BLACKHOLE_BQ_info;
+#ifdef TICKY_TICKY
+extern DLL_IMPORT_RTS const StgInfoTable SE_BLACKHOLE_info;
+extern DLL_IMPORT_RTS const StgInfoTable SE_CAF_BLACKHOLE_info;
+#endif
extern DLL_IMPORT_RTS const StgInfoTable BCO_info;
extern DLL_IMPORT_RTS const StgInfoTable EVACUATED_info;
extern DLL_IMPORT_RTS const StgInfoTable FOREIGN_info;
extern StgFun stg_error_entry;
+ /* (see also below -- KSW 1998-12) */
+
/* standard selector thunks */
#ifdef COMPILING_RTS
EI__ __sel_14_noupd_info;
EI__ __sel_15_noupd_info;
+ /* and their standard entry points -- KSW 1998-12 */
+
+EF_(__sel_0_upd_entry);
+EF_(__sel_1_upd_entry);
+EF_(__sel_2_upd_entry);
+EF_(__sel_3_upd_entry);
+EF_(__sel_4_upd_entry);
+EF_(__sel_5_upd_entry);
+EF_(__sel_6_upd_entry);
+EF_(__sel_7_upd_entry);
+EF_(__sel_8_upd_entry);
+EF_(__sel_8_upd_entry);
+EF_(__sel_9_upd_entry);
+EF_(__sel_10_upd_entry);
+EF_(__sel_11_upd_entry);
+EF_(__sel_12_upd_entry);
+EF_(__sel_13_upd_entry);
+EF_(__sel_14_upd_entry);
+EF_(__sel_15_upd_entry);
+
+EF_(__sel_0_noupd_entry);
+EF_(__sel_1_noupd_entry);
+EF_(__sel_2_noupd_entry);
+EF_(__sel_3_noupd_entry);
+EF_(__sel_4_noupd_entry);
+EF_(__sel_5_noupd_entry);
+EF_(__sel_6_noupd_entry);
+EF_(__sel_7_noupd_entry);
+EF_(__sel_8_noupd_entry);
+EF_(__sel_9_noupd_entry);
+EF_(__sel_10_noupd_entry);
+EF_(__sel_11_noupd_entry);
+EF_(__sel_12_noupd_entry);
+EF_(__sel_13_noupd_entry);
+EF_(__sel_14_noupd_entry);
+EF_(__sel_15_noupd_entry);
+
/* standard ap thunks */
EI__ __ap_1_upd_info;
/* ----------------------------------------------------------------------------
- * $Id: StgTicky.h,v 1.3 1999/02/05 16:02:30 simonm Exp $
+ * $Id: StgTicky.h,v 1.4 1999/05/11 16:47:42 keithw Exp $
*
* (c) The AQUA project, Glasgow University, 1994-1997
* (c) The GHC Team, 1998-1999
ALLOC_FUN_gds += (g); ALLOC_FUN_slp += (s); \
TICK_ALLOC_HISTO(FUN,_HS,g,s)
-#define TICK_ALLOC_THK(g,s) \
- ALLOC_THK_ctr++; ALLOC_THK_adm += _HS; \
+#define TICK_ALLOC_UP_THK(g,s) \
+ ALLOC_UP_THK_ctr++; ALLOC_THK_adm += _HS; \
+ ALLOC_THK_gds += (g); ALLOC_THK_slp += (s); \
+ TICK_ALLOC_HISTO(THK,_HS,g,s)
+
+#define TICK_ALLOC_SE_THK(g,s) \
+ ALLOC_SE_THK_ctr++; ALLOC_THK_adm += _HS; \
ALLOC_THK_gds += (g); ALLOC_THK_slp += (s); \
TICK_ALLOC_HISTO(THK,_HS,g,s)
#define TICK_ENT_CON(n) ENT_CON_ctr++ /* enter constructor */
#define TICK_ENT_IND(n) ENT_IND_ctr++ /* enter indirection */
+#define TICK_ENT_PERM_IND(n) ENT_PERM_IND_ctr++ /* enter permanent indirection */
#define TICK_ENT_PAP(n) ENT_PAP_ctr++ /* enter PAP */
#define TICK_ENT_AP_UPD(n) ENT_AP_UPD_ctr++ /* enter AP_UPD */
#define TICK_ENT_BH() ENT_BH_ctr++ /* enter BLACKHOLE */
+
/* -----------------------------------------------------------------------------
Returns
-------------------------------------------------------------------------- */
-------------------------------------------------------------------------- */
#define TICK_UPDF_OMITTED() UPDF_OMITTED_ctr++
-#define TICK_UPDF_PUSHED() UPDF_PUSHED_ctr++
+#define TICK_UPDF_PUSHED(tgt,inf) UPDF_PUSHED_ctr++ \
+/* ; fprintf(stderr,"UPDF_PUSHED:%p:%p\n",tgt,inf) */
#define TICK_SEQF_PUSHED() SEQF_PUSHED_ctr++
#define TICK_CATCHF_PUSHED() CATCHF_PUSHED_ctr++
#define TICK_UPDF_RCC_PUSHED() UPDF_RCC_PUSHED_ctr++
/* For the generational collector:
*/
#define TICK_UPD_NEW_IND() UPD_NEW_IND_ctr++
+#define TICK_UPD_NEW_PERM_IND(tgt) UPD_NEW_PERM_IND_ctr++ \
+/* ; fprintf(stderr,"UPD_NEW_PERM:%p\n",tgt) */
#define TICK_UPD_OLD_IND() UPD_OLD_IND_ctr++
+#define TICK_UPD_OLD_PERM_IND() UPD_OLD_PERM_IND_ctr++
+
+/* Count blackholes:
+ */
+#define TICK_UPD_BH_UPDATABLE() UPD_BH_UPDATABLE_ctr++
+#define TICK_UPD_BH_SINGLE_ENTRY() UPD_BH_SINGLE_ENTRY_ctr++
+#define TICK_UPD_CAF_BH_UPDATABLE(s) \
+ UPD_CAF_BH_UPDATABLE_ctr++ \
+/* ; fprintf(stderr,"TICK_UPD_CAF_BH_UPDATABLE(%s)\n",s) */
+#define TICK_UPD_CAF_BH_SINGLE_ENTRY(s) \
+ UPD_CAF_BH_SINGLE_ENTRY_ctr++ \
+/* ; fprintf(stderr,"TICK_UPD_CAF_BH_SINGLE_ENTRY(%s)\n",s) */
+
/* -----------------------------------------------------------------------------
Garbage collection counters
#endif
;
-EXTERN unsigned long ALLOC_THK_ctr INIT(0);
+EXTERN unsigned long ALLOC_UP_THK_ctr INIT(0);
+EXTERN unsigned long ALLOC_SE_THK_ctr INIT(0);
EXTERN unsigned long ALLOC_THK_adm INIT(0);
EXTERN unsigned long ALLOC_THK_gds INIT(0);
EXTERN unsigned long ALLOC_THK_slp INIT(0);
EXTERN unsigned long ENT_FUN_DIRECT_ctr INIT(0);
EXTERN unsigned long ENT_CON_ctr INIT(0);
EXTERN unsigned long ENT_IND_ctr INIT(0);
+EXTERN unsigned long ENT_PERM_IND_ctr INIT(0);
EXTERN unsigned long ENT_PAP_ctr INIT(0);
EXTERN unsigned long ENT_AP_UPD_ctr INIT(0);
EXTERN unsigned long ENT_BH_ctr INIT(0);
;
EXTERN unsigned long UPD_NEW_IND_ctr INIT(0);
+EXTERN unsigned long UPD_NEW_PERM_IND_ctr INIT(0);
EXTERN unsigned long UPD_OLD_IND_ctr INIT(0);
+EXTERN unsigned long UPD_OLD_PERM_IND_ctr INIT(0);
+
+EXTERN unsigned long UPD_BH_UPDATABLE_ctr INIT(0);
+EXTERN unsigned long UPD_BH_SINGLE_ENTRY_ctr INIT(0);
+EXTERN unsigned long UPD_CAF_BH_UPDATABLE_ctr INIT(0);
+EXTERN unsigned long UPD_CAF_BH_SINGLE_ENTRY_ctr INIT(0);
EXTERN unsigned long GC_SEL_ABANDONED_ctr INIT(0);
EXTERN unsigned long GC_SEL_MINOR_ctr INIT(0);
#define TICK_ALLOC_HEAP(words)
#define TICK_ALLOC_FUN(g,s)
-#define TICK_ALLOC_THK(g,s)
+#define TICK_ALLOC_UP_THK(g,s)
+#define TICK_ALLOC_SE_THK(g,s)
#define TICK_ALLOC_CON(g,s)
#define TICK_ALLOC_TUP(g,s)
#define TICK_ALLOC_BH(g,s)
#define TICK_ENT_CON(n)
#define TICK_ENT_IND(n)
+#define TICK_ENT_PERM_IND(n)
#define TICK_ENT_PAP(n)
#define TICK_ENT_AP_UPD(n)
#define TICK_ENT_BH()
#define TICK_VEC_RETURN(n)
#define TICK_UPDF_OMITTED()
-#define TICK_UPDF_PUSHED()
+#define TICK_UPDF_PUSHED(tgt,inf)
#define TICK_SEQF_PUSHED()
#define TICK_CATCHF_PUSHED()
#define TICK_UPDF_RCC_PUSHED()
#define TICK_UPD_PAP_IN_PLACE()
#define TICK_UPD_NEW_IND()
+#define TICK_UPD_NEW_PERM_IND(tgt)
#define TICK_UPD_OLD_IND()
+#define TICK_UPD_OLD_PERM_IND()
+
+#define TICK_UPD_BH_UPDATABLE()
+#define TICK_UPD_BH_SINGLE_ENTRY()
+#define TICK_UPD_CAF_BH_UPDATABLE()
+#define TICK_UPD_CAF_BH_SINGLE_ENTRY()
#define TICK_GC_SEL_ABANDONED()
#define TICK_GC_SEL_MINOR()
/* -----------------------------------------------------------------------------
- * $Id: TSO.h,v 1.6 1999/03/16 13:20:10 simonm Exp $
+ * $Id: TSO.h,v 1.7 1999/05/11 16:47:42 keithw Exp $
*
* (c) The GHC Team, 1998-1999
*
} StgTSOParInfo;
#endif /* PAR */
-#if defined(TICKY)
+#if defined(TICKY_TICKY)
typedef struct {
} StgTSOTickyInfo;
-#else /* !TICKY */
+#else /* !TICKY_TICKY */
typedef struct {
} StgTSOTickyInfo;
-#endif /* TICKY */
+#endif /* TICKY_TICKY */
typedef enum {
tso_state_runnable,
/* -----------------------------------------------------------------------------
- * $Id: Updates.h,v 1.9 1999/03/18 17:57:20 simonm Exp $
+ * $Id: Updates.h,v 1.10 1999/05/11 16:47:42 keithw Exp $
*
* (c) The GHC Team, 1998-1999
*
* preferably don't use this macro inline in compiled code.
*/
-#define UPD_IND(updclosure, heapptr) \
+#ifdef TICKY_TICKY
+# define UPD_IND(updclosure, heapptr) UPD_PERM_IND(updclosure,heapptr)
+#else
+# define UPD_IND(updclosure, heapptr) UPD_REAL_IND(updclosure,heapptr)
+#endif
+
+/* UPD_IND actually does a PERM_IND if TICKY_TICKY is on;
+ if you *really* need an IND use UPD_REAL_IND
+ */
+#define UPD_REAL_IND(updclosure, heapptr) \
AWAKEN_BQ(updclosure); \
updateWithIndirection((StgClosure *)updclosure, \
(StgClosure *)heapptr);
-#ifdef PROFILING
+#if defined(PROFILING) || defined(TICKY_TICKY)
#define UPD_PERM_IND(updclosure, heapptr) \
AWAKEN_BQ(updclosure); \
updateWithPermIndirection((StgClosure *)updclosure, \
#define PUSH_UPD_FRAME(target, Sp_offset) \
{ \
StgUpdateFrame *__frame; \
- TICK_UPDF_PUSHED(); \
+ TICK_UPDF_PUSHED(target, GET_INFO((StgClosure*)target)); \
__frame = stgCast(StgUpdateFrame*,Sp + (Sp_offset)) - 1; \
SET_INFO(__frame,stgCast(StgInfoTable*,&Upd_frame_info)); \
__frame->link = Su; \
HCFLAGS += -DDEBUG=1
HCFLAGS += -DDEBUG_EXTRA=1
-HCFLAGS += -ULAZY_BLACKHOLING
+HCFLAGS += -ULAZY_BLACKHOLING -DEAGER_BLACKHOLING
HCFLAGS += -DUSE_MINIINTERPRETER=1
HCFLAGS += -DINTERPRETER_ONLY=1
HCFLAGS += -DNO_REGS
SRC_HC_OPTS += -hisuf $(way_)hi
endif
-Int_HC_OPTS += -H14m -fno-prune-tydecls -monly-3-regs
-Word_HC_OPTS += -H12m -monly-3-regs
+# KSW 1998-12: had to increase some of the heap sizes by 2m to 6m for USP
+
+Int_HC_OPTS += -H20m -fno-prune-tydecls -monly-3-regs
+Word_HC_OPTS += -H20m -monly-3-regs
Foreign_HC_OPTS += -fno-prune-tydecls
NativeInfo_HC_OPTS += -fno-prune-tydecls
Dynamic_HC_OPTS += $(MAGIC_HSCPP_OPTS)
-# $Id: Makefile,v 1.13 1999/05/05 10:48:06 sof Exp $
+# $Id: Makefile,v 1.14 1999/05/11 16:47:46 keithw Exp $
#
# Makefile for miscellaneous libraries.
#
#
# Specific flags
#
-BSD_HC_OPTS += -I../std/cbits -optc-DNON_POSIX_SOURCE
+
+# KSW 1998-12: had to increase some of the heap sizes by 2m for USP
+
+BSD_HC_OPTS += -I../std/cbits -H8m -optc-DNON_POSIX_SOURCE
Socket_HC_OPTS += -I../std/cbits -optc-DNON_POSIX_SOURCE
-SocketPrim_HC_OPTS += -I../std/cbits -H10m -optc-DNON_POSIX_SOURCE
+SocketPrim_HC_OPTS += -I../std/cbits -H12m -optc-DNON_POSIX_SOURCE
PackedString_HC_OPTS += -H12m
+Native_HC_OPTS += -H8m
+Pretty_HC_OPTS += -H8m
#-----------------------------------------------------------------------------
# Dependency generation
#
-# $Id: Makefile,v 1.5 1998/12/02 13:26:49 simonm Exp $
+# $Id: Makefile,v 1.6 1999/05/11 16:47:46 keithw Exp $
#
# Makefile for POSIX library
#
PosixTTY_HC_OPTS ='-\#include"cbits/libposix.h"' -monly-2-regs
Posix_HC_OPTS ='-\#include"cbits/libposix.h"'
+# KSW 1998-12: had to increase some of the heap sizes by 2m for USP
+PosixProcPrim_HC_OPTS += -H8m
+PosixFiles_HC_OPTS += -H8m
+
# sigh.
../misc/PackedString_HC_OPTS += -H8m
__interface Main 1 where
__export ! Main main ;
-1 main :: __forall [a] => PrelIOBase.IO a;
+1 main :: __forall [a] => PrelIOBase.IO a; -- wish this could be __o. KSW 1999-04.
Directory_HC_OPTS += -monly-3-regs
Time_HC_OPTS += -monly-3-regs
+# argh, adding USP seems to require extra heap... an extra 2 to 6MB,
+# in fact, on each of these. (KSW 1998-12)
+
# Far too much heap is needed to compile PrelNumExtra with -O at the
# moment, but there you go..
-PrelNumExtra_HC_OPTS += -H30m -K2m
+PrelNumExtra_HC_OPTS += -H34m -K2m
PrelPack_HC_OPTS += -K4m
-PrelBase_HC_OPTS += -H10m
-PrelRead_HC_OPTS += -H16m
-PrelTup_HC_OPTS += -H12m
+PrelBase_HC_OPTS += -H12m
+PrelRead_HC_OPTS += -H20m
+PrelTup_HC_OPTS += -H12m -K2m
PrelNum_HC_OPTS += -H12m -K4m
PrelArr_HC_OPTS += -H8m
-PrelHandle_HC_OPTS += -H14m
-Time_HC_OPTS += -H18m
+PrelHandle_HC_OPTS += -H20m
+Time_HC_OPTS += -H24m -K2m
Complex_HC_OPTS += -H10m
IO_HC_OPTS += -H12m
PrelMain_HC_OPTS += -fno-prune-tydecls # avoids an apparent bug; ToDo
+List_HC_OPTS += -H8m
+Directory_HC_OPTS += -H8m
#-----------------------------------------------------------------------------
# Dependency generation
__interface PrelException 1 0 where
__export ! PrelException ioError catch;
1 ioError :: __forall [a] => PrelIOBase.IOError -> PrelIOBase.IO a ;
-1 catch :: __forall [a] => PrelIOBase.IO a -> (PrelIOBase.IOError -> PrelIOBase.IO a) -> PrelIOBase.IO a ;
+1 catch :: __forall [a] => PrelIOBase.IO a -> (PrelIOBase.IOError -> PrelIOBase.IO a) -> PrelIOBase.IO a ; -- wish there could be more __o's here. KSW 1999-04.
+
---------------------------------------------------------------------------
--- GHC.hi
+-- PrelGHC.hi-boot
--
-- This hand-written interface file allows you to bring into scope the
-- primitive operations and types that GHC knows about.
1 unpackNByteszh :: PrelGHC.Addrzh -> PrelGHC.Intzh -> [PrelBase.Char] ;
1 unpackAppendCStringzh :: PrelGHC.Addrzh -> [PrelBase.Char] -> [PrelBase.Char] ;
1 unpackFoldrCStringzh :: __forall [a] => PrelGHC.Addrzh -> (PrelBase.Char -> a -> a) -> a -> a ;
-
/* -----------------------------------------------------------------------------
- * $Id: ClosureFlags.c,v 1.1 1999/03/15 16:30:27 simonm Exp $
+ * $Id: ClosureFlags.c,v 1.2 1999/05/11 16:47:49 keithw Exp $
*
* (c) The GHC Team 1998-1999
*
/* SEQ_FRAME */ ( _BTM ),
/* BLACKHOLE */ ( _NS| _UPT ),
/* BLACKHOLE_BQ */ ( _NS| _MUT|_UPT ),
+/* SE_BLACKHOLE */ ( _NS| _UPT ),
+/* SE_CAF_BLACKHOLE */ ( _NS| _UPT ),
/* MVAR */ (_HNF| _NS| _MUT|_UPT ),
/* ARR_WORDS */ (_HNF| _NS| _UPT ),
/* MUT_ARR_PTRS */ (_HNF| _NS| _MUT|_UPT ),
* Copyright (c) 1994-1998.
*
* $RCSfile: Evaluator.c,v $
- * $Revision: 1.15 $
- * $Date: 1999/04/28 12:59:51 $
+ * $Revision: 1.16 $
+ * $Date: 1999/05/11 16:47:50 $
* ---------------------------------------------------------------------------*/
#include "Rts.h"
goto enterLoop;
}
case BLACKHOLE:
+ case SE_BLACKHOLE:
case CAF_BLACKHOLE:
+ case SE_CAF_BLACKHOLE:
{
/*was StgBlackHole* */
StgBlockingQueue* bh = (StgBlockingQueue*)obj;
xPushWord(payloadWord(ap,i));
}
obj = ap->fun;
-#ifndef LAZY_BLACKHOLING
-#error no no no
+#ifdef EAGER_BLACKHOLING
{
/* superfluous - but makes debugging easier */
StgBlackHole* bh = stgCast(StgBlackHole*,ap);
IF_DEBUG(gccafs,fprintf(stderr,"Eagerly blackholed AP_UPD %p in evaluator\n",bh));
/*printObj(bh); */
}
-#endif /* LAZY_BLACKHOLING */
+#endif /* EAGER_BLACKHOLING */
goto enterLoop;
}
case PAP:
printObj(obj);
fprintf(stderr,"Sp = %p\tSu = %p\n\n", Sp, Su);
);
-#ifndef LAZY_BLACKHOLING
+#ifdef EAGER_BLACKHOLING
ASSERT(get_itbl(Su->updatee)->type == BLACKHOLE
+ || get_itbl(Su->updatee)->type == SE_BLACKHOLE
|| get_itbl(Su->updatee)->type == CAF_BLACKHOLE
+ || get_itbl(Su->updatee)->type == SE_CAF_BLACKHOLE
);
-#endif /* LAZY_BLACKHOLING */
+#endif /* EAGER_BLACKHOLING */
UPD_IND(Su->updatee,obj);
Sp = stgCast(StgStackPtr,Su) + sizeofW(StgUpdateFrame);
Su = Su->link;
/* -----------------------------------------------------------------------------
- * $Id: GC.c,v 1.58 1999/05/04 10:19:14 sof Exp $
+ * $Id: GC.c,v 1.59 1999/05/11 16:47:53 keithw Exp $
*
* (c) The GHC Team 1998-1999
*
return copy(q,sizeW_fromITBL(info),step);
case CAF_BLACKHOLE:
+ case SE_CAF_BLACKHOLE:
+ case SE_BLACKHOLE:
case BLACKHOLE:
return copyPart(q,BLACKHOLE_sizeW(),sizeofW(StgHeader),step);
/* aargh - do recursively???? */
case CAF_UNENTERED:
case CAF_BLACKHOLE:
+ case SE_CAF_BLACKHOLE:
+ case SE_BLACKHOLE:
case BLACKHOLE:
case BLACKHOLE_BQ:
/* not evaluated yet */
break;
case CAF_BLACKHOLE:
+ case SE_CAF_BLACKHOLE:
+ case SE_BLACKHOLE:
case BLACKHOLE:
p += BLACKHOLE_sizeW();
break;
}
case CAF_BLACKHOLE:
+ case SE_CAF_BLACKHOLE:
+ case SE_BLACKHOLE:
case BLACKHOLE:
break;
recordMutable((StgMutClosure *)to);
continue;
default:
+ /* will never be SE_{,CAF_}BLACKHOLE, since we
+ don't push an update frame for single-entry thunks. KSW 1999-01. */
barf("scavenge_stack: UPDATE_FRAME updatee");
}
}
if (bh->header.info != &BLACKHOLE_BQ_info &&
bh->header.info != &CAF_BLACKHOLE_info) {
+#if (!defined(LAZY_BLACKHOLING)) && defined(DEBUG)
+ fprintf(stderr,"Unexpected lazy BHing required at 0x%04x\n",(int)bh);
+#endif
SET_INFO(bh,&BLACKHOLE_info);
}
* slower --SDM
*/
#if 0 /* do it properly... */
- if (GET_INFO(updatee_bypass) == BLACKHOLE_BQ_info) {
+# if (!defined(LAZY_BLACKHOLING)) && defined(DEBUG)
+# error Unimplemented lazy BH warning. (KSW 1999-01)
+# endif
+ if (GET_INFO(updatee_bypass) == BLACKHOLE_BQ_info
+ || GET_INFO(updatee_bypass) == CAF_BLACKHOLE_info
+ ) {
/* Sigh. It has one. Don't lose those threads! */
if (GET_INFO(updatee_keep) == BLACKHOLE_BQ_info) {
/* Urgh. Two queues. Merge them. */
#endif
TICK_UPD_SQUEEZED();
+ /* wasn't there something about update squeezing and ticky to be sorted out?
+ * oh yes: we aren't counting each enter properly in this case. See the log somewhere.
+ * KSW 1999-04-21 */
UPD_IND(updatee_bypass, updatee_keep); /* this wakes the threads up */
sp = (P_)frame - 1; /* sp = stuff to slide */
StgBlockingQueue *bh = (StgBlockingQueue *)frame->updatee;
if (bh->header.info != &BLACKHOLE_BQ_info &&
bh->header.info != &CAF_BLACKHOLE_info) {
+#if (!defined(LAZY_BLACKHOLING)) && defined(DEBUG)
+ fprintf(stderr,"Unexpected lazy BHing required at 0x%04x\n",(int)bh);
+#endif
SET_INFO(bh,&BLACKHOLE_info);
}
}
/* -----------------------------------------------------------------------------
- * $Id: Printer.c,v 1.12 1999/05/04 10:19:17 sof Exp $
+ * $Id: Printer.c,v 1.13 1999/05/11 16:47:54 keithw Exp $
*
* Copyright (c) 1994-1999.
*
fprintf(stderr,")\n");
break;
+ case SE_BLACKHOLE:
+ fprintf(stderr,"SE_BH\n");
+ break;
+
+ case SE_CAF_BLACKHOLE:
+ fprintf(stderr,"SE_CAF_BH\n");
+ break;
+
case BLACKHOLE:
fprintf(stderr,"BH\n");
break;
/* -----------------------------------------------------------------------------
- * $Id: RtsFlags.c,v 1.12 1999/03/25 13:14:07 simonm Exp $
+ * $Id: RtsFlags.c,v 1.13 1999/05/11 16:47:55 keithw Exp $
*
* (c) The AQUA Project, Glasgow University, 1994-1997
* (c) The GHC Team, 1998-1999
#endif
#ifdef TICKY_TICKY
- RtsFlags.TickyFlags.showTickyStats = rtsFalse;
- RtsFlags.TickyFlags.tickyFile = NULL;
+ RtsFlags.TickyFlags.showTickyStats = rtsFalse;
+ RtsFlags.TickyFlags.tickyFile = NULL;
#endif
}
/* -----------------------------------------------------------------------------
- * $Id: RtsFlags.h,v 1.12 1999/03/25 13:14:08 simonm Exp $
+ * $Id: RtsFlags.h,v 1.13 1999/05/11 16:47:56 keithw Exp $
*
* (c) The GHC Team, 1998-1999
*
struct TICKY_FLAGS {
rtsBool showTickyStats;
FILE *tickyFile;
-
- /* see also: doUpdEntryCounts in AllFlags */
};
#endif /* TICKY_TICKY */
/* -----------------------------------------------------------------------------
- * $Id: Sanity.c,v 1.12 1999/03/26 14:55:05 simonm Exp $
+ * $Id: Sanity.c,v 1.13 1999/05/11 16:47:57 keithw Exp $
*
* (c) The GHC Team, 1998-1999
*
case CAF_UNENTERED:
case CAF_ENTERED:
case CAF_BLACKHOLE:
+#ifdef TICKY_TICKY
+ case SE_CAF_BLACKHOLE:
+ case SE_BLACKHOLE:
+#endif
case BLACKHOLE:
case BLACKHOLE_BQ:
case FOREIGN:
/* -----------------------------------------------------------------------------
- * $Id: Schedule.c,v 1.20 1999/04/27 10:59:31 sewardj Exp $
+ * $Id: Schedule.c,v 1.21 1999/05/11 16:47:57 keithw Exp $
*
* (c) The GHC Team, 1998-1999
*
* handler in this frame.
*/
ap = (StgAP_UPD *)allocate(sizeofW(StgPAP) + 1);
- TICK_ALLOC_THK(2,0);
+ TICK_ALLOC_UPD_PAP(2,0);
SET_HDR(ap,&PAP_info,cf->header.prof.ccs);
ap->n_args = 1;
* fun field.
*/
ap = (StgAP_UPD *)allocate(AP_sizeW(words));
- TICK_ALLOC_THK(words+1,0);
+ TICK_ALLOC_UP_THK(words+1,0);
ASSERT(words >= 0);
/* now build o = FUN(catch,ap,handler) */
o = (StgClosure *)allocate(sizeofW(StgClosure)+2);
- TICK_ALLOC_THK(2,0);
+ TICK_ALLOC_SE_THK(2,0);
SET_HDR(o,&catch_info,su->header.prof.ccs /* ToDo */);
o->payload[0] = (StgClosure *)ap;
o->payload[1] = cf->handler;
/* now build o = FUN(seq,ap) */
o = (StgClosure *)allocate(sizeofW(StgClosure)+1);
- TICK_ALLOC_THK(1,0);
+ TICK_ALLOC_SE_THK(1,0);
SET_HDR(o,&seq_info,su->header.prof.ccs /* ToDo */);
payloadCPtr(o,0) = (StgClosure *)ap;
/* -----------------------------------------------------------------------------
- * $Id: StgMiscClosures.hc,v 1.21 1999/05/04 10:19:19 sof Exp $
+ * $Id: StgMiscClosures.hc,v 1.22 1999/05/11 16:47:58 keithw Exp $
*
* (c) The GHC Team, 1998-1999
*
FB_
/* Don't add INDs to granularity cost */
- /* Dont: TICK_ENT_IND(Node); for ticky-ticky; this ind is here only to help profi
-ling */
+ /* Dont: TICK_ENT_IND(Node); for ticky-ticky; this ind is here only to help profiling */
+
+#if defined(TICKY_TICKY) && !defined(PROFILING)
+ /* TICKY_TICKY && !PROFILING means PERM_IND *replaces* an IND, rather than being extra */
+ TICK_ENT_PERM_IND(R1.p); /* tick */
+#endif
/* Enter PAP cost centre -- lexical scoping only */
ENTER_CCS_PAP_CL(R1.cl);
+ /* For ticky-ticky, change the perm_ind to a normal ind on first
+ * entry, so the number of ent_perm_inds is the number of *thunks*
+ * entered again, not the number of subsequent entries.
+ *
+ * Since this screws up cost centres, we die if profiling and
+ * ticky_ticky are on at the same time. KSW 1999-01.
+ */
+
+#ifdef TICKY_TICKY
+# ifdef PROFILING
+# error Profiling and ticky-ticky do not mix at present!
+# endif /* PROFILING */
+ SET_INFO((StgInd*)R1.p,&IND_info);
+#endif /* TICKY_TICKY */
+
R1.p = (P_) ((StgInd*)R1.p)->indirectee;
/* Dont: TICK_ENT_VIA_NODE(); for ticky-ticky; as above */
+#if defined(TICKY_TICKY) && !defined(PROFILING)
+ TICK_ENT_VIA_NODE();
+#endif
+
JMP_(*R1.p);
FE_
}
STGFUN(IND_OLDGEN_PERM_entry)
{
FB_
- TICK_ENT_IND(Node); /* tick */
-
- /* Dont: TICK_ENT_IND(Node); for ticky-ticky; this ind is here only to help profi
-ling */
+ /* Dont: TICK_ENT_IND(Node); for ticky-ticky; this ind is here only to help profiling */
+#if defined(TICKY_TICKY) && !defined(PROFILING)
+ /* TICKY_TICKY && !PROFILING means PERM_IND *replaces* an IND, rather than being extra */
+ TICK_ENT_PERM_IND(R1.p); /* tick */
+#endif
+
/* Enter PAP cost centre -- lexical scoping only */
ENTER_CCS_PAP_CL(R1.cl);
+ /* see comment in IND_PERM */
+#ifdef TICKY_TICKY
+# ifdef PROFILING
+# error Profiling and ticky-ticky do not mix at present!
+# endif /* PROFILING */
+ SET_INFO((StgInd*)R1.p,&IND_OLDGEN_info);
+#endif /* TICKY_TICKY */
+
R1.p = (P_) ((StgInd*)R1.p)->indirectee;
TICK_ENT_VIA_NODE();
JMP_(*R1.p);
FE_
}
+#ifdef TICKY_TICKY
+INFO_TABLE(SE_BLACKHOLE_info, SE_BLACKHOLE_entry,0,2,SE_BLACKHOLE,const,EF_,0,0);
+STGFUN(SE_BLACKHOLE_entry)
+{
+ FB_
+ STGCALL1(fflush,stdout);
+ STGCALL3(fprintf,stderr,"SE_BLACKHOLE at %p entered!\n",R1.p);
+ STGCALL1(raiseError, errorHandler);
+ stg_exit(EXIT_FAILURE); /* not executed */
+ FE_
+}
+
+INFO_TABLE(SE_CAF_BLACKHOLE_info, SE_CAF_BLACKHOLE_entry,0,2,SE_CAF_BLACKHOLE,const,EF_,0,0);
+STGFUN(SE_CAF_BLACKHOLE_entry)
+{
+ FB_
+ STGCALL1(fflush,stdout);
+ STGCALL3(fprintf,stderr,"SE_CAF_BLACKHOLE at %p entered!\n",R1.p);
+ STGCALL1(raiseError, errorHandler);
+ stg_exit(EXIT_FAILURE); /* not executed */
+ FE_
+}
+#endif
+
/* -----------------------------------------------------------------------------
The code for a BCO returns to the scheduler
-------------------------------------------------------------------------- */
/* -----------------------------------------------------------------------------
- * $Id: Storage.h,v 1.8 1999/03/18 17:57:23 simonm Exp $
+ * $Id: Storage.h,v 1.9 1999/05/11 16:47:59 keithw Exp $
*
* (c) The GHC Team, 1998-1999
*
/* -----------------------------------------------------------------------------
Generational garbage collection support
- RecordMutable(StgPtr p) Informs the garbage collector that a
+ recordMutable(StgPtr p) Informs the garbage collector that a
previously immutable object has
become (permanently) mutable. Used
by thawArray and similar.
- UpdateWithIndirection(p1,p2) Updates the object at p1 with an
+ updateWithIndirection(p1,p2) Updates the object at p1 with an
indirection pointing to p2. This is
normally called for objects in an old
generation (>0) when they are updated.
+ updateWithPermIndirection(p1,p2) As above but uses a permanent indir.
+
-------------------------------------------------------------------------- */
static inline void
}
}
-#ifdef PROFILING
+#if defined(TICKY_TICKY) || defined(PROFILING)
static inline void
updateWithPermIndirection(StgClosure *p1, StgClosure *p2)
{
if (bd->gen->no == 0) {
SET_INFO(p1,&IND_PERM_info);
((StgInd *)p1)->indirectee = p2;
- TICK_UPD_NEW_IND();
+ TICK_UPD_NEW_PERM_IND(p1);
} else {
SET_INFO(p1,&IND_OLDGEN_PERM_info);
((StgIndOldGen *)p1)->indirectee = p2;
((StgIndOldGen *)p1)->mut_link = bd->gen->mut_once_list;
bd->gen->mut_once_list = (StgMutClosure *)p1;
- TICK_UPD_OLD_IND();
+ TICK_UPD_OLD_PERM_IND();
}
}
#endif
/* -----------------------------------------------------------------------------
- * $Id: Ticky.c,v 1.5 1999/03/05 12:43:26 kw217 Exp $
+ * $Id: Ticky.c,v 1.6 1999/05/11 16:47:59 keithw Exp $
*
* (c) The AQUA project, Glasgow University, 1992-1997
* (c) The GHC Team, 1998-1999
{
unsigned long i;
unsigned long tot_allocs = /* total number of things allocated */
- ALLOC_FUN_ctr + ALLOC_THK_ctr + ALLOC_CON_ctr + ALLOC_TUP_ctr +
+ ALLOC_FUN_ctr + ALLOC_SE_THK_ctr + ALLOC_UP_THK_ctr + ALLOC_CON_ctr + ALLOC_TUP_ctr +
ALLOC_TSO_ctr +
#ifdef PAR
ALLOC_FMBQ_ctr + ALLOC_FME_ctr + ALLOC_BF_ctr +
unsigned long tot_enters =
ENT_CON_ctr + ENT_FUN_DIRECT_ctr +
- ENT_IND_ctr + ENT_PAP_ctr + ENT_THK_ctr;
+ ENT_IND_ctr + ENT_PERM_IND_ctr + ENT_PAP_ctr + ENT_THK_ctr;
unsigned long jump_direct_enters =
tot_enters - ENT_VIA_NODE_ctr;
unsigned long bypass_enters =
unsigned long tot_updates = UPD_EXISTING_ctr + UPD_SQUEEZED_ctr + pap_updates;
- unsigned long tot_new_updates = UPD_NEW_IND_ctr;
- unsigned long tot_old_updates = UPD_OLD_IND_ctr;
+ unsigned long tot_new_updates = UPD_NEW_IND_ctr + UPD_NEW_PERM_IND_ctr;
+ unsigned long tot_old_updates = UPD_OLD_IND_ctr + UPD_OLD_PERM_IND_ctr;
unsigned long tot_gengc_updates = tot_new_updates + tot_old_updates;
FILE *tf = RtsFlags.TickyFlags.tickyFile;
fprintf(tf,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(FUN));
fprintf(tf,"\n%7ld (%5.1f%%) thunks",
- ALLOC_THK_ctr,
- PC(INTAVG(ALLOC_THK_ctr, tot_allocs)));
- if (ALLOC_THK_ctr != 0)
+ ALLOC_SE_THK_ctr + ALLOC_UP_THK_ctr,
+ PC(INTAVG(ALLOC_SE_THK_ctr + ALLOC_UP_THK_ctr, tot_allocs)));
+
+#define ALLOC_THK_ctr (ALLOC_UP_THK_ctr + ALLOC_SE_THK_ctr)
+ /* hack to make ALLOC_HISTO_MAGIC still work for THK */
+ if ((ALLOC_SE_THK_ctr + ALLOC_UP_THK_ctr) != 0)
fprintf(tf,"\t\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(THK));
+#undef ALLOC_THK_ctr
fprintf(tf,"\n%7ld (%5.1f%%) data values",
ALLOC_CON_ctr,
fprintf(tf,"%7ld (%5.1f%%) partial applications\n",
ENT_PAP_ctr,
PC(INTAVG(ENT_PAP_ctr,tot_enters)));
- fprintf(tf,"%7ld (%5.1f%%) indirections\n",
+ fprintf(tf,"%7ld (%5.1f%%) normal indirections\n",
ENT_IND_ctr,
PC(INTAVG(ENT_IND_ctr,tot_enters)));
+ fprintf(tf,"%7ld (%5.1f%%) permanent indirections\n",
+ ENT_PERM_IND_ctr,
+ PC(INTAVG(ENT_PERM_IND_ctr,tot_enters)));
fprintf(tf,"\nRETURNS: %ld\n", tot_returns);
fprintf(tf,"%7ld (%5.1f%%) from entering a new constructor\n\t\t [the rest from entering an existing constructor]\n",
#define PR_CTR(ctr) \
do { fprintf(tf,"%7ld " #ctr "\n", ctr); } while(0)
+/* COND_PR_CTR takes a boolean; if false then msg is the printname rather than ctr */
+#define COND_PR_CTR(ctr,b,msg) \
+ if (b) { fprintf(tf,"%7ld " #ctr "\n", ctr); } else { fprintf(tf,"%7ld " msg "\n", ctr); }
#define PR_HST(hst,i) \
do { fprintf(tf,"%7ld " #hst "_" #i "\n", hst[i]); } while(0)
PR_HST(ALLOC_FUN_hst,2);
PR_HST(ALLOC_FUN_hst,3);
PR_HST(ALLOC_FUN_hst,4);
- PR_CTR(ALLOC_THK_ctr);
+ PR_CTR(ALLOC_UP_THK_ctr);
+ PR_CTR(ALLOC_SE_THK_ctr);
PR_CTR(ALLOC_THK_adm);
PR_CTR(ALLOC_THK_gds);
PR_CTR(ALLOC_THK_slp);
PR_CTR(ENT_FUN_STD_ctr);
PR_CTR(ENT_FUN_DIRECT_ctr);
PR_CTR(ENT_IND_ctr);
+
+/* The counters ENT_PERM_IND and UPD_{NEW,OLD}_PERM_IND are not dumped
+ * at the end of execution unless update squeezing is turned off (+RTS
+ * -Z =RtsFlags.GcFlags.squeezeUpdFrames), as they will be wrong
+ * otherwise. Why? Because for each update frame squeezed out, we
+ * count an UPD_NEW_PERM_IND *at GC time* (i.e., too early). And
+ * further, when we enter the closure that has been updated, we count
+ * the ENT_PERM_IND, but we then enter the PERM_IND that was built for
+ * the next update frame below, and so on down the chain until we
+ * finally reach the value. Thus we count many new ENT_PERM_INDs too
+ * early.
+ *
+ * This of course refers to the -ticky version that uses PERM_INDs to
+ * determine the number of closures entered 0/1/>1. KSW 1999-04. */
+ COND_PR_CTR(ENT_PERM_IND_ctr,RtsFlags.GcFlags.squeezeUpdFrames == rtsTrue,"E!NT_PERM_IND_ctr requires +RTS -Z");
+
PR_CTR(ENT_PAP_ctr);
PR_CTR(ENT_AP_UPD_ctr);
PR_CTR(ENT_BH_ctr);
PR_CTR(UPD_PAP_IN_NEW_ctr);
PR_CTR(UPD_PAP_IN_PLACE_ctr);
+ PR_CTR(UPD_BH_UPDATABLE_ctr);
+ PR_CTR(UPD_BH_SINGLE_ENTRY_ctr);
+ PR_CTR(UPD_CAF_BH_UPDATABLE_ctr);
+ PR_CTR(UPD_CAF_BH_SINGLE_ENTRY_ctr);
+
PR_HST(UPD_CON_IN_NEW_hst,0);
PR_HST(UPD_CON_IN_NEW_hst,1);
PR_HST(UPD_CON_IN_NEW_hst,2);
PR_HST(UPD_PAP_IN_NEW_hst,8);
PR_CTR(UPD_NEW_IND_ctr);
+ /* see comment on ENT_PERM_IND_ctr */
+ COND_PR_CTR(UPD_NEW_PERM_IND_ctr,RtsFlags.GcFlags.squeezeUpdFrames == rtsTrue,"U!PD_NEW_PERM_IND_ctr requires +RTS -Z");
PR_CTR(UPD_OLD_IND_ctr);
+ /* see comment on ENT_PERM_IND_ctr */
+ COND_PR_CTR(UPD_OLD_PERM_IND_ctr,RtsFlags.GcFlags.squeezeUpdFrames == rtsTrue,"U!PD_OLD_PERM_IND_ctr requires +RTS -Z");
PR_CTR(GC_SEL_ABANDONED_ctr);
PR_CTR(GC_SEL_MINOR_ctr);
/* -----------------------------------------------------------------------------
- * $Id: Updates.hc,v 1.15 1999/04/23 09:47:33 simonm Exp $
+ * $Id: Updates.hc,v 1.16 1999/05/11 16:48:00 keithw Exp $
*
* (c) The GHC Team, 1998-1999
*
#include "Rts.h"
#include "RtsUtils.h"
+#include "RtsFlags.h"
#include "HeapStackCheck.h"
#include "Storage.h"
#include "ProfRts.h"
* either the new PAP or Node.
*/
- Updatee = Su->updatee;
+ Updatee = Su->updatee;
#if defined(PROFILING)
if (Words != 0) {