Bug 1332577 (part 7) - Rename mozilla_get_pseudo_stack() as profiler_get_pseudo_stack(). r=mstange.
authorNicholas Nethercote <nnethercote@mozilla.com>
Fri, 20 Jan 2017 15:07:05 +1100
changeset 330526 1e467949bdad0839aca0ec6b51a6d1b8f8e25226
parent 330525 6f893e5c9e874300e4bc5523e821e8b3948bb80d
child 330527 6c6ecff45a92f07925d9fae12681f2a143efd392
push id36330
push userphilringnalda@gmail.com
push dateSat, 21 Jan 2017 23:26:41 +0000
treeherderautoland@5f0652e323af [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1332577
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1332577 (part 7) - Rename mozilla_get_pseudo_stack() as profiler_get_pseudo_stack(). r=mstange. This makes it consistent with other profiler functions.
dom/workers/RuntimeService.cpp
gfx/layers/ipc/ImageBridgeChild.cpp
js/xpconnect/src/XPCJSContext.cpp
tools/profiler/public/GeckoProfiler.h
xpcom/build/XPCOMInit.cpp
xpcom/threads/ThreadStackHelper.cpp
--- a/dom/workers/RuntimeService.cpp
+++ b/dom/workers/RuntimeService.cpp
@@ -2854,17 +2854,17 @@ WorkerThreadPrimaryRunnable::Run()
     if (!InitJSContextForWorker(mWorkerPrivate, cx)) {
       // XXX need to fire an error at parent.
       NS_ERROR("Failed to create context!");
       return NS_ERROR_FAILURE;
     }
 
     {
 #ifdef MOZ_ENABLE_PROFILER_SPS
-      PseudoStack* stack = mozilla_get_pseudo_stack();
+      PseudoStack* stack = profiler_get_pseudo_stack();
       if (stack) {
         stack->sampleContext(cx);
       }
 #endif
 
       {
         JSAutoRequest ar(cx);
 
--- a/gfx/layers/ipc/ImageBridgeChild.cpp
+++ b/gfx/layers/ipc/ImageBridgeChild.cpp
@@ -66,17 +66,17 @@ public:
   ImageBridgeThread() : Thread("ImageBridgeChild") {
   }
 
 protected:
 
   MOZ_IS_CLASS_INIT
   void Init() {
 #ifdef MOZ_ENABLE_PROFILER_SPS
-    mPseudoStackHack = mozilla_get_pseudo_stack();
+    mPseudoStackHack = profiler_get_pseudo_stack();
 #endif
   }
 
   void CleanUp() {
 #ifdef MOZ_ENABLE_PROFILER_SPS
     mPseudoStackHack = nullptr;
 #endif
   }
--- a/js/xpconnect/src/XPCJSContext.cpp
+++ b/js/xpconnect/src/XPCJSContext.cpp
@@ -1557,17 +1557,17 @@ XPCJSContext::~XPCJSContext()
     delete mThisTranslatorMap;
     mThisTranslatorMap = nullptr;
 
     delete mDyingWrappedNativeProtoMap;
     mDyingWrappedNativeProtoMap = nullptr;
 
 #ifdef MOZ_ENABLE_PROFILER_SPS
     // Tell the profiler that the context is gone
-    if (PseudoStack* stack = mozilla_get_pseudo_stack())
+    if (PseudoStack* stack = profiler_get_pseudo_stack())
         stack->sampleContext(nullptr);
 #endif
 
     Preferences::UnregisterCallback(ReloadPrefsCallback, JS_OPTIONS_DOT_STR, this);
 }
 
 // If |*anonymizeID| is non-zero and this is a user compartment, the name will
 // be anonymized.
@@ -3418,17 +3418,17 @@ XPCJSContext::Initialize()
     mPrevDoCycleCollectionCallback = JS::SetDoCycleCollectionCallback(cx,
             DoCycleCollectionCallback);
     JS_AddFinalizeCallback(cx, FinalizeCallback, nullptr);
     JS_AddWeakPointerZoneGroupCallback(cx, WeakPointerZoneGroupCallback, this);
     JS_AddWeakPointerCompartmentCallback(cx, WeakPointerCompartmentCallback, this);
     JS_SetWrapObjectCallbacks(cx, &WrapObjectCallbacks);
     js::SetPreserveWrapperCallback(cx, PreserveWrapper);
 #ifdef MOZ_ENABLE_PROFILER_SPS
-    if (PseudoStack* stack = mozilla_get_pseudo_stack())
+    if (PseudoStack* stack = profiler_get_pseudo_stack())
         stack->sampleContext(cx);
 #endif
     JS_SetAccumulateTelemetryCallback(cx, AccumulateTelemetryCallback);
     js::SetActivityCallback(cx, ActivityCallback, this);
     JS_AddInterruptCallback(cx, InterruptCallback);
     js::SetWindowProxyClass(cx, &OuterWindowProxyClass);
 
     // The JS engine needs to keep the source code around in order to implement
--- a/tools/profiler/public/GeckoProfiler.h
+++ b/tools/profiler/public/GeckoProfiler.h
@@ -782,17 +782,18 @@ public:
   }
 private:
   char mDest[SAMPLER_MAX_STRING];
   void* mHandle;
 };
 
 } // namespace mozilla
 
-inline PseudoStack* mozilla_get_pseudo_stack(void)
+inline PseudoStack*
+profiler_get_pseudo_stack(void)
 {
   if (!stack_key_initialized)
     return nullptr;
   return tlsPseudoStack.get();
 }
 
 static inline
 void profiler_log(const char *str)
--- a/xpcom/build/XPCOMInit.cpp
+++ b/xpcom/build/XPCOMInit.cpp
@@ -1043,17 +1043,17 @@ ShutdownXPCOM(nsIServiceManager* aServMg
   // In optimized builds we don't do shutdown collections by default, so
   // uncollected (garbage) objects may keep the nsXPConnect singleton alive,
   // and its XPCJSContext along with it. However, we still destroy various
   // bits of state in JS_ShutDown(), so we need to make sure the profiler
   // can't access them when it shuts down. This call nulls out the
   // JS pseudo-stack's internal reference to the main thread JSContext,
   // duplicating the call in XPCJSContext::~XPCJSContext() in case that
   // never fired.
-  if (PseudoStack* stack = mozilla_get_pseudo_stack()) {
+  if (PseudoStack* stack = profiler_get_pseudo_stack()) {
     stack->sampleContext(nullptr);
   }
 #endif
 
   if (sInitializedJS) {
     // Shut down the JS engine.
     JS_ShutDown();
     sInitializedJS = false;
--- a/xpcom/threads/ThreadStackHelper.cpp
+++ b/xpcom/threads/ThreadStackHelper.cpp
@@ -110,17 +110,17 @@ ThreadStackHelper::Shutdown()
   }
   sInitialized--;
 #endif
 }
 
 ThreadStackHelper::ThreadStackHelper()
   : mStackToFill(nullptr)
 #ifdef MOZ_THREADSTACKHELPER_PSEUDO
-  , mPseudoStack(mozilla_get_pseudo_stack())
+  , mPseudoStack(profiler_get_pseudo_stack())
 #ifdef MOZ_THREADSTACKHELPER_NATIVE
   , mContextToFill(nullptr)
 #endif
   , mMaxStackSize(Stack::sMaxInlineStorage)
   , mMaxBufferSize(512)
 #endif
 {
 #if defined(XP_LINUX)