Bug 1375299 (part 1) - Reduce usage of MOZ_GECKO_PROFILER. r=mstange.

This patch reduces the differences between builds where the profiler is enabled
and those where the profiler is disabled. It does this by removing numerous
MOZ_GECKO_PROFILER checks.

These changes have the following consequences.

- Various functions and classes are now defined in all builds, and so can be
  used unconditionally: profiler_add_marker(), profiler_set_js_context(),
  profiler_clear_js_context(), profiler_get_pseudo_stack(), AutoProfilerLabel.
  (They are effectively no-ops in non-profiler builds, of course.)

- The no-op versions of PROFILER_* are now gone. The remaining versions are
  almost no-ops when the profiler isn't built.
This commit is contained in:
Nicholas Nethercote
2017-06-22 06:26:16 +10:00
parent a07983e793
commit 55c693e8f9
21 changed files with 74 additions and 138 deletions

View File

@@ -930,19 +930,19 @@ CycleCollectedJSRuntime::GCNurseryCollectionCallback(JSContext* aContext,
timelines->AddMarkerForAllObservedDocShells(abstractMarker);
}
#ifdef MOZ_GECKO_PROFILER
if (aProgress == JS::GCNurseryProgress::GC_NURSERY_COLLECTION_START) {
self->mLatestNurseryCollectionStart = TimeStamp::Now();
} else if ((aProgress == JS::GCNurseryProgress::GC_NURSERY_COLLECTION_END) &&
profiler_is_active())
{
#ifdef MOZ_GECKO_PROFILER
PROFILER_MARKER_PAYLOAD(
"GCMinor",
MakeUnique<GCMinorMarkerPayload>(self->mLatestNurseryCollectionStart,
TimeStamp::Now(),
JS::MinorGcToJSON(aContext)));
}
#endif
}
if (self->mPrevGCNurseryCollectionCallback) {
self->mPrevGCNurseryCollectionCallback(aContext, aProgress, aReason);