simonmar 2006/01/17 08:03:47 PST
Modified files:
ghc/compiler/cmm CLabel.hs
ghc/compiler/codeGen CgPrimOp.hs
ghc/includes ClosureTypes.h StgMiscClosures.h
ghc/rts ClosureFlags.c GC.c GCCompact.c
LdvProfile.c PrimOps.cmm Printer.c
ProfHeap.c RetainerProfile.c Sanity.c
StgMiscClosures.cmm
Log:
Improve the GC behaviour of IOArrays/STArrays
See Ticket #650
This is a small change to the way mutable arrays interact with the GC,
that can have a dramatic effect on performance, and make tricks with
unsafeThaw/unsafeFreeze redundant. Data.HashTable should be faster
now (I haven't measured it yet).
We now have two mutable array closure types, MUT_ARR_PTRS_CLEAN and
MUT_ARR_PTRS_DIRTY. Both are on the mutable list if the array is in
an old generation. writeArray# sets the type to MUT_ARR_PTRS_DIRTY.
The garbage collector can set the type to MUT_ARR_PTRS_CLEAN if it
finds that no element of the array points into a younger generation
(discovering this required a small addition to evacuate(), but rough
tests indicate that it doesn't measurably affect performance).
NOTE: none of this affects unboxed arrays (IOUArray/STUArray), only
boxed arrays (IOArray/STArray).
We could go further and extend the DIRTY bit to be per-block rather
than for the whole array, but for now this is an easy improvement.
Revision Changes Path
1.20 +2 -0 fptools/ghc/compiler/cmm/CLabel.hs
1.10 +3 -2 fptools/ghc/compiler/codeGen/CgPrimOp.hs
1.26 +22 -21 fptools/ghc/includes/ClosureTypes.h
1.68 +4 -2 fptools/ghc/includes/StgMiscClosures.h
1.19 +3 -2 fptools/ghc/rts/ClosureFlags.c
1.212 +93 -36 fptools/ghc/rts/GC.c
1.39 +6 -3 fptools/ghc/rts/GCCompact.c
1.15 +2 -1 fptools/ghc/rts/LdvProfile.c
1.42 +3 -3 fptools/ghc/rts/PrimOps.cmm
1.77 +6 -2 fptools/ghc/rts/Printer.c
1.69 +4 -2 fptools/ghc/rts/ProfHeap.c
1.27 +8 -4 fptools/ghc/rts/RetainerProfile.c
1.51 +2 -1 fptools/ghc/rts/Sanity.c
1.11 +5 -2 fptools/ghc/rts/StgMiscClosures.cmm
_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc