simonmar 2006/01/17 08:13:18 PST
Modified files:
ghc/compiler/cmm CLabel.hs
ghc/compiler/codeGen CgPrimOp.hs
ghc/includes ClosureTypes.h RtsExternal.h
StgMiscClosures.h Storage.h
ghc/rts ClosureFlags.c GC.c GCCompact.c
LdvProfile.c PrimOps.cmm Printer.c
ProfHeap.c RetainerProfile.c Sanity.c
StgMiscClosures.cmm Storage.c
Log:
Improve the GC behaviour of IORefs (see Ticket #650).
This is a small change to the way IORefs interact with the GC, which
should improve GC performance for programs with plenty of IORefs.
Previously we had a single closure type for mutable variables,
MUT_VAR. Mutable variables were *always* on the mutable list in older
generations, and always traversed on every GC.
Now, we have two closure types: MUT_VAR_CLEAN and MUT_VAR_DIRTY. The
latter is on the mutable list, but the former is not. (NB. this
differs from MUT_ARR_PTRS_CLEAN and MUT_ARR_PTRS_DIRTY, both of which
are on the mutable list). writeMutVar# now implements a write
barrier, by calling dirty_MUT_VAR() in the runtime, that does the
necessary modification of MUT_VAR_CLEAN into MUT_VAR_DIRY, and adding
to the mutable list if necessary.
This results in some pretty dramatic speedups for GHC itself. I've
just measureed a 30% overall speedup compiling a 31-module program
(anna) with the default heap settings :-D
Revision Changes Path
1.21 +2 -0 fptools/ghc/compiler/cmm/CLabel.hs
1.11 +11 -2 fptools/ghc/compiler/codeGen/CgPrimOp.hs
1.27 +19 -18 fptools/ghc/includes/ClosureTypes.h
1.15 +1 -0 fptools/ghc/includes/RtsExternal.h
1.69 +4 -2 fptools/ghc/includes/StgMiscClosures.h
1.20 +9 -0 fptools/ghc/includes/Storage.h
1.20 +3 -2 fptools/ghc/rts/ClosureFlags.c
1.213 +45 -14 fptools/ghc/rts/GC.c
1.40 +2 -1 fptools/ghc/rts/GCCompact.c
1.16 +2 -1 fptools/ghc/rts/LdvProfile.c
1.43 +3 -2 fptools/ghc/rts/PrimOps.cmm
1.78 +13 -4 fptools/ghc/rts/Printer.c
1.70 +4 -2 fptools/ghc/rts/ProfHeap.c
1.28 +8 -4 fptools/ghc/rts/RetainerProfile.c
1.52 +2 -1 fptools/ghc/rts/Sanity.c
1.12 +4 -2 fptools/ghc/rts/StgMiscClosures.cmm
1.109 +16 -0 fptools/ghc/rts/Storage.c
_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc