Add a proper write barrier for MVars
authorSimon Marlow <simonmar@microsoft.com>
Thu, 11 Oct 2007 13:55:05 +0000 (13:55 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Thu, 11 Oct 2007 13:55:05 +0000 (13:55 +0000)
commit1ed01a871030f05905a9595e4837dfffc087ef64
tree32c1335b52d0ec28d6a99d4ccaeae6a36a73bddc
parent53d57aa3aa498120eb1beba1b9c30e6a5e4e2d0a
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.
20 files changed:
includes/ClosureTypes.h
includes/RtsExternal.h
includes/StgMiscClosures.h
rts/ClosureFlags.c
rts/HeapStackCheck.cmm
rts/LdvProfile.c
rts/Linker.c
rts/PrimOps.cmm
rts/Printer.c
rts/ProfHeap.c
rts/RaiseAsync.c
rts/RetainerProfile.c
rts/Sanity.c
rts/StgMiscClosures.cmm
rts/sm/Compact.c
rts/sm/Evac.c
rts/sm/GC.c
rts/sm/GC.h
rts/sm/Scav.c
rts/sm/Storage.c