summaryrefslogtreecommitdiff
path: root/rts/sm/GCAux.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2015-07-28 20:58:25 +0100
committerSimon Marlow <marlowsd@gmail.com>2015-07-28 20:58:35 +0100
commitf83aab95f59ae9b29f22fc7924e050512229cb9c (patch)
tree2f03ed82c7122f373da774148e3c806aa1dbcae8 /rts/sm/GCAux.c
parenta1dd7dd6ea276832aef0caaf805f0ab9f4e16262 (diff)
downloadhaskell-f83aab95f59ae9b29f22fc7924e050512229cb9c.tar.gz
Eliminate zero_static_objects_list()
Summary: [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: validate Reviewers: austin, ezyang, rwbarton, bgamari, thomie Reviewed By: bgamari, thomie Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1106
Diffstat (limited to 'rts/sm/GCAux.c')
-rw-r--r--rts/sm/GCAux.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/rts/sm/GCAux.c b/rts/sm/GCAux.c
index 13316e4d29..174ddcf57e 100644
--- a/rts/sm/GCAux.c
+++ b/rts/sm/GCAux.c
@@ -118,14 +118,15 @@ revertCAFs( void )
StgIndStatic *c;
for (c = revertible_caf_list;
- c != (StgIndStatic *)END_OF_STATIC_LIST;
+ c != (StgIndStatic *)END_OF_CAF_LIST;
c = (StgIndStatic *)c->static_link)
{
+ c = (StgIndStatic *)UNTAG_STATIC_LIST_PTR(c);
SET_INFO((StgClosure *)c, c->saved_info);
c->saved_info = NULL;
// could, but not necessary: c->static_link = NULL;
}
- revertible_caf_list = (StgIndStatic*)END_OF_STATIC_LIST;
+ revertible_caf_list = (StgIndStatic*)END_OF_CAF_LIST;
}
void
@@ -134,15 +135,17 @@ markCAFs (evac_fn evac, void *user)
StgIndStatic *c;
for (c = dyn_caf_list;
- c != (StgIndStatic*)END_OF_STATIC_LIST;
+ c != (StgIndStatic*)END_OF_CAF_LIST;
c = (StgIndStatic *)c->static_link)
{
+ c = (StgIndStatic *)UNTAG_STATIC_LIST_PTR(c);
evac(user, &c->indirectee);
}
for (c = revertible_caf_list;
- c != (StgIndStatic*)END_OF_STATIC_LIST;
+ c != (StgIndStatic*)END_OF_CAF_LIST;
c = (StgIndStatic *)c->static_link)
{
+ c = (StgIndStatic *)UNTAG_STATIC_LIST_PTR(c);
evac(user, &c->indirectee);
}
}