summaryrefslogtreecommitdiff
path: root/ghc/compiler/cmm
diff options
context:
space:
mode:
authorsimonmar <unknown>2006-01-17 16:13:18 +0000
committersimonmar <unknown>2006-01-17 16:13:18 +0000
commit91b07216be1cb09230b7d1b417899ddea8620ff3 (patch)
tree03ef770091e4483ad049112ccf81cb12ed9844b4 /ghc/compiler/cmm
parentda69fa9c5047c5b0d05bdb05eaddefa1eb5d5a36 (diff)
downloadhaskell-91b07216be1cb09230b7d1b417899ddea8620ff3.tar.gz
[project @ 2006-01-17 16:13:18 by simonmar]
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
Diffstat (limited to 'ghc/compiler/cmm')
-rw-r--r--ghc/compiler/cmm/CLabel.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/ghc/compiler/cmm/CLabel.hs b/ghc/compiler/cmm/CLabel.hs
index ca818cbad6..6216d38e0e 100644
--- a/ghc/compiler/cmm/CLabel.hs
+++ b/ghc/compiler/cmm/CLabel.hs
@@ -46,6 +46,7 @@ module CLabel (
mkPlainModuleInitLabel,
mkSplitMarkerLabel,
+ mkDirty_MUT_VAR_Label,
mkUpdInfoLabel,
mkSeqInfoLabel,
mkIndStaticInfoLabel,
@@ -343,6 +344,7 @@ mkPlainModuleInitLabel hmods mod
-- Some fixed runtime system labels
mkSplitMarkerLabel = RtsLabel (RtsCode SLIT("__stg_split_marker"))
+mkDirty_MUT_VAR_Label = RtsLabel (RtsCode SLIT("dirty_MUT_VAR"))
mkUpdInfoLabel = RtsLabel (RtsInfo SLIT("stg_upd_frame"))
mkSeqInfoLabel = RtsLabel (RtsInfo SLIT("stg_seq_frame"))
mkIndStaticInfoLabel = RtsLabel (RtsInfo SLIT("stg_IND_STATIC"))