Commit e7c3f957 authored by simonmar's avatar simonmar

[project @ 2005-02-10 13:01:52 by simonmar]

GC changes: instead of threading old-generation mutable lists
through objects in the heap, keep it in a separate flat array.

This has some advantages:

  - the IND_OLDGEN object is now only 2 words, so the minimum
    size of a THUNK is now 2 words instead of 3.  This saves
    some amount of allocation (about 2% on average according to
    my measurements), and is more friendly to the cache by
    squashing objects together more.

  - keeping the mutable list separate from the IND object
    will be necessary for our multiprocessor implementation.

  - removing the mut_link field makes the layout of some objects
    more uniform, leading to less complexity and special cases.

  - I also unified the two mutable lists (mut_once_list and mut_list)
    into a single mutable list, which lead to more simplifications
    in the GC.
parent 0c4c6606
...@@ -345,7 +345,7 @@ mkUpdInfoLabel = RtsLabel (RtsInfo SLIT("stg_upd_frame")) ...@@ -345,7 +345,7 @@ mkUpdInfoLabel = RtsLabel (RtsInfo SLIT("stg_upd_frame"))
mkSeqInfoLabel = RtsLabel (RtsInfo SLIT("stg_seq_frame")) mkSeqInfoLabel = RtsLabel (RtsInfo SLIT("stg_seq_frame"))
mkIndStaticInfoLabel = RtsLabel (RtsInfo SLIT("stg_IND_STATIC")) mkIndStaticInfoLabel = RtsLabel (RtsInfo SLIT("stg_IND_STATIC"))
mkMainCapabilityLabel = RtsLabel (RtsData SLIT("MainCapability")) mkMainCapabilityLabel = RtsLabel (RtsData SLIT("MainCapability"))
mkMAP_FROZEN_infoLabel = RtsLabel (RtsInfo SLIT("stg_MUT_ARR_PTRS_FROZEN")) mkMAP_FROZEN_infoLabel = RtsLabel (RtsInfo SLIT("stg_MUT_ARR_PTRS_FROZEN0"))
mkEMPTY_MVAR_infoLabel = RtsLabel (RtsInfo SLIT("stg_EMPTY_MVAR")) mkEMPTY_MVAR_infoLabel = RtsLabel (RtsInfo SLIT("stg_EMPTY_MVAR"))
mkTopTickyCtrLabel = RtsLabel (RtsData SLIT("top_ct")) mkTopTickyCtrLabel = RtsLabel (RtsData SLIT("top_ct"))
......
...@@ -186,7 +186,7 @@ static :: { ExtFCode [CmmStatic] } ...@@ -186,7 +186,7 @@ static :: { ExtFCode [CmmStatic] }
{ do lits <- sequence $4; { do lits <- sequence $4;
return $ map CmmStaticLit $ return $ map CmmStaticLit $
mkStaticClosure (mkRtsInfoLabelFS $3) mkStaticClosure (mkRtsInfoLabelFS $3)
dontCareCCS (map getLit lits) [] [] } dontCareCCS (map getLit lits) [] [] [] }
-- arrays of closures required for the CHARLIKE & INTLIKE arrays -- arrays of closures required for the CHARLIKE & INTLIKE arrays
lits :: { [ExtFCode CmmExpr] } lits :: { [ExtFCode CmmExpr] }
...@@ -712,7 +712,7 @@ funInfo name ptrs nptrs cl_type desc_str ty_str fun_type = do ...@@ -712,7 +712,7 @@ funInfo name ptrs nptrs cl_type desc_str ty_str fun_type = do
staticClosure :: FastString -> FastString -> [CmmLit] -> ExtCode staticClosure :: FastString -> FastString -> [CmmLit] -> ExtCode
staticClosure cl_label info payload staticClosure cl_label info payload
= code $ emitDataLits (mkRtsDataLabelFS cl_label) lits = code $ emitDataLits (mkRtsDataLabelFS cl_label) lits
where lits = mkStaticClosure (mkRtsInfoLabelFS info) dontCareCCS payload [] [] where lits = mkStaticClosure (mkRtsInfoLabelFS info) dontCareCCS payload [] [] []
foreignCall foreignCall
:: String :: String
......
% %
% (c) The GRASP/AQUA Project, Glasgow University, 1992-1998 % (c) The GRASP/AQUA Project, Glasgow University, 1992-1998
% %
% $Id: CgHeapery.lhs,v 1.42 2004/11/26 16:20:09 simonmar Exp $ % $Id: CgHeapery.lhs,v 1.43 2005/02/10 13:01:53 simonmar Exp $
% %
\section[CgHeapery]{Heap management functions} \section[CgHeapery]{Heap management functions}
...@@ -34,9 +34,8 @@ import CgTicky ( staticTickyHdr, tickyDynAlloc, tickyAllocHeap ) ...@@ -34,9 +34,8 @@ import CgTicky ( staticTickyHdr, tickyDynAlloc, tickyAllocHeap )
import CgParallel ( staticGranHdr, staticParHdr, doGranAllocate ) import CgParallel ( staticGranHdr, staticParHdr, doGranAllocate )
import CgStackery ( getFinalStackHW, getRealSp ) import CgStackery ( getFinalStackHW, getRealSp )
import CgCallConv ( mkRegLiveness ) import CgCallConv ( mkRegLiveness )
import ClosureInfo ( closureSize, closureUpdReqd, import ClosureInfo ( closureSize, staticClosureNeedsLink,
staticClosureNeedsLink, mkConInfo, closureNeedsUpdSpace,
mkConInfo,
infoTableLabelFromCI, closureLabelFromCI, infoTableLabelFromCI, closureLabelFromCI,
nodeMustPointToIt, closureLFInfo, nodeMustPointToIt, closureLFInfo,
ClosureInfo ) ClosureInfo )
...@@ -189,26 +188,37 @@ mkStaticClosureFields ...@@ -189,26 +188,37 @@ mkStaticClosureFields
-> [CmmLit] -- Payload -> [CmmLit] -- Payload
-> [CmmLit] -- The full closure -> [CmmLit] -- The full closure
mkStaticClosureFields cl_info ccs caf_refs payload mkStaticClosureFields cl_info ccs caf_refs payload
= mkStaticClosure info_lbl ccs payload padding_wds static_link_field = mkStaticClosure info_lbl ccs payload padding_wds
static_link_field saved_info_field
where where
info_lbl = infoTableLabelFromCI cl_info info_lbl = infoTableLabelFromCI cl_info
upd_reqd = closureUpdReqd cl_info -- CAFs must have consistent layout, regardless of whether they
-- are actually updatable or not. The layout of a CAF is:
--
-- 3 saved_info
-- 2 static_link
-- 1 indirectee
-- 0 info ptr
--
-- the static_link and saved_info fields must always be in the same
-- place. So we use closureNeedsUpdSpace rather than
-- closureUpdReqd here:
is_caf = closureNeedsUpdSpace cl_info
-- for the purposes of laying out the static closure, we consider all
-- thunks to be "updatable", so that the static link field is always
-- in the same place.
padding_wds padding_wds
| not upd_reqd = [] | not is_caf = []
| otherwise = replicate n (mkIntCLit 0) -- a bunch of 0s | otherwise = replicate n (mkIntCLit 0) -- a bunch of 0s
where n = max 0 (mIN_UPD_SIZE - length payload) where n = max 0 (mIN_UPD_SIZE - length payload)
-- We always have a static link field for a thunk, it's used to
-- save the closure's info pointer when we're reverting CAFs
-- (see comment in Storage.c)
static_link_field static_link_field
| upd_reqd || staticClosureNeedsLink cl_info = [static_link_value] | is_caf || staticClosureNeedsLink cl_info = [static_link_value]
| otherwise = [] | otherwise = []
saved_info_field
| is_caf = [mkIntCLit 0]
| otherwise = []
-- for a static constructor which has NoCafRefs, we set the -- for a static constructor which has NoCafRefs, we set the
-- static link field to a non-zero value so the garbage -- static link field to a non-zero value so the garbage
...@@ -218,13 +228,14 @@ mkStaticClosureFields cl_info ccs caf_refs payload ...@@ -218,13 +228,14 @@ mkStaticClosureFields cl_info ccs caf_refs payload
| otherwise = mkIntCLit 1 | otherwise = mkIntCLit 1
mkStaticClosure :: CLabel -> CostCentreStack -> [CmmLit] mkStaticClosure :: CLabel -> CostCentreStack -> [CmmLit]
-> [CmmLit] -> [CmmLit] -> [CmmLit] -> [CmmLit] -> [CmmLit] -> [CmmLit] -> [CmmLit]
mkStaticClosure info_lbl ccs payload padding_wds static_link_field mkStaticClosure info_lbl ccs payload padding_wds static_link_field saved_info_field
= [CmmLabel info_lbl] = [CmmLabel info_lbl]
++ variable_header_words ++ variable_header_words
++ payload ++ payload
++ padding_wds ++ padding_wds
++ static_link_field ++ static_link_field
++ saved_info_field
where where
variable_header_words variable_header_words
= staticGranHdr = staticGranHdr
......
...@@ -175,7 +175,7 @@ emitPrimOp [res] DataToTagOp [arg] live ...@@ -175,7 +175,7 @@ emitPrimOp [res] DataToTagOp [arg] live
-- #define unsafeFreezzeArrayzh(r,a) -- #define unsafeFreezzeArrayzh(r,a)
-- { -- {
-- SET_INFO((StgClosure *)a,&stg_MUT_ARR_PTRS_FROZEN_info); -- SET_INFO((StgClosure *)a,&stg_MUT_ARR_PTRS_FROZEN0_info);
-- r = a; -- r = a;
-- } -- }
emitPrimOp [res] UnsafeFreezeArrayOp [arg] live emitPrimOp [res] UnsafeFreezeArrayOp [arg] live
......
...@@ -29,7 +29,8 @@ module ClosureInfo ( ...@@ -29,7 +29,8 @@ module ClosureInfo (
closureName, infoTableLabelFromCI, closureName, infoTableLabelFromCI,
closureLabelFromCI, closureSRT, closureLabelFromCI, closureSRT,
closureLFInfo, closureSMRep, closureUpdReqd, closureLFInfo, closureSMRep, closureUpdReqd,
closureNeedsUpdSpace,
closureSingleEntry, closureReEntrant, isConstrClosure_maybe, closureSingleEntry, closureReEntrant, isConstrClosure_maybe,
closureFunInfo, isStandardFormThunk, isKnownFun, closureFunInfo, isStandardFormThunk, isKnownFun,
......
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
* $Id: Block.h,v 1.17 2004/08/13 13:09:09 simonmar Exp $ * $Id: Block.h,v 1.18 2005/02/10 13:02:00 simonmar Exp $
* *
* (c) The GHC Team, 1998-1999 * (c) The GHC Team, 1998-1999
* *
...@@ -142,9 +142,11 @@ INLINE_HEADER bdescr *Bdescr(StgPtr p) ...@@ -142,9 +142,11 @@ INLINE_HEADER bdescr *Bdescr(StgPtr p)
(1 + (W_)MBLOCK_ROUND_UP((n-BLOCKS_PER_MBLOCK) * BLOCK_SIZE) / MBLOCK_SIZE) (1 + (W_)MBLOCK_ROUND_UP((n-BLOCKS_PER_MBLOCK) * BLOCK_SIZE) / MBLOCK_SIZE)
#ifndef CMINUSMINUS
// to the end...
/* Double-linked block lists: --------------------------------------------- */ /* Double-linked block lists: --------------------------------------------- */
#ifndef CMINUSMINUS
INLINE_HEADER void INLINE_HEADER void
dbl_link_onto(bdescr *bd, bdescr **list) dbl_link_onto(bdescr *bd, bdescr **list)
{ {
...@@ -155,6 +157,37 @@ dbl_link_onto(bdescr *bd, bdescr **list) ...@@ -155,6 +157,37 @@ dbl_link_onto(bdescr *bd, bdescr **list)
} }
*list = bd; *list = bd;
} }
#endif
/* Initialisation ---------------------------------------------------------- */
extern void initBlockAllocator(void);
/* Allocation -------------------------------------------------------------- */
extern bdescr *allocGroup(nat n);
extern bdescr *allocBlock(void);
/* De-Allocation ----------------------------------------------------------- */
extern void freeGroup(bdescr *p);
extern void freeChain(bdescr *p);
/* Round a value to megablocks --------------------------------------------- */
#define WORDS_PER_MBLOCK (BLOCKS_PER_MBLOCK * BLOCK_SIZE_W)
INLINE_HEADER nat
round_to_mblocks(nat words)
{
if (words > WORDS_PER_MBLOCK) {
if ((words % WORDS_PER_MBLOCK) < (WORDS_PER_MBLOCK / 2)) {
words = (words / WORDS_PER_MBLOCK) * WORDS_PER_MBLOCK;
} else {
words = ((words / WORDS_PER_MBLOCK) + 1) * WORDS_PER_MBLOCK;
}
}
return words;
}
#endif /* !CMINUSMINUS */
#endif /* BLOCK_H */ #endif /* BLOCK_H */
...@@ -174,16 +174,9 @@ ...@@ -174,16 +174,9 @@
/* These macros are optimised versions of the above for certain /* These macros are optimised versions of the above for certain
* closure types. They *must* be equivalent to the generic * closure types. They *must* be equivalent to the generic
* STATIC_LINK. * STATIC_LINK.
*
* You may be surprised that the STATIC_LINK field for a THUNK_STATIC
* is at offset 2; that's because a THUNK_STATIC always has two words
* of (non-ptr) padding, to make room for the IND_STATIC that is
* going to overwrite it. It doesn't do any harm, because a
* THUNK_STATIC needs this extra word for the IND_STATIC's saved_info
* field anyhow. Hmm, this is all rather delicate. --SDM
*/ */
#define FUN_STATIC_LINK(p) ((p)->payload[0]) #define FUN_STATIC_LINK(p) ((p)->payload[0])
#define THUNK_STATIC_LINK(p) ((p)->payload[2]) #define THUNK_STATIC_LINK(p) ((p)->payload[1])
#define IND_STATIC_LINK(p) ((p)->payload[1]) #define IND_STATIC_LINK(p) ((p)->payload[1])
#define STATIC_LINK2(info,p) \ #define STATIC_LINK2(info,p) \
......
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
* $Id: ClosureTypes.h,v 1.19 2004/11/18 09:56:17 tharris Exp $ * $Id: ClosureTypes.h,v 1.20 2005/02/10 13:02:02 simonmar Exp $
* *
* (c) The GHC Team, 1998-1999 * (c) The GHC Team, 1998-1999
* *
...@@ -66,9 +66,9 @@ ...@@ -66,9 +66,9 @@
#define MVAR 50 #define MVAR 50
#define ARR_WORDS 51 #define ARR_WORDS 51
#define MUT_ARR_PTRS 52 #define MUT_ARR_PTRS 52
#define MUT_ARR_PTRS_FROZEN 53 #define MUT_ARR_PTRS_FROZEN0 53
#define MUT_VAR 54 #define MUT_ARR_PTRS_FROZEN 54
#define MUT_CONS 55 #define MUT_VAR 55
#define WEAK 56 #define WEAK 56
#define FOREIGN 57 #define FOREIGN 57
#define STABLE_NAME 58 #define STABLE_NAME 58
...@@ -87,5 +87,5 @@ ...@@ -87,5 +87,5 @@
#define CATCH_RETRY_FRAME 71 #define CATCH_RETRY_FRAME 71
#define CATCH_STM_FRAME 72 #define CATCH_STM_FRAME 72
#define N_CLOSURE_TYPES 73 #define N_CLOSURE_TYPES 73
#endif /* CLOSURETYPES_H */ #endif /* CLOSURETYPES_H */
...@@ -66,19 +66,6 @@ struct StgClosure_ { ...@@ -66,19 +66,6 @@ struct StgClosure_ {
struct StgClosure_ *payload[FLEXIBLE_ARRAY]; struct StgClosure_ *payload[FLEXIBLE_ARRAY];
}; };
/* What a stroke of luck - all our mutable closures follow the same
* basic layout, with the mutable link field as the second field after
* the header. This means the following structure is the supertype of
* mutable closures.
*/
typedef struct StgMutClosure_ {
StgHeader header;
StgWord padding;
struct StgMutClosure_ *mut_link;
struct StgClosure_ *payload[FLEXIBLE_ARRAY];
} StgMutClosure;
typedef struct { typedef struct {
StgHeader header; StgHeader header;
StgClosure *selectee; StgClosure *selectee;
...@@ -107,12 +94,6 @@ typedef struct { ...@@ -107,12 +94,6 @@ typedef struct {
StgClosure *indirectee; StgClosure *indirectee;
} StgInd; } StgInd;
typedef struct {
StgHeader header;
StgClosure *indirectee;
StgMutClosure *mut_link;
} StgIndOldGen;
typedef struct { typedef struct {
StgHeader header; StgHeader header;
StgClosure *indirectee; StgClosure *indirectee;
...@@ -129,14 +110,12 @@ typedef struct { ...@@ -129,14 +110,12 @@ typedef struct {
typedef struct { typedef struct {
StgHeader header; StgHeader header;
StgWord ptrs; StgWord ptrs;
StgMutClosure *mut_link; /* mutable list */
StgClosure *payload[FLEXIBLE_ARRAY]; StgClosure *payload[FLEXIBLE_ARRAY];
} StgMutArrPtrs; } StgMutArrPtrs;
typedef struct { typedef struct {
StgHeader header; StgHeader header;
StgClosure *var; StgClosure *var;
StgMutClosure *mut_link;
} StgMutVar; } StgMutVar;
typedef struct _StgUpdateFrame { typedef struct _StgUpdateFrame {
...@@ -303,7 +282,6 @@ typedef struct { ...@@ -303,7 +282,6 @@ typedef struct {
typedef struct { typedef struct {
StgHeader header; StgHeader header;
struct StgTSO_ *head; struct StgTSO_ *head;
StgMutClosure *mut_link;
struct StgTSO_ *tail; struct StgTSO_ *tail;
StgClosure* value; StgClosure* value;
} StgMVar; } StgMVar;
...@@ -329,7 +307,6 @@ typedef struct { ...@@ -329,7 +307,6 @@ typedef struct {
typedef struct StgTVarWaitQueue_ { typedef struct StgTVarWaitQueue_ {
StgHeader header; StgHeader header;
struct StgTSO_ *waiting_tso; struct StgTSO_ *waiting_tso;
StgMutClosure *mut_link;
struct StgTVarWaitQueue_ *next_queue_entry; struct StgTVarWaitQueue_ *next_queue_entry;
struct StgTVarWaitQueue_ *prev_queue_entry; struct StgTVarWaitQueue_ *prev_queue_entry;
} StgTVarWaitQueue; } StgTVarWaitQueue;
...@@ -337,7 +314,6 @@ typedef struct StgTVarWaitQueue_ { ...@@ -337,7 +314,6 @@ typedef struct StgTVarWaitQueue_ {
typedef struct { typedef struct {
StgHeader header; StgHeader header;
StgClosure *current_value; StgClosure *current_value;
StgMutClosure *mut_link;
StgTVarWaitQueue *first_wait_queue_entry; StgTVarWaitQueue *first_wait_queue_entry;
} StgTVar; } StgTVar;
...@@ -354,7 +330,6 @@ typedef struct { ...@@ -354,7 +330,6 @@ typedef struct {
typedef struct StgTRecChunk_ { typedef struct StgTRecChunk_ {
StgHeader header; StgHeader header;
struct StgTRecChunk_ *prev_chunk; struct StgTRecChunk_ *prev_chunk;
StgMutClosure *mut_link;
StgWord next_entry_idx; StgWord next_entry_idx;
TRecEntry entries[TREC_CHUNK_NUM_ENTRIES]; TRecEntry entries[TREC_CHUNK_NUM_ENTRIES];
} StgTRecChunk; } StgTRecChunk;
...@@ -371,7 +346,6 @@ typedef enum { ...@@ -371,7 +346,6 @@ typedef enum {
typedef struct StgTRecHeader_ { typedef struct StgTRecHeader_ {
StgHeader header; StgHeader header;
TRecState state; TRecState state;
StgMutClosure *mut_link;
struct StgTRecHeader_ *enclosing_trec; struct StgTRecHeader_ *enclosing_trec;
StgTRecChunk *current_chunk; StgTRecChunk *current_chunk;
} StgTRecHeader; } StgTRecHeader;
...@@ -401,8 +375,7 @@ typedef struct { ...@@ -401,8 +375,7 @@ typedef struct {
of closures that can be found on a blocking queue: StgTSO, StgRBHSave, of closures that can be found on a blocking queue: StgTSO, StgRBHSave,
StgBlockedFetch. (StgRBHSave can only appear at the end of a blocking StgBlockedFetch. (StgRBHSave can only appear at the end of a blocking
queue). Logically, this is a union type, but defining another struct queue). Logically, this is a union type, but defining another struct
with a common layout is easier to handle in the code (same as for with a common layout is easier to handle in the code.
StgMutClosures).
Note that in the standard setup only StgTSOs can be on a blocking queue. Note that in the standard setup only StgTSOs can be on a blocking queue.
This is one of the main reasons for slightly different code in files This is one of the main reasons for slightly different code in files
such as Schedule.c. such as Schedule.c.
...@@ -410,7 +383,6 @@ typedef struct { ...@@ -410,7 +383,6 @@ typedef struct {
typedef struct StgBlockingQueueElement_ { typedef struct StgBlockingQueueElement_ {
StgHeader header; StgHeader header;
struct StgBlockingQueueElement_ *link; /* next elem in BQ */ struct StgBlockingQueueElement_ *link; /* next elem in BQ */
StgMutClosure *mut_link; /* next elem in mutable list */
struct StgClosure_ *payload[FLEXIBLE_ARRAY];/* contents of the closure */ struct StgClosure_ *payload[FLEXIBLE_ARRAY];/* contents of the closure */
} StgBlockingQueueElement; } StgBlockingQueueElement;
...@@ -418,7 +390,6 @@ typedef struct StgBlockingQueueElement_ { ...@@ -418,7 +390,6 @@ typedef struct StgBlockingQueueElement_ {
typedef struct StgBlockingQueue_ { typedef struct StgBlockingQueue_ {
StgHeader header; StgHeader header;
struct StgBlockingQueueElement_ *blocking_queue; /* start of the BQ */ struct StgBlockingQueueElement_ *blocking_queue; /* start of the BQ */
StgMutClosure *mut_link; /* next elem in mutable list */
} StgBlockingQueue; } StgBlockingQueue;
/* this closure is hanging at the end of a blocking queue in (see RBH.c) */ /* this closure is hanging at the end of a blocking queue in (see RBH.c) */
...@@ -430,7 +401,6 @@ typedef struct StgRBHSave_ { ...@@ -430,7 +401,6 @@ typedef struct StgRBHSave_ {
typedef struct StgRBH_ { typedef struct StgRBH_ {
StgHeader header; StgHeader header;
struct StgBlockingQueueElement_ *blocking_queue; /* start of the BQ */ struct StgBlockingQueueElement_ *blocking_queue; /* start of the BQ */
StgMutClosure *mut_link; /* next elem in mutable list */
} StgRBH; } StgRBH;
#else #else
...@@ -438,7 +408,6 @@ typedef struct StgRBH_ { ...@@ -438,7 +408,6 @@ typedef struct StgRBH_ {
typedef struct StgBlockingQueue_ { typedef struct StgBlockingQueue_ {
StgHeader header; StgHeader header;
struct StgTSO_ *blocking_queue; struct StgTSO_ *blocking_queue;
StgMutClosure *mut_link;
} StgBlockingQueue; } StgBlockingQueue;
#endif #endif
...@@ -448,14 +417,12 @@ typedef struct StgBlockingQueue_ { ...@@ -448,14 +417,12 @@ typedef struct StgBlockingQueue_ {
typedef struct StgFetchMe_ { typedef struct StgFetchMe_ {
StgHeader header; StgHeader header;
globalAddr *ga; /* ptr to unique id for a closure */ globalAddr *ga; /* ptr to unique id for a closure */
StgMutClosure *mut_link; /* next elem in mutable list */
} StgFetchMe; } StgFetchMe;
/* same contents as an ordinary StgBlockingQueue */ /* same contents as an ordinary StgBlockingQueue */
typedef struct StgFetchMeBlockingQueue_ { typedef struct StgFetchMeBlockingQueue_ {
StgHeader header; StgHeader header;
struct StgBlockingQueueElement_ *blocking_queue; /* start of the BQ */ struct StgBlockingQueueElement_ *blocking_queue; /* start of the BQ */
StgMutClosure *mut_link; /* next elem in mutable list */
} StgFetchMeBlockingQueue; } StgFetchMeBlockingQueue;
/* This is an entry in a blocking queue. It indicates a fetch request from a /* This is an entry in a blocking queue. It indicates a fetch request from a
...@@ -467,7 +434,6 @@ typedef struct StgFetchMeBlockingQueue_ { ...@@ -467,7 +434,6 @@ typedef struct StgFetchMeBlockingQueue_ {
typedef struct StgBlockedFetch_ { typedef struct StgBlockedFetch_ {
StgHeader header; StgHeader header;
struct StgBlockingQueueElement_ *link; /* next elem in the BQ */ struct StgBlockingQueueElement_ *link; /* next elem in the BQ */
StgMutClosure *mut_link; /* next elem in mutable list */
StgClosure *node; /* node to fetch */ StgClosure *node; /* node to fetch */
globalAddr ga; /* where to send the result to */ globalAddr ga; /* where to send the result to */
} StgBlockedFetch; /* NB: not just a ptr to a GA */ } StgBlockedFetch; /* NB: not just a ptr to a GA */
......
/* ---------------------------------------------------------------------------- /* ----------------------------------------------------------------------------
* $Id: Constants.h,v 1.27 2004/11/18 09:56:19 tharris Exp $ * $Id: Constants.h,v 1.28 2005/02/10 13:02:03 simonmar Exp $
* *
* (c) The GHC Team, 1998-2002 * (c) The GHC Team, 1998-2002
* *
...@@ -21,12 +21,12 @@ ...@@ -21,12 +21,12 @@
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
Minimum closure sizes Minimum closure sizes
Here we define the minimum size for updatable closures. This must be at Here we define the minimum size for updatable closures. All updates
least 2, to allow for cons cells and linked indirections. All updates
will be performed on closures of this size. For non-updatable closures will be performed on closures of this size. For non-updatable closures
the minimum size is 1 to allow for a forwarding pointer. the minimum size is 1 to allow for a forwarding pointer.
Linked indirections are UPD_OLDGEN things: see Closures.h When we used to keep the mutable list threaded through closures on
the heap, MIN_UPD_SIZE used to be 2. Now it's 1.
o MIN_UPD_SIZE doesn't apply to stack closures, static closures o MIN_UPD_SIZE doesn't apply to stack closures, static closures
or non-updateable objects like PAPs or CONSTRs or non-updateable objects like PAPs or CONSTRs
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
o EVACUATED o EVACUATED
-------------------------------------------------------------------------- */ -------------------------------------------------------------------------- */
#define MIN_UPD_SIZE 2 #define MIN_UPD_SIZE 1
#define MIN_NONUPD_SIZE 1 #define MIN_NONUPD_SIZE 1
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
......
...@@ -122,10 +122,10 @@ RTS_INFO(stg_ARR_WORDS_info); ...@@ -122,10 +122,10 @@ RTS_INFO(stg_ARR_WORDS_info);
RTS_INFO(stg_MUT_ARR_WORDS_info); RTS_INFO(stg_MUT_ARR_WORDS_info);
RTS_INFO(stg_MUT_ARR_PTRS_info); RTS_INFO(stg_MUT_ARR_PTRS_info);
RTS_INFO(stg_MUT_ARR_PTRS_FROZEN_info); RTS_INFO(stg_MUT_ARR_PTRS_FROZEN_info);
RTS_INFO(stg_MUT_ARR_PTRS_FROZEN0_info);
RTS_INFO(stg_MUT_VAR_info); RTS_INFO(stg_MUT_VAR_info);
RTS_INFO(stg_END_TSO_QUEUE_info); RTS_INFO(stg_END_TSO_QUEUE_info);
RTS_INFO(stg_MUT_CONS_info); RTS_INFO(stg_MUT_CONS_info);
RTS_INFO(stg_END_MUT_LIST_info);
RTS_INFO(stg_catch_info); RTS_INFO(stg_catch_info);
RTS_INFO(stg_PAP_info); RTS_INFO(stg_PAP_info);
RTS_INFO(stg_AP_info); RTS_INFO(stg_AP_info);
...@@ -185,7 +185,6 @@ RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN_entry); ...@@ -185,7 +185,6 @@ RTS_ENTRY(stg_MUT_ARR_PTRS_FROZEN_entry);
RTS_ENTRY(stg_MUT_VAR_entry); RTS_ENTRY(stg_MUT_VAR_entry);
RTS_ENTRY(stg_END_TSO_QUEUE_entry); RTS_ENTRY(stg_END_TSO_QUEUE_entry);
RTS_ENTRY(stg_MUT_CONS_entry); RTS_ENTRY(stg_MUT_CONS_entry);
RTS_ENTRY(stg_END_MUT_LIST_entry);
RTS_ENTRY(stg_catch_entry); RTS_ENTRY(stg_catch_entry);
RTS_ENTRY(stg_PAP_entry); RTS_ENTRY(stg_PAP_entry);
RTS_ENTRY(stg_AP_entry); RTS_ENTRY(stg_AP_entry);
...@@ -214,7 +213,6 @@ RTS_ENTRY(stg_raise_entry); ...@@ -214,7 +213,6 @@ RTS_ENTRY(stg_raise_entry);
/* closures */ /* closures */
RTS_CLOSURE(stg_END_TSO_QUEUE_closure); RTS_CLOSURE(stg_END_TSO_QUEUE_closure);
RTS_CLOSURE(stg_END_MUT_LIST_closure);
RTS_CLOSURE(stg_NO_FINALIZER_closure); RTS_CLOSURE(stg_NO_FINALIZER_closure);
RTS_CLOSURE(stg_dummy_ret_closure); RTS_CLOSURE(stg_dummy_ret_closure);
RTS_CLOSURE(stg_forceIO_closure); RTS_CLOSURE(stg_forceIO_closure);
......
...@@ -80,11 +80,10 @@ typedef struct _generation { ...@@ -80,11 +80,10 @@ typedef struct _generation {
step * steps; /* steps */ step * steps; /* steps */
unsigned int n_steps; /* number of steps */ unsigned int n_steps; /* number of steps */
unsigned int max_blocks; /* max blocks in step 0 */ unsigned int max_blocks; /* max blocks in step 0 */
StgMutClosure *mut_list; /* mut objects in this gen (not G0)*/ bdescr *mut_list; /* mut objects in this gen (not G0)*/
StgMutClosure *mut_once_list; /* objects that point to younger gens */
/* temporary use during GC: */ /* temporary use during GC: */
StgMutClosure * saved_mut_list;