Bug 1462784 - Merge GC and CC categories into one category. r?njn
They're very similar as far as most users of the profiler are concerned, I'd
say, and I don't believe it's worth giving them two different colors in the
activity graphs.
MozReview-Commit-ID: HTqjp56naL3
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -1234,17 +1234,17 @@ nsDOMWindowUtils::GetWidgetForElement(El
}
return nullptr;
}
NS_IMETHODIMP
nsDOMWindowUtils::GarbageCollect(nsICycleCollectorListener *aListener)
{
- AUTO_PROFILER_LABEL("nsDOMWindowUtils::GarbageCollect", GC);
+ AUTO_PROFILER_LABEL("nsDOMWindowUtils::GarbageCollect", GCCC);
nsJSContext::GarbageCollectNow(JS::gcreason::DOM_UTILS);
nsJSContext::CycleCollectNow(aListener);
return NS_OK;
}
NS_IMETHODIMP
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -1173,17 +1173,17 @@ FullGCTimerFired(nsITimer* aTimer, void*
//static
void
nsJSContext::GarbageCollectNow(JS::gcreason::Reason aReason,
IsIncremental aIncremental,
IsShrinking aShrinking,
int64_t aSliceMillis)
{
- AUTO_PROFILER_LABEL_DYNAMIC_CSTR("nsJSContext::GarbageCollectNow", GC,
+ AUTO_PROFILER_LABEL_DYNAMIC_CSTR("nsJSContext::GarbageCollectNow", GCCC,
JS::gcreason::ExplainReason(aReason));
MOZ_ASSERT_IF(aSliceMillis, aIncremental == IncrementalGC);
KillGCTimer();
// Reset sPendingLoadCount in case the timer that fired was a
// timer we scheduled due to a normal GC timer firing while
@@ -1226,17 +1226,17 @@ nsJSContext::GarbageCollectNow(JS::gcrea
} else {
JS::NonIncrementalGC(cx, gckind, aReason);
}
}
static void
FinishAnyIncrementalGC()
{
- AUTO_PROFILER_LABEL("FinishAnyIncrementalGC", GC);
+ AUTO_PROFILER_LABEL("FinishAnyIncrementalGC", GCCC);
if (sCCLockedOut) {
AutoJSAPI jsapi;
jsapi.Init();
// We're in the middle of an incremental GC, so finish it.
JS::PrepareForIncrementalGC(jsapi.cx());
JS::FinishIncrementalGC(jsapi.cx(), JS::gcreason::CC_FORCED);
@@ -1477,34 +1477,34 @@ CycleCollectorStats::RunForgetSkippable(
//static
void
nsJSContext::CycleCollectNow(nsICycleCollectorListener *aListener)
{
if (!NS_IsMainThread()) {
return;
}
- AUTO_PROFILER_LABEL("nsJSContext::CycleCollectNow", CC);
+ AUTO_PROFILER_LABEL("nsJSContext::CycleCollectNow", GCCC);
gCCStats.PrepareForCycleCollectionSlice(TimeStamp());
nsCycleCollector_collect(aListener);
gCCStats.FinishCycleCollectionSlice();
}
//static
void
nsJSContext::RunCycleCollectorSlice(TimeStamp aDeadline)
{
if (!NS_IsMainThread()) {
return;
}
AUTO_PROFILER_TRACING("CC", aDeadline.IsNull() ? "CCSlice" : "IdleCCSlice");
- AUTO_PROFILER_LABEL("nsJSContext::RunCycleCollectorSlice", CC);
+ AUTO_PROFILER_LABEL("nsJSContext::RunCycleCollectorSlice", GCCC);
gCCStats.PrepareForCycleCollectionSlice(aDeadline);
// Decide how long we want to budget for this slice. By default,
// use an unlimited budget.
js::SliceBudget budget = js::SliceBudget::unlimited();
if (sIncrementalCC) {
@@ -1552,17 +1552,17 @@ nsJSContext::RunCycleCollectorSlice(Time
//static
void
nsJSContext::RunCycleCollectorWorkSlice(int64_t aWorkBudget)
{
if (!NS_IsMainThread()) {
return;
}
- AUTO_PROFILER_LABEL("nsJSContext::RunCycleCollectorWorkSlice", CC);
+ AUTO_PROFILER_LABEL("nsJSContext::RunCycleCollectorWorkSlice", GCCC);
gCCStats.PrepareForCycleCollectionSlice();
js::SliceBudget budget = js::SliceBudget(js::WorkBudget(aWorkBudget));
nsCycleCollector_collectSlice(budget);
gCCStats.FinishCycleCollectionSlice();
}
--- a/js/public/ProfilingStack.h
+++ b/js/public/ProfilingStack.h
@@ -188,18 +188,17 @@ class ProfilingStackFrame
KIND_MASK = (1 << KIND_BITCOUNT) - 1
};
// Keep these in sync with devtools/client/performance/modules/categories.js
enum class Category : uint32_t {
OTHER,
CSS,
JS,
- GC,
- CC,
+ GCCC,
NETWORK,
GRAPHICS,
STORAGE,
EVENTS,
FIRST = OTHER,
LAST = EVENTS,
};
--- a/js/src/gc/GC.cpp
+++ b/js/src/gc/GC.cpp
@@ -6818,17 +6818,17 @@ HeapStateToLabel(JS::HeapState heapState
return nullptr;
}
/* Start a new heap session. */
AutoTraceSession::AutoTraceSession(JSRuntime* rt, JS::HeapState heapState)
: runtime(rt),
prevState(rt->mainContextFromOwnThread()->heapState),
profilingStackFrame(rt->mainContextFromOwnThread(), HeapStateToLabel(heapState),
- ProfilingStackFrame::Category::GC)
+ ProfilingStackFrame::Category::GCCC)
{
MOZ_ASSERT(prevState == JS::HeapState::Idle);
MOZ_ASSERT(heapState != JS::HeapState::Idle);
MOZ_ASSERT_IF(heapState == JS::HeapState::MajorCollecting, rt->gc.nursery().isEmpty());
// Session always begins with lock held, see comment in class definition.
maybeLock.emplace(rt);
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -4257,17 +4257,17 @@ nsCycleCollector_forgetSkippable(js::Sli
bool aAsyncSnowWhiteFreeing)
{
CollectorData* data = sCollectorData.get();
// We should have started the cycle collector by now.
MOZ_ASSERT(data);
MOZ_ASSERT(data->mCollector);
- AUTO_PROFILER_LABEL("nsCycleCollector_forgetSkippable", CC);
+ AUTO_PROFILER_LABEL("nsCycleCollector_forgetSkippable", GCCC);
TimeLog timeLog;
data->mCollector->ForgetSkippable(aBudget,
aRemoveChildlessNodes,
aAsyncSnowWhiteFreeing);
timeLog.Checkpoint("ForgetSkippable()");
}
@@ -4304,33 +4304,33 @@ void
nsCycleCollector_collect(nsICycleCollectorListener* aManualListener)
{
CollectorData* data = sCollectorData.get();
// We should have started the cycle collector by now.
MOZ_ASSERT(data);
MOZ_ASSERT(data->mCollector);
- AUTO_PROFILER_LABEL("nsCycleCollector_collect", CC);
+ AUTO_PROFILER_LABEL("nsCycleCollector_collect", GCCC);
SliceBudget unlimitedBudget = SliceBudget::unlimited();
data->mCollector->Collect(ManualCC, unlimitedBudget, aManualListener);
}
void
nsCycleCollector_collectSlice(SliceBudget& budget,
bool aPreferShorterSlices)
{
CollectorData* data = sCollectorData.get();
// We should have started the cycle collector by now.
MOZ_ASSERT(data);
MOZ_ASSERT(data->mCollector);
- AUTO_PROFILER_LABEL("nsCycleCollector_collectSlice", CC);
+ AUTO_PROFILER_LABEL("nsCycleCollector_collectSlice", GCCC);
data->mCollector->Collect(SliceCC, budget, nullptr, aPreferShorterSlices);
}
void
nsCycleCollector_prepareForGarbageCollection()
{
CollectorData* data = sCollectorData.get();
@@ -4360,17 +4360,17 @@ nsCycleCollector_finishAnyCurrentCollect
void
nsCycleCollector_shutdown(bool aDoCollect)
{
CollectorData* data = sCollectorData.get();
if (data) {
MOZ_ASSERT(data->mCollector);
- AUTO_PROFILER_LABEL("nsCycleCollector_shutdown", CC);
+ AUTO_PROFILER_LABEL("nsCycleCollector_shutdown", OTHER);
if (gMainThreadCollector == data->mCollector) {
gMainThreadCollector = nullptr;
}
data->mCollector->Shutdown(aDoCollect);
data->mCollector = nullptr;
if (data->mContext) {
// Run any remaining tasks that may have been enqueued via