зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1204169 - Push SPS pseudo frame entries when GCing; r=terrence
This commit is contained in:
Родитель
100b3d6563
Коммит
c0d3a62244
|
@ -56,6 +56,7 @@ class MOZ_RAII AutoTraceSession
|
|||
void operator=(const AutoTraceSession&) = delete;
|
||||
|
||||
JS::HeapState prevState;
|
||||
AutoSPSEntry pseudoFrame;
|
||||
};
|
||||
|
||||
struct MOZ_RAII AutoPrepareForTracing
|
||||
|
|
|
@ -5580,11 +5580,29 @@ GCRuntime::finishCollection(JS::gcreason::Reason reason)
|
|||
}
|
||||
}
|
||||
|
||||
static const char*
|
||||
HeapStateToLabel(JS::HeapState heapState)
|
||||
{
|
||||
switch (heapState) {
|
||||
case JS::HeapState::MinorCollecting:
|
||||
return "js::Nursery::collect";
|
||||
case JS::HeapState::MajorCollecting:
|
||||
return "js::GCRuntime::collect";
|
||||
case JS::HeapState::Tracing:
|
||||
return "JS_IterateCompartments";
|
||||
case JS::HeapState::Idle:
|
||||
MOZ_CRASH("Should never have an Idle heap state when pushing GC pseudo frames!");
|
||||
}
|
||||
MOZ_ASSERT_UNREACHABLE("Should have exhausted every JS::HeapState variant!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* Start a new heap session. */
|
||||
AutoTraceSession::AutoTraceSession(JSRuntime* rt, JS::HeapState heapState)
|
||||
: lock(rt),
|
||||
runtime(rt),
|
||||
prevState(rt->heapState_)
|
||||
prevState(rt->heapState_),
|
||||
pseudoFrame(rt, HeapStateToLabel(heapState), ProfileEntry::Category::GC)
|
||||
{
|
||||
MOZ_ASSERT(rt->heapState_ == JS::HeapState::Idle);
|
||||
MOZ_ASSERT(heapState != JS::HeapState::Idle);
|
||||
|
|
Загрузка…
Ссылка в новой задаче