Bug 1514704 - Attribute initial gray marking time to correct stats phase r=sfink
authorJon Coppeard <jcoppeard@mozilla.com>
Tue, 18 Dec 2018 07:13:59 +0000
changeset 451080 fd169181a978861c157c1befb21f1e189cf745f5
parent 451079 7d6c4bedb93d7606e39810b8efa4df6788d7f264
child 451081 5a568cd944c15ae8c58978f102f2c56a535dd0c7
push id110597
push userjcoppeard@mozilla.com
push dateTue, 18 Dec 2018 07:27:50 +0000
treeherdermozilla-inbound@5a568cd944c1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1514704
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1514704 - Attribute initial gray marking time to correct stats phase r=sfink
js/src/gc/GC.cpp
--- a/js/src/gc/GC.cpp
+++ b/js/src/gc/GC.cpp
@@ -5128,22 +5128,20 @@ void js::gc::DelayCrossCompartmentGrayMa
     }
     obj = NextIncomingCrossCompartmentPointer(obj, false);
   }
   MOZ_ASSERT(found);
 #endif
 }
 
 void GCRuntime::markIncomingCrossCompartmentPointers(MarkColor color) {
-  MOZ_ASSERT(color == MarkColor::Black || color == MarkColor::Gray);
-
-  static const gcstats::PhaseKind statsPhases[] = {
-      gcstats::PhaseKind::SWEEP_MARK_INCOMING_BLACK,
-      gcstats::PhaseKind::SWEEP_MARK_INCOMING_GRAY};
-  gcstats::AutoPhase ap1(stats(), statsPhases[unsigned(color)]);
+  gcstats::AutoPhase ap(
+    stats(),
+    color == MarkColor::Black ? gcstats::PhaseKind::SWEEP_MARK_INCOMING_BLACK
+                              : gcstats::PhaseKind::SWEEP_MARK_INCOMING_GRAY);
 
   bool unlinkList = color == MarkColor::Gray;
 
   for (SweepGroupCompartmentsIter c(rt); !c.done(); c.next()) {
     MOZ_ASSERT(c->zone()->isGCMarking());
     MOZ_ASSERT_IF(color == MarkColor::Gray,
                   c->zone()->isGCMarkingBlackAndGray());
     MOZ_ASSERT_IF(c->gcIncomingGrayPointers,
@@ -5320,17 +5318,17 @@ IncrementalProgress GCRuntime::markGrayR
   hasMarkedGrayRoots = true;
 
 #ifdef JS_GC_ZEAL
   if (shouldYieldForZeal(ZealMode::YieldWhileGrayMarking)) {
     return NotFinished;
   }
 #endif
 
-  return marker.markUntilBudgetExhausted(budget) ? Finished : NotFinished;
+  return markUntilBudgetExhausted(budget, gcstats::PhaseKind::SWEEP_MARK_GRAY);
 }
 
 IncrementalProgress GCRuntime::endMarkingSweepGroup(FreeOp* fop,
                                                     SliceBudget& budget) {
   MOZ_ASSERT(marker.markColor() == MarkColor::Black);
   MOZ_ASSERT(!HasIncomingCrossCompartmentPointers(rt));
 
   gcstats::AutoPhase ap(stats(), gcstats::PhaseKind::SWEEP_MARK);