Backed out changeset d50a04c82343 (bug 1306249)

This commit is contained in:
Sebastian Hengst 2016-10-15 10:27:36 +02:00
parent 98c145b965
commit bded0366f6

View File

@ -918,42 +918,17 @@ SumPhase(Phase phase, const Statistics::PhaseTimeTable times)
}
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;
}
@ -1104,7 +1079,7 @@ Statistics::endSlice()
// 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);
}
}