Eliminate zero_static_objects_list()

Authored by simonmar on Jul 28 2015, 6:46 AM.



[Revised version of D1076 that was committed and then backed out]

In a workload with a large amount of code, zero_static_objects_list()
takes a significant amount of time, and furthermore it is in the
single-threaded part of the GC.

This patch uses a slightly fiddly scheme for marking objects on the
static object lists, using a flag in the low 2 bits that flips between
two states to indicate whether an object has been visited during this
GC or not. We also have to take into account objects that have not
been visited yet, which might appear at any time due to runtime linking.

Test Plan


Diff Detail

rGHC Glasgow Haskell Compiler
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
simonmar updated this revision to Diff 3688.Jul 28 2015, 6:46 AM
simonmar retitled this revision from to Eliminate zero_static_objects_list().
simonmar updated this object.
simonmar edited the test plan for this revision. (Show Details)
simonmar added reviewers: austin, bgamari, ezyang, rwbarton.
simonmar added a subscriber: thomie.
simonmar added inline comments.Jul 28 2015, 6:47 AM

incorporating @bgamari's fix here


this is the fix for the ghci test failures with DYNAMIC_GHC_PROGRAMS=NO

bgamari accepted this revision.Jul 28 2015, 8:19 AM
bgamari edited edge metadata.

This looks good to me.


Ahh, another one. Very good.

This revision is now accepted and ready to land.Jul 28 2015, 8:19 AM
thomie accepted this revision.Jul 28 2015, 8:52 AM
thomie added a reviewer: thomie.

It validates on Travis.

This revision was automatically updated to reflect the committed changes.