diff options
author | Simon Marlow <simonmar@microsoft.com> | 2007-10-11 13:55:05 +0000 |
---|---|---|
committer | Simon Marlow <simonmar@microsoft.com> | 2007-10-11 13:55:05 +0000 |
commit | 1ed01a871030f05905a9595e4837dfffc087ef64 (patch) | |
tree | 32c1335b52d0ec28d6a99d4ccaeae6a36a73bddc /rts/HeapStackCheck.cmm | |
parent | 53d57aa3aa498120eb1beba1b9c30e6a5e4e2d0a (diff) | |
download | haskell-1ed01a871030f05905a9595e4837dfffc087ef64.tar.gz |
Add a proper write barrier for MVars
Previously MVars were always on the mutable list of the old
generation, which meant every MVar was visited during every minor GC.
With lots of MVars hanging around, this gets expensive. We addressed
this problem for MUT_VARs (aka IORefs) a while ago, the solution is to
use a traditional GC write-barrier when the object is modified. This
patch does the same thing for MVars.
TVars are still done the old way, they could probably benefit from the
same treatment too.
Diffstat (limited to 'rts/HeapStackCheck.cmm')
-rw-r--r-- | rts/HeapStackCheck.cmm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/rts/HeapStackCheck.cmm b/rts/HeapStackCheck.cmm index 5b21ee1da1..333d0c09e0 100644 --- a/rts/HeapStackCheck.cmm +++ b/rts/HeapStackCheck.cmm @@ -827,7 +827,9 @@ INFO_TABLE_RET( stg_block_takemvar, RET_SMALL, "ptr" W_ unused ) stg_block_takemvar_finally { #ifdef THREADED_RTS - unlockClosure(R3, stg_EMPTY_MVAR_info); + unlockClosure(R3, stg_MVAR_DIRTY_info); +#else + SET_INFO(R3, stg_MVAR_DIRTY_info); #endif jump StgReturn; } @@ -853,7 +855,9 @@ INFO_TABLE_RET( stg_block_putmvar, RET_SMALL, "ptr" W_ unused1, "ptr" W_ unused2 stg_block_putmvar_finally { #ifdef THREADED_RTS - unlockClosure(R3, stg_FULL_MVAR_info); + unlockClosure(R3, stg_MVAR_DIRTY_info); +#else + SET_INFO(R3, stg_MVAR_DIRTY_info); #endif jump StgReturn; } |