Bug 1322560 - Inject detailed GC timing info into profiles, r=mstange

This commit is contained in:
Steve Fink
2017-05-02 16:13:49 -07:00
parent 0155a00a45
commit ccdbf25343
5 changed files with 97 additions and 0 deletions

View File

@@ -828,6 +828,22 @@ CycleCollectedJSRuntime::GCSliceCallback(JSContext* aContext,
CycleCollectedJSRuntime* self = CycleCollectedJSRuntime::Get();
MOZ_ASSERT(CycleCollectedJSContext::Get()->Context() == aContext);
#ifdef MOZ_GECKO_PROFILER
if (profiler_is_active()) {
if (aProgress == JS::GC_CYCLE_END) {
auto payload = new GCSliceMarkerPayload(aDesc.lastSliceStart(aContext),
aDesc.lastSliceEnd(aContext),
aDesc.sliceToJSON(aContext));
PROFILER_MARKER_PAYLOAD("GCSlice", payload);
} else if (aProgress == JS::GC_SLICE_END) {
auto payload = new GCMajorMarkerPayload(aDesc.startTime(aContext),
aDesc.endTime(aContext),
aDesc.summaryToJSON(aContext));
PROFILER_MARKER_PAYLOAD("GCMajor", payload);
}
}
#endif
if (aProgress == JS::GC_CYCLE_END) {
JS::gcreason::Reason reason = aDesc.reason_;
Unused <<