rts: retainer: Move actual 'flip' bit flip to generic traversal code
authorDaniel Gröber <dxld@darkboxed.org>
Tue, 16 Jul 2019 13:59:34 +0000 (15:59 +0200)
committerDaniel Gröber <dxld@darkboxed.org>
Sun, 22 Sep 2019 13:18:10 +0000 (15:18 +0200)
rts/RetainerProfile.c

index 32ea549..7e16926 100644 (file)
@@ -1450,6 +1450,9 @@ traverseWorkStack(traverseState *ts, visitClosure_cb visit_cb)
     stackData data, child_data;
     StgWord typeOfc;
 
+    // Now we flip the flip bit.
+    flip = flip ^ 1;
+
     // c = Current closure                           (possibly tagged)
     // cp = Current closure's Parent                 (NOT tagged)
     // data = current closures' associated data      (NOT tagged)
@@ -1696,6 +1699,8 @@ computeRetainerSet( traverseState *ts )
     // Remember old stable name addresses.
     rememberOldStableNameAddresses ();
 
+
+    // TODO: Move this code to traverseWorkStack
     // The following code resets the rs field of each unvisited mutable
     // object.
     for (g = 0; g < RtsFlags.GcFlags.generations; g++) {
@@ -1796,9 +1801,6 @@ retainerProfile(void)
 {
   stat_startRP();
 
-  // Now we flips flip.
-  flip = flip ^ 1;
-
   numObjectVisited = 0;
   timesAnyObjectVisited = 0;