Eliminate zero_static_objects_list()
authorSimon Marlow <marlowsd@gmail.com>
Thu, 16 Jul 2015 14:01:49 +0000 (15:01 +0100)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 22 Jul 2015 16:34:44 +0000 (17:34 +0100)
commitb949c96b4960168a3b399fe14485b24a2167b982
tree16cc7295237eba92b5e2ba6efae6c50c2e7fe8e1
parent1b76997dba5c35ee956960e1948ee247dc57c500
Eliminate zero_static_objects_list()

Summary:
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: validate

Reviewers: austin, bgamari, ezyang, rwbarton

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1076
12 files changed:
compiler/codeGen/StgCmmHeap.hs
rts/CheckUnload.c
rts/RetainerProfile.c
rts/sm/Compact.c
rts/sm/Evac.c
rts/sm/GC.c
rts/sm/GCAux.c
rts/sm/GCThread.h
rts/sm/Sanity.c
rts/sm/Scav.c
rts/sm/Storage.c
rts/sm/Storage.h