зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1496623 - Rename and comment GeckoProfilerThread::installed() r=njn
--HG-- extra : rebase_source : 2478d8e26f702c9bdbd933a18e36df5232353dc8 extra : histedit_source : 95df9357a34d2c3b1a96856d2df0f63de407e4cc
This commit is contained in:
Родитель
2a3a5dac4b
Коммит
6485ea0dfe
|
@ -474,12 +474,16 @@ class GeckoProfilerThread
|
||||||
public:
|
public:
|
||||||
GeckoProfilerThread();
|
GeckoProfilerThread();
|
||||||
|
|
||||||
uint32_t stackPointer() { MOZ_ASSERT(installed()); return profilingStack_->stackPointer; }
|
uint32_t stackPointer() { MOZ_ASSERT(infraInstalled()); return profilingStack_->stackPointer; }
|
||||||
ProfilingStackFrame* stack() { return profilingStack_->frames; }
|
ProfilingStackFrame* stack() { return profilingStack_->frames; }
|
||||||
ProfilingStack* getProfilingStack() { return profilingStack_; }
|
ProfilingStack* getProfilingStack() { return profilingStack_; }
|
||||||
|
|
||||||
/* management of whether instrumentation is on or off */
|
/*
|
||||||
bool installed() { return profilingStack_ != nullptr; }
|
* True if the profiler infrastructure is setup. Should be true in builds
|
||||||
|
* that include profiler support except during early startup or late
|
||||||
|
* shutdown. Unrelated to the presence of the Gecko Profiler addon.
|
||||||
|
*/
|
||||||
|
bool infraInstalled() { return profilingStack_ != nullptr; }
|
||||||
|
|
||||||
void setProfilingStack(ProfilingStack* profilingStack);
|
void setProfilingStack(ProfilingStack* profilingStack);
|
||||||
void trace(JSTracer* trc);
|
void trace(JSTracer* trc);
|
||||||
|
|
|
@ -3820,7 +3820,7 @@ EvalInContext(JSContext* cx, unsigned argc, Value* vp)
|
||||||
static bool
|
static bool
|
||||||
EnsureGeckoProfilingStackInstalled(JSContext* cx, ShellContext* sc)
|
EnsureGeckoProfilingStackInstalled(JSContext* cx, ShellContext* sc)
|
||||||
{
|
{
|
||||||
if (cx->geckoProfiler().installed()) {
|
if (cx->geckoProfiler().infraInstalled()) {
|
||||||
MOZ_ASSERT(sc->geckoProfilingStack);
|
MOZ_ASSERT(sc->geckoProfilingStack);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,7 @@ GeckoProfilerEntryMarker::GeckoProfilerEntryMarker(JSContext* cx,
|
||||||
: profiler_(&cx->geckoProfiler())
|
: profiler_(&cx->geckoProfiler())
|
||||||
{
|
{
|
||||||
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
|
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
|
||||||
if (MOZ_LIKELY(!profiler_->installed())) {
|
if (MOZ_LIKELY(!profiler_->infraInstalled())) {
|
||||||
profiler_ = nullptr;
|
profiler_ = nullptr;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ AutoGeckoProfilerEntry::AutoGeckoProfilerEntry(JSContext* cx, const char* label,
|
||||||
: profiler_(&cx->geckoProfiler())
|
: profiler_(&cx->geckoProfiler())
|
||||||
{
|
{
|
||||||
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
|
MOZ_GUARD_OBJECT_NOTIFIER_INIT;
|
||||||
if (MOZ_LIKELY(!profiler_->installed())) {
|
if (MOZ_LIKELY(!profiler_->infraInstalled())) {
|
||||||
profiler_ = nullptr;
|
profiler_ = nullptr;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ void
|
||||||
GeckoProfilerRuntime::enable(bool enabled)
|
GeckoProfilerRuntime::enable(bool enabled)
|
||||||
{
|
{
|
||||||
JSContext* cx = rt->mainContextFromAnyThread();
|
JSContext* cx = rt->mainContextFromAnyThread();
|
||||||
MOZ_ASSERT(cx->geckoProfiler().installed());
|
MOZ_ASSERT(cx->geckoProfiler().infraInstalled());
|
||||||
|
|
||||||
if (enabled_ == enabled) {
|
if (enabled_ == enabled) {
|
||||||
return;
|
return;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче