Backed out changeset d50a04c82343 (bug 1306249)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Sat, 15 Oct 2016 10:27:36 +0200
changeset 318156 fea2dc883057d88fc6ae52b7fadcc07e6ab0e5bd
parent 318155 a7037a607016fb1727b3fd7194910a7ec5197715
child 318157 44a0d38f40e60ddfc4d9b867d35c8b570f1fa704
push id33211
push usercbook@mozilla.com
push dateMon, 17 Oct 2016 09:38:38 +0000
treeherderautoland@e4ef6fa03aa8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1306249
milestone52.0a1
backs outd50a04c82343a9fa10bbbb905170c903dac2a197
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
Backed out changeset d50a04c82343 (bug 1306249)
js/src/gc/Statistics.cpp
--- a/js/src/gc/Statistics.cpp
+++ b/js/src/gc/Statistics.cpp
@@ -913,52 +913,27 @@ SumPhase(Phase phase, const Statistics::
 {
     int64_t sum = 0;
     for (auto i : MakeRange(Statistics::NumTimingArrays))
         sum += times[i][phase];
     return sum;
 }
 
 static Phase
-LongestPhaseSelfTime(const Statistics::PhaseTimeTable times)
+LongestPhase(const Statistics::PhaseTimeTable times)
 {
-    int64_t selfTimes[PHASE_LIMIT];
-
-    // Start with total times, including children's times.
-    for (size_t i = 0; i < PHASE_LIMIT; ++i)
-        selfTimes[i] = SumPhase(Phase(i), times);
-
-    // Subtract out the children's times.
-    for (size_t i = 0; i < PHASE_LIMIT; ++i) {
-        Phase parent = phases[i].parent;
-        if (parent == PHASE_MULTI_PARENTS) {
-            // Subtract out only the time for the children specific to this
-            // parent.
-            for (auto edge : dagChildEdges) {
-                if (edge.parent == parent) {
-                    size_t dagSlot = phaseExtra[edge.parent].dagSlot;
-                    MOZ_ASSERT(selfTimes[parent] >= times[dagSlot][edge.child]);
-                    selfTimes[parent] -= times[dagSlot][edge.child];
-                }
-            }
-        } else if (parent != PHASE_NO_PARENT) {
-            MOZ_ASSERT(selfTimes[parent] >= selfTimes[i]);
-            selfTimes[parent] -= selfTimes[i];
-        }
-    }
-
     int64_t longestTime = 0;
     Phase longestPhase = PHASE_NONE;
     for (size_t i = 0; i < PHASE_LIMIT; ++i) {
-        if (selfTimes[i] > longestTime) {
-            longestTime = selfTimes[i];
+        int64_t phaseTime = SumPhase(Phase(i), times);
+        if (phaseTime > longestTime) {
+            longestTime = phaseTime;
             longestPhase = Phase(i);
         }
     }
-
     return longestPhase;
 }
 
 void
 Statistics::printStats()
 {
     if (aborted) {
         fprintf(fp, "OOM during GC statistics collection. The report is unavailable for this GC.\n");
@@ -1099,17 +1074,17 @@ Statistics::endSlice()
         if (slices.back().budget.isTimeBudget()) {
             int64_t budget_ms = slices.back().budget.timeBudget.budget;
             runtime->addTelemetry(JS_TELEMETRY_GC_BUDGET_MS, budget_ms);
             if (budget_ms == runtime->gc.defaultSliceBudget())
                 runtime->addTelemetry(JS_TELEMETRY_GC_ANIMATION_MS, t(sliceTime));
 
             // Record any phase that goes more than 2x over its budget.
             if (sliceTime > 2 * budget_ms * 1000) {
-                Phase longest = LongestPhaseSelfTime(slices.back().phaseTimes);
+                Phase longest = LongestPhase(slices.back().phaseTimes);
                 runtime->addTelemetry(JS_TELEMETRY_GC_SLOW_PHASE, phases[longest].telemetryBucket);
             }
         }
 
         sliceCount_++;
     }
 
     bool last = !runtime->gc.isIncrementalGCInProgress();