Bug 1443080 - Use the static call for static methods (not instance) r=Ehsan
☠☠ backed out by b1117fa567eb ☠ ☠
authorSylvestre Ledru <sledru@mozilla.com>
Mon, 05 Mar 2018 13:43:54 +0100
changeset 408102 53bdcd5937cdb1ccf4388ee7a0f3fee0c3675c52
parent 408101 3606a48f01835004c941f85fbdc5bdb88038049c
child 408103 7d509bb8a35d278c15597bff0a0e7855479987e3
push id33627
push userapavel@mozilla.com
push dateWed, 14 Mar 2018 22:06:06 +0000
treeherdermozilla-central@7dad306cf8fe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersEhsan
bugs1443080
milestone61.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 1443080 - Use the static call for static methods (not instance) r=Ehsan MozReview-Commit-ID: JwHh4bzxuTR
accessible/base/nsAccessibilityService.cpp
accessible/xpcom/xpcAccessibilityService.cpp
dom/base/Link.cpp
dom/base/nsDOMWindowUtils.cpp
dom/base/nsGlobalWindowOuter.cpp
dom/canvas/CanvasRenderingContext2D.cpp
dom/canvas/CanvasRenderingContext2D.h
dom/canvas/ImageBitmapRenderingContext.cpp
dom/canvas/WebGLRenderbuffer.cpp
dom/html/input/InputType.cpp
dom/indexedDB/ActorsParent.cpp
dom/indexedDB/FileInfo.cpp
dom/ipc/ColorPickerParent.cpp
dom/ipc/TabChild.cpp
dom/media/systemservices/CamerasChild.h
dom/media/systemservices/MediaParent.cpp
dom/media/webaudio/blink/HRTFPanner.cpp
dom/media/webspeech/synth/ipc/SpeechSynthesisChild.cpp
dom/presentation/PresentationConnectionList.cpp
dom/webbrowserpersist/WebBrowserPersistRemoteDocument.cpp
dom/xbl/nsBindingManager.cpp
dom/xul/XULDocument.cpp
editor/libeditor/HTMLAnonymousNodeEditor.cpp
editor/libeditor/HTMLEditRules.cpp
extensions/spellcheck/src/mozInlineSpellChecker.cpp
extensions/spellcheck/src/mozSpellChecker.cpp
gfx/gl/GLReadTexImageHelper.cpp
gfx/ipc/SharedDIB.cpp
gfx/src/nsFontMetrics.cpp
ipc/glue/IPCStreamUtils.cpp
js/src/irregexp/NativeRegExpMacroAssembler.cpp
js/src/irregexp/NativeRegExpMacroAssembler.h
js/src/jit/BaselineCacheIRCompiler.cpp
js/src/jit/BaselineCompiler.cpp
js/src/jit/BaselineIC.cpp
js/src/jit/CacheIRCompiler.cpp
js/src/jit/CodeGenerator.cpp
js/src/jit/IonCacheIRCompiler.cpp
js/src/jit/MoveResolver.cpp
js/src/jit/shared/CodeGenerator-shared-inl.h
js/src/jit/shared/CodeGenerator-shared.cpp
js/src/jit/x64/CodeGenerator-x64.cpp
js/src/jit/x86-shared/CodeGenerator-x86-shared.cpp
js/src/jsnum.cpp
js/src/perf/jsperf.cpp
js/src/vm/Runtime.cpp
js/src/vm/TypedArrayObject.h
js/src/wasm/WasmBaselineCompile.cpp
js/src/wasm/WasmStubs.cpp
js/xpconnect/loader/URLPreloader.h
js/xpconnect/wrappers/XrayWrapper.cpp
js/xpconnect/wrappers/XrayWrapper.h
layout/base/AccessibleCaretEventHub.cpp
layout/base/PresShell.cpp
layout/base/ServoRestyleManager.cpp
layout/base/nsCounterManager.cpp
layout/generic/nsGfxScrollFrame.cpp
layout/generic/nsGridContainerFrame.cpp
layout/generic/nsSimplePageSequenceFrame.cpp
layout/mathml/nsMathMLContainerFrame.cpp
layout/painting/ActiveLayerTracker.cpp
layout/painting/FrameLayerBuilder.cpp
layout/painting/nsCSSRenderingGradients.cpp
layout/style/RuleProcessorCache.h
layout/svg/SVGTextFrame.cpp
layout/svg/nsSVGIntegrationUtils.cpp
layout/xul/nsMenuPopupFrame.cpp
layout/xul/nsSplitterFrame.cpp
media/webrtc/signaling/gtest/rtpsources_unittests.cpp
media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
netwerk/cache/nsCacheService.cpp
rdf/base/nsRDFXMLSerializer.cpp
security/manager/ssl/PSMContentListener.cpp
toolkit/components/extensions/MatchPattern.cpp
toolkit/components/places/nsNavHistoryResult.cpp
toolkit/components/printingui/ipc/PrintingParent.cpp
toolkit/crashreporter/breakpad-client/linux/minidump_writer/minidump_writer.cc
toolkit/profile/nsToolkitProfileService.cpp
toolkit/xre/nsAppRunner.cpp
toolkit/xre/nsConsoleWriter.cpp
uriloader/exthandler/ExternalHelperAppParent.cpp
widget/nsBaseWidget.cpp
--- a/accessible/base/nsAccessibilityService.cpp
+++ b/accessible/base/nsAccessibilityService.cpp
@@ -1760,17 +1760,17 @@ GetOrCreateAccService(uint32_t aNewConsu
 }
 
 void
 MaybeShutdownAccService(uint32_t aFormerConsumer)
 {
   nsAccessibilityService* accService =
     nsAccessibilityService::gAccessibilityService;
 
-  if (!accService || accService->IsShutdown()) {
+  if (!accService || nsAccessibilityService::IsShutdown()) {
     return;
   }
 
   // Still used by XPCOM
   if (nsCoreUtils::AccEventObserversExist() ||
       xpcAccessibilityService::IsInUse() ||
       accService->HasXPCDocuments()) {
     // In case the XPCOM flag was unset (possibly because of the shutdown
@@ -1858,16 +1858,16 @@ ReadPlatformDisabledState()
 }
 
 void
 PrefChanged(const char* aPref, void* aClosure)
 {
   if (ReadPlatformDisabledState() == ePlatformIsDisabled) {
     // Force shut down accessibility.
     nsAccessibilityService* accService = nsAccessibilityService::gAccessibilityService;
-    if (accService && !accService->IsShutdown()) {
+    if (accService && !nsAccessibilityService::IsShutdown()) {
       accService->Shutdown();
     }
   }
 }
 
 }
 }
--- a/accessible/xpcom/xpcAccessibilityService.cpp
+++ b/accessible/xpcom/xpcAccessibilityService.cpp
@@ -34,17 +34,17 @@ xpcAccessibilityService::ShutdownCallbac
   }
 }
 
 NS_IMETHODIMP_(MozExternalRefCountType)
 xpcAccessibilityService::AddRef(void)
 {
   MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(xpcAccessibilityService)
   MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt");
-  if (!mRefCnt.isThreadSafe)
+  if (!nsAutoRefCnt::isThreadSafe)
     NS_ASSERT_OWNINGTHREAD(xpcAccessibilityService);
   nsrefcnt count = ++mRefCnt;
   NS_LOG_ADDREF(this, count, "xpcAccessibilityService", sizeof(*this));
 
   // We want refcount to be > 1 because one reference is added in the XPCOM
   // accessibility service getter.
   if (mRefCnt > 1) {
     if (mShutdownTimer) {
@@ -58,25 +58,25 @@ xpcAccessibilityService::AddRef(void)
   return count;
 }
 
 NS_IMETHODIMP_(MozExternalRefCountType)
 xpcAccessibilityService::Release(void)
 {
   MOZ_ASSERT(int32_t(mRefCnt) > 0, "dup release");
 
-  if (!mRefCnt.isThreadSafe) {
+  if (!nsAutoRefCnt::isThreadSafe) {
     NS_ASSERT_OWNINGTHREAD(xpcAccessibilityService);
   }
 
   nsrefcnt count = --mRefCnt;
   NS_LOG_RELEASE(this, count, "xpcAccessibilityService");
 
   if (count == 0) {
-    if (!mRefCnt.isThreadSafe) {
+    if (!nsAutoRefCnt::isThreadSafe) {
       NS_ASSERT_OWNINGTHREAD(xpcAccessibilityService);
     }
 
     mRefCnt = 1; /* stabilize */
     delete (this);
     return 0;
   }
 
--- a/dom/base/Link.cpp
+++ b/dom/base/Link.cpp
@@ -179,17 +179,17 @@ Link::TryDNSPrefetchOrPreconnectOrPrefet
       }
     }
   }
 
   if (linkTypes & nsStyleLinkElement::ePRECONNECT) {
     nsCOMPtr<nsIURI> uri(GetURI());
     if (uri && mElement->OwnerDoc()) {
       mElement->OwnerDoc()->MaybePreconnect(uri,
-        mElement->AttrValueToCORSMode(mElement->GetParsedAttr(nsGkAtoms::crossorigin)));
+        Element::AttrValueToCORSMode(mElement->GetParsedAttr(nsGkAtoms::crossorigin)));
       return;
     }
   }
 
   if (linkTypes & nsStyleLinkElement::eDNS_PREFETCH) {
     if (nsHTMLDNSPrefetch::IsAllowed(mElement->OwnerDoc())) {
       nsHTMLDNSPrefetch::PrefetchLow(this);
     }
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -324,17 +324,17 @@ nsDOMWindowUtils::GetDocCharsetIsForced(
 NS_IMETHODIMP
 nsDOMWindowUtils::GetPhysicalMillimeterInCSSPixels(float* aPhysicalMillimeter)
 {
   nsPresContext* presContext = GetPresContext();
   if (!presContext) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
-  *aPhysicalMillimeter = presContext->AppUnitsToFloatCSSPixels(
+  *aPhysicalMillimeter = nsPresContext::AppUnitsToFloatCSSPixels(
     presContext->PhysicalMillimetersToAppUnits(1));
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMWindowUtils::GetDocumentMetadata(const nsAString& aName,
                                       nsAString& aValue)
 {
--- a/dom/base/nsGlobalWindowOuter.cpp
+++ b/dom/base/nsGlobalWindowOuter.cpp
@@ -6151,17 +6151,17 @@ nsGlobalWindowOuter::EnterModalState()
       EventStateManager::GetActiveEventStateManager());
   if (activeESM && activeESM->GetPresContext()) {
     nsIPresShell* activeShell = activeESM->GetPresContext()->GetPresShell();
     if (activeShell && (
         nsContentUtils::ContentIsCrossDocDescendantOf(activeShell->GetDocument(), mDoc) ||
         nsContentUtils::ContentIsCrossDocDescendantOf(mDoc, activeShell->GetDocument()))) {
       EventStateManager::ClearGlobalActiveContent(activeESM);
 
-      activeShell->SetCapturingContent(nullptr, 0);
+      nsIPresShell::SetCapturingContent(nullptr, 0);
 
       if (activeShell) {
         RefPtr<nsFrameSelection> frameSelection = activeShell->FrameSelection();
         frameSelection->SetDragState(false);
       }
     }
   }
 
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -4037,17 +4037,17 @@ CanvasRenderingContext2D::SetFontInterna
   nsFont resizedFont(fontStyle->mFont);
   // Create a font group working in units of CSS pixels instead of the usual
   // device pixels, to avoid being affected by page zoom. nsFontMetrics will
   // convert nsFont size in app units to device pixels for the font group, so
   // here we first apply to the size the equivalent of a conversion from device
   // pixels to CSS pixels, to adjust for the difference in expectations from
   // other nsFontMetrics clients.
   resizedFont.size =
-    (fontStyle->mSize * c->AppUnitsPerDevPixel()) / c->AppUnitsPerCSSPixel();
+    (fontStyle->mSize * c->AppUnitsPerDevPixel()) / nsPresContext::AppUnitsPerCSSPixel();
 
   nsFontMetrics::Params params;
   params.language = fontStyle->mLanguage;
   params.explicitLanguage = fontStyle->mExplicitLanguage;
   params.userFontSet = c->GetUserFontSet();
   params.textPerf = c->GetTextPerfMetrics();
   RefPtr<nsFontMetrics> metrics =
     c->DeviceContext()->GetMetricsFor(resizedFont, params);
--- a/dom/canvas/CanvasRenderingContext2D.h
+++ b/dom/canvas/CanvasRenderingContext2D.h
@@ -1152,17 +1152,17 @@ protected:
 
     nsIPresShell *ps = GetPresShell();
     nsPresContext *pc;
 
     if (!ps) goto FINISH;
     pc = ps->GetPresContext();
     if (!pc) goto FINISH;
     devPixel = pc->AppUnitsPerDevPixel();
-    cssPixel = pc->AppUnitsPerCSSPixel();
+    cssPixel = nsPresContext::AppUnitsPerCSSPixel();
 
   FINISH:
     if (aPerDevPixel)
       *aPerDevPixel = devPixel;
     if (aPerCSSPixel)
       *aPerCSSPixel = cssPixel;
   }
 
--- a/dom/canvas/ImageBitmapRenderingContext.cpp
+++ b/dom/canvas/ImageBitmapRenderingContext.cpp
@@ -228,17 +228,17 @@ ImageBitmapRenderingContext::GetCanvasLa
   if (aOldLayer) {
     imageLayer = static_cast<ImageLayer*>(aOldLayer);
   } else {
     imageLayer = aManager->CreateImageLayer();
   }
 
   RefPtr<ImageContainer> imageContainer = imageLayer->GetContainer();
   if (!imageContainer) {
-    imageContainer = aManager->CreateImageContainer();
+    imageContainer = LayerManager::CreateImageContainer();
     imageLayer->SetContainer(imageContainer);
   }
 
   AutoTArray<ImageContainer::NonOwningImage, 1> imageList;
   RefPtr<layers::Image> image = ClipToIntrinsicSize();
   if (!image) {
     return nullptr;
   }
--- a/dom/canvas/WebGLRenderbuffer.cpp
+++ b/dom/canvas/WebGLRenderbuffer.cpp
@@ -204,17 +204,17 @@ WebGLRenderbuffer::RenderbufferStorage(c
         mContext->ErrorInvalidOperation("%s: `samples` is out of the valid range.", funcName);
         return;
     }
 
     // Validation complete.
 
     const GLenum error = DoRenderbufferStorage(samples, usage, width, height);
     if (error) {
-        const char* errorName = mContext->ErrorName(error);
+        const char* errorName = WebGLContext::ErrorName(error);
         mContext->GenerateWarning("%s generated error %s", funcName, errorName);
         return;
     }
 
     mContext->OnDataAllocCall();
 
     mSamples = samples;
     mFormat = usage;
--- a/dom/html/input/InputType.cpp
+++ b/dom/html/input/InputType.cpp
@@ -446,17 +446,17 @@ InputType::ParseDate(const nsAString& aV
   // class.
   return mInputElement->ParseDate(aValue, aYear, aMonth, aDay);
 }
 
 bool
 InputType::ParseTime(const nsAString& aValue, uint32_t* aResult) const
 {
   // see comment in InputType::ParseDate().
-  return mInputElement->ParseTime(aValue, aResult);
+  return mozilla::dom::HTMLInputElement::ParseTime(aValue, aResult);
 }
 
 bool
 InputType::ParseMonth(const nsAString& aValue, uint32_t* aYear,
                       uint32_t* aMonth) const
 {
   // see comment in InputType::ParseDate().
   return mInputElement->ParseMonth(aValue, aYear, aMonth);
--- a/dom/indexedDB/ActorsParent.cpp
+++ b/dom/indexedDB/ActorsParent.cpp
@@ -9960,17 +9960,17 @@ SerializeStructuredCloneFiles(
         file.mType != StructuredCloneFile::eWasmCompiled) {
       continue;
     }
 
     const int64_t fileId = file.mFileInfo->Id();
     MOZ_ASSERT(fileId > 0);
 
     nsCOMPtr<nsIFile> nativeFile =
-      fileManager->GetCheckedFileForId(directory, fileId);
+      mozilla::dom::indexedDB::FileManager::GetCheckedFileForId(directory, fileId);
     if (NS_WARN_IF(!nativeFile)) {
       IDB_REPORT_INTERNAL_ERR();
       return NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR;
     }
 
     switch (file.mType) {
       case StructuredCloneFile::eBlob: {
         RefPtr<FileBlobImpl> impl = new FileBlobImpl(nativeFile);
@@ -11502,17 +11502,17 @@ UpdateRefcountFunction::Reset()
         }
 
         mJournalDirectory = aFileManager->GetJournalDirectory();
         if (NS_WARN_IF(!mJournalDirectory)) {
           return NS_ERROR_FAILURE;
         }
       }
 
-      nsCOMPtr<nsIFile> file = aFileManager->GetFileForId(mDirectory, aId);
+      nsCOMPtr<nsIFile> file = FileManager::GetFileForId(mDirectory, aId);
       if (NS_WARN_IF(!file)) {
         return NS_ERROR_FAILURE;
       }
 
       nsresult rv;
       int64_t fileSize;
 
       if (aFileManager->EnforcingQuota()) {
@@ -11532,17 +11532,17 @@ UpdateRefcountFunction::Reset()
         MOZ_ASSERT(quotaManager);
 
         quotaManager->DecreaseUsageForOrigin(aFileManager->Type(),
                                              aFileManager->Group(),
                                              aFileManager->Origin(),
                                              fileSize);
       }
 
-      file = aFileManager->GetFileForId(mJournalDirectory, aId);
+      file = FileManager::GetFileForId(mJournalDirectory, aId);
       if (NS_WARN_IF(!file)) {
         return NS_ERROR_FAILURE;
       }
 
       rv = file->Remove(false);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
@@ -11660,17 +11660,17 @@ UpdateRefcountFunction::CreateJournals()
   if (NS_WARN_IF(!journalDirectory)) {
     return NS_ERROR_FAILURE;
   }
 
   for (uint32_t i = 0; i < mJournalsToCreateBeforeCommit.Length(); i++) {
     int64_t id = mJournalsToCreateBeforeCommit[i];
 
     nsCOMPtr<nsIFile> file =
-      mFileManager->GetFileForId(journalDirectory, id);
+      FileManager::GetFileForId(journalDirectory, id);
     if (NS_WARN_IF(!file)) {
       return NS_ERROR_FAILURE;
     }
 
     nsresult rv = file->Create(nsIFile::NORMAL_FILE_TYPE, 0644);
     if (NS_WARN_IF(NS_FAILED(rv))) {
       return rv;
     }
@@ -11693,17 +11693,17 @@ UpdateRefcountFunction::RemoveJournals(c
 
   nsCOMPtr<nsIFile> journalDirectory = mFileManager->GetJournalDirectory();
   if (NS_WARN_IF(!journalDirectory)) {
     return NS_ERROR_FAILURE;
   }
 
   for (uint32_t index = 0; index < aJournals.Length(); index++) {
     nsCOMPtr<nsIFile> file =
-      mFileManager->GetFileForId(journalDirectory, aJournals[index]);
+      FileManager::GetFileForId(journalDirectory, aJournals[index]);
     if (NS_WARN_IF(!file)) {
       return NS_ERROR_FAILURE;
     }
 
     if (NS_FAILED(file->Remove(false))) {
       NS_WARNING("Failed to removed journal!");
     }
   }
--- a/dom/indexedDB/FileInfo.cpp
+++ b/dom/indexedDB/FileInfo.cpp
@@ -258,17 +258,17 @@ CleanupFileRunnable::Run()
 FileInfo::GetFileForFileInfo(FileInfo* aFileInfo)
 {
   FileManager* fileManager = aFileInfo->Manager();
   nsCOMPtr<nsIFile> directory = fileManager->GetDirectory();
   if (NS_WARN_IF(!directory)) {
     return nullptr;
   }
 
-  nsCOMPtr<nsIFile> file = fileManager->GetFileForId(directory,
+  nsCOMPtr<nsIFile> file = FileManager::GetFileForId(directory,
                                                      aFileInfo->Id());
   if (NS_WARN_IF(!file)) {
     return nullptr;
   }
 
   return file.forget();
 }
 
--- a/dom/ipc/ColorPickerParent.cpp
+++ b/dom/ipc/ColorPickerParent.cpp
@@ -26,17 +26,17 @@ ColorPickerParent::ColorPickerShownCallb
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 ColorPickerParent::ColorPickerShownCallback::Done(const nsAString& aColor)
 {
   if (mColorPickerParent) {
-    Unused << mColorPickerParent->Send__delete__(mColorPickerParent,
+    Unused << ColorPickerParent::Send__delete__(mColorPickerParent,
                                                  nsString(aColor));
   }
   return NS_OK;
 }
 
 void
 ColorPickerParent::ColorPickerShownCallback::Destroy()
 {
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -1718,17 +1718,17 @@ TabChild::HandleRealMouseButtonEvent(con
     pendingLayerization =
       APZCCallbackHelper::SendSetTargetAPZCNotification(mPuppetWidget, document,
                                                         aEvent, aGuid,
                                                         aInputBlockId);
   }
 
   InputAPZContext context(aGuid, aInputBlockId, nsEventStatus_eIgnore);
   if (pendingLayerization) {
-    context.SetPendingLayerization();
+    InputAPZContext::SetPendingLayerization();
   }
 
   WidgetMouseEvent localEvent(aEvent);
   localEvent.mWidget = mPuppetWidget;
   APZCCallbackHelper::ApplyCallbackTransform(localEvent, aGuid,
       mPuppetWidget->GetDefaultScale());
   DispatchWidgetEventViaAPZ(localEvent);
 
--- a/dom/media/systemservices/CamerasChild.h
+++ b/dom/media/systemservices/CamerasChild.h
@@ -69,32 +69,32 @@ template <class T> class LockAndDispatch
 // something like device enumeration to complete.
 
 class CamerasSingleton {
 public:
   CamerasSingleton();
   ~CamerasSingleton();
 
   static OffTheBooksMutex& Mutex() {
-    return gTheInstance.get()->mCamerasMutex;
+    return Singleton<mozilla::camera::CamerasSingleton>::get()->mCamerasMutex;
   }
 
   static CamerasChild*& Child() {
     Mutex().AssertCurrentThreadOwns();
-    return gTheInstance.get()->mCameras;
+    return Singleton<mozilla::camera::CamerasSingleton>::get()->mCameras;
   }
 
   static nsCOMPtr<nsIThread>& Thread() {
     Mutex().AssertCurrentThreadOwns();
-    return gTheInstance.get()->mCamerasChildThread;
+    return Singleton<mozilla::camera::CamerasSingleton>::get()->mCamerasChildThread;
   }
 
   static nsCOMPtr<nsIThread>& FakeDeviceChangeEventThread() {
     Mutex().AssertCurrentThreadOwns();
-    return gTheInstance.get()->mFakeDeviceChangeEventThread;
+    return Singleton<mozilla::camera::CamerasSingleton>::get()->mFakeDeviceChangeEventThread;
   }
 
   static bool InShutdown() {
     return gTheInstance.get()->mInShutdown;
   }
 
   static void StartShutdown() {
     gTheInstance.get()->mInShutdown = true;
--- a/dom/media/systemservices/MediaParent.cpp
+++ b/dom/media/systemservices/MediaParent.cpp
@@ -67,17 +67,17 @@ class OriginKeyStore : public nsISupport
                     nsCString& aResult, bool aPersist = false)
     {
       nsAutoCString principalString;
       PrincipalInfoToString(aPrincipalInfo, principalString);
 
       OriginKey* key;
       if (!mKeys.Get(principalString, &key)) {
         nsCString salt; // Make a new one
-        nsresult rv = GenerateRandomName(salt, key->EncodedLength);
+        nsresult rv = GenerateRandomName(salt, OriginKey::EncodedLength);
         if (NS_WARN_IF(NS_FAILED(rv))) {
           return rv;
         }
         key = new OriginKey(salt);
         mKeys.Put(principalString, key);
       }
       if (aPersist && !key->mSecondsStamp) {
         key->mSecondsStamp = PR_Now() / PR_USEC_PER_SEC;
--- a/dom/media/webaudio/blink/HRTFPanner.cpp
+++ b/dom/media/webaudio/blink/HRTFPanner.cpp
@@ -100,17 +100,17 @@ int HRTFPanner::calculateDesiredAzimuthI
     // Convert the azimuth angle from the range -180 -> +180 into the range 0 -> 360.
     // The azimuth index may then be calculated from this positive value.
     if (azimuth < 0)
         azimuth += 360.0;
 
     HRTFDatabase* database = m_databaseLoader->database();
     MOZ_ASSERT(database);
 
-    int numberOfAzimuths = database->numberOfAzimuths();
+    int numberOfAzimuths = HRTFDatabase::numberOfAzimuths();
     const double angleBetweenAzimuths = 360.0 / numberOfAzimuths;
 
     // Calculate the azimuth index and the blend (0 -> 1) for interpolation.
     double desiredAzimuthIndexFloat = azimuth / angleBetweenAzimuths;
     int desiredAzimuthIndex = static_cast<int>(desiredAzimuthIndexFloat);
     azimuthBlend = desiredAzimuthIndexFloat - static_cast<double>(desiredAzimuthIndex);
 
     // We don't immediately start using this azimuth index, but instead approach this index from the last index we rendered at.
--- a/dom/media/webspeech/synth/ipc/SpeechSynthesisChild.cpp
+++ b/dom/media/webspeech/synth/ipc/SpeechSynthesisChild.cpp
@@ -112,17 +112,17 @@ SpeechSynthesisRequestChild::RecvOnEnd(c
   mTask->mActor = nullptr;
 
   if (aIsError) {
     mTask->DispatchErrorImpl(aElapsedTime, aCharIndex);
   } else {
     mTask->DispatchEndImpl(aElapsedTime, aCharIndex);
   }
 
-  actor->Send__delete__(actor);
+  SpeechSynthesisRequestChild::Send__delete__(actor);
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 SpeechSynthesisRequestChild::RecvOnPause(const float& aElapsedTime,
                                          const uint32_t& aCharIndex)
 {
--- a/dom/presentation/PresentationConnectionList.cpp
+++ b/dom/presentation/PresentationConnectionList.cpp
@@ -88,30 +88,30 @@ PresentationConnectionList::FindConnecti
   for (ConnectionArrayIndex i = 0; i < mConnections.Length(); i++) {
     nsAutoString id;
     mConnections[i]->GetId(id);
     if (id == nsAutoString(aId)) {
       return i;
     }
   }
 
-  return mConnections.NoIndex;
+  return ConnectionArray::NoIndex;
 }
 
 void
 PresentationConnectionList::NotifyStateChange(const nsAString& aSessionId,
                                               PresentationConnection* aConnection)
 {
   if (!aConnection) {
     MOZ_ASSERT(false, "PresentationConnection can not be null.");
     return;
   }
 
   bool connectionFound =
-    FindConnectionById(aSessionId) != mConnections.NoIndex ? true : false;
+    FindConnectionById(aSessionId) != ConnectionArray::NoIndex ? true : false;
 
   PresentationConnectionListBinding::ClearCachedConnectionsValue(this);
   switch (aConnection->State()) {
     case PresentationConnectionState::Connected:
       if (!connectionFound) {
         mConnections.AppendElement(aConnection);
         if (mGetConnectionListPromise) {
           if (!nsContentUtils::ShouldResistFingerprinting()) {
--- a/dom/webbrowserpersist/WebBrowserPersistRemoteDocument.cpp
+++ b/dom/webbrowserpersist/WebBrowserPersistRemoteDocument.cpp
@@ -23,17 +23,17 @@ WebBrowserPersistRemoteDocument
 , mAttrs(aAttrs)
 , mPostData(aPostData)
 {
 }
 
 WebBrowserPersistRemoteDocument::~WebBrowserPersistRemoteDocument()
 {
     if (mActor) {
-        Unused << mActor->Send__delete__(mActor);
+        Unused << WebBrowserPersistDocumentParent::Send__delete__(mActor);
         // That will call mActor->ActorDestroy, which calls this->ActorDestroy
         // (whether or not the IPC send succeeds).
     }
     MOZ_ASSERT(!mActor);
 }
 
 void
 WebBrowserPersistRemoteDocument::ActorDestroy(void)
--- a/dom/xbl/nsBindingManager.cpp
+++ b/dom/xbl/nsBindingManager.cpp
@@ -330,17 +330,17 @@ nsBindingManager::LoadBindingDocument(ns
 }
 
 void
 nsBindingManager::RemoveFromAttachedQueue(nsXBLBinding* aBinding)
 {
   // Don't remove items here as that could mess up an executing
   // ProcessAttachedQueue. Instead, null the entry in the queue.
   size_t index = mAttachedStack.IndexOf(aBinding);
-  if (index != mAttachedStack.NoIndex) {
+  if (index != nsBindingList::NoIndex) {
     mAttachedStack[index] = nullptr;
   }
 }
 
 nsresult
 nsBindingManager::AddToAttachedQueue(nsXBLBinding* aBinding)
 {
   mAttachedStack.AppendElement(aBinding);
--- a/dom/xul/XULDocument.cpp
+++ b/dom/xul/XULDocument.cpp
@@ -3346,17 +3346,17 @@ XULDocument::OverlayForwardReference::Re
     if (id.IsEmpty()) {
         // mOverlay is a direct child of <overlay> and has no id.
         // Insert it under the root element in the base document.
         Element* root = mDocument->GetRootElement();
         if (!root) {
             return eResolve_Error;
         }
 
-        rv = mDocument->InsertElement(root, mOverlay, notify);
+        rv = XULDocument::InsertElement(root, mOverlay, notify);
         if (NS_FAILED(rv)) return eResolve_Error;
 
         target = mOverlay;
     }
     else {
         // The hook-up element has an id, try to match it with an element
         // with the same id in the base document.
         target = mDocument->GetElementById(id);
--- a/editor/libeditor/HTMLAnonymousNodeEditor.cpp
+++ b/editor/libeditor/HTMLAnonymousNodeEditor.cpp
@@ -230,17 +230,17 @@ HTMLEditor::CreateAnonymousElement(nsAto
 
   ManualNACPtr newContent(newContentRaw.forget());
 
   // Must style the new element, otherwise the PostRecreateFramesFor call
   // below will do nothing.
   if (ServoStyleSet* styleSet = ps->StyleSet()->GetAsServo()) {
     // Sometimes editor likes to append anonymous content to elements
     // in display:none subtrees, so avoid styling in those cases.
-    if (styleSet->MayTraverseFrom(newContent)) {
+    if (ServoStyleSet::MayTraverseFrom(newContent)) {
       styleSet->StyleNewSubtree(newContent);
     }
   }
 
   ElementDeletionObserver* observer =
     new ElementDeletionObserver(newContent, &aParentContent);
   NS_ADDREF(observer); // NodeWillBeDestroyed releases.
   aParentContent.AddMutationObserver(observer);
--- a/editor/libeditor/HTMLEditRules.cpp
+++ b/editor/libeditor/HTMLEditRules.cpp
@@ -1734,17 +1734,17 @@ HTMLEditRules::WillInsertBreak(Selection
 
     atStartOfSelection = firstRange->StartRef();
     if (NS_WARN_IF(!atStartOfSelection.IsSet())) {
       return NS_ERROR_FAILURE;
     }
     MOZ_ASSERT(atStartOfSelection.IsSetAndValid());
 
     blockParent =
-      mHTMLEditor->GetBlock(*atStartOfSelection.GetContainer(), host);
+      HTMLEditor::GetBlock(*atStartOfSelection.GetContainer(), host);
     if (NS_WARN_IF(!blockParent)) {
       return NS_ERROR_UNEXPECTED;
     }
     if (NS_WARN_IF(blockParent == host)) {
       // Didn't create a new block for some reason, fall back to <br>
       rv = InsertBRElement(aSelection, atStartOfSelection);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
@@ -2668,18 +2668,18 @@ HTMLEditRules::WillDeleteSelection(Selec
       if (startCiteNode && !endCiteNode) {
         aAction = nsIEditor::eNext;
       } else if (!startCiteNode && endCiteNode) {
         aAction = nsIEditor::ePrevious;
       }
 
       // Figure out block parents
       NS_ENSURE_STATE(mHTMLEditor);
-      nsCOMPtr<Element> leftParent = mHTMLEditor->GetBlock(*startNode);
-      nsCOMPtr<Element> rightParent = mHTMLEditor->GetBlock(*endNode);
+      nsCOMPtr<Element> leftParent = HTMLEditor::GetBlock(*startNode);
+      nsCOMPtr<Element> rightParent = HTMLEditor::GetBlock(*endNode);
 
       // Are endpoint block parents the same?  Use default deletion
       if (leftParent && leftParent == rightParent) {
         NS_ENSURE_STATE(mHTMLEditor);
         mHTMLEditor->DeleteSelectionImpl(aAction, aStripWrappers);
       } else {
         // Deleting across blocks.  Are the blocks of same type?
         NS_ENSURE_STATE(leftParent && rightParent);
--- a/extensions/spellcheck/src/mozInlineSpellChecker.cpp
+++ b/extensions/spellcheck/src/mozInlineSpellChecker.cpp
@@ -1492,17 +1492,17 @@ nsresult mozInlineSpellChecker::DoSpellC
     // this is sufficient.
     if (aStatus->mNoCheckRange &&
         aStatus->mNoCheckRange->IsPointInRange(*beginNode, beginOffset, erv)) {
       continue;
     }
 
     // check spelling and add to selection if misspelled
     bool isMisspelled;
-    aWordUtil.NormalizeWord(wordText);
+    mozInlineSpellWordUtil::NormalizeWord(wordText);
     nsresult rv = mSpellCheck->CheckCurrentWordNoSuggest(wordText,
                                                          &isMisspelled);
     if (NS_FAILED(rv))
       continue;
 
     wordsChecked++;
     if (isMisspelled) {
       // misspelled words count extra toward the max
--- a/extensions/spellcheck/src/mozSpellChecker.cpp
+++ b/extensions/spellcheck/src/mozSpellChecker.cpp
@@ -48,17 +48,17 @@ mozSpellChecker::~mozSpellChecker()
     //    mPersonalDictionary->Save();
     mPersonalDictionary->EndSession();
   }
   mSpellCheckingEngine = nullptr;
   mPersonalDictionary = nullptr;
 
   if (mEngine) {
     MOZ_ASSERT(XRE_IsContentProcess());
-    mEngine->Send__delete__(mEngine);
+    RemoteSpellcheckEngineChild::Send__delete__(mEngine);
     MOZ_ASSERT(!mEngine);
   }
 }
 
 nsresult
 mozSpellChecker::Init()
 {
   mSpellCheckingEngine = nullptr;
--- a/gfx/gl/GLReadTexImageHelper.cpp
+++ b/gfx/gl/GLReadTexImageHelper.cpp
@@ -147,17 +147,17 @@ GLReadTexImageHelper::TextureImageProgra
 }
 
 bool
 GLReadTexImageHelper::DidGLErrorOccur(const char* str)
 {
     GLenum error = mGL->fGetError();
     if (error != LOCAL_GL_NO_ERROR) {
         printf_stderr("GL ERROR: %s (0x%04x) %s\n",
-                      mGL->GLErrorToString(error), error, str);
+                      GLContext::GLErrorToString(error), error, str);
         return true;
     }
 
     return false;
 }
 
 bool
 GetActualReadFormats(GLContext* gl,
--- a/gfx/ipc/SharedDIB.cpp
+++ b/gfx/ipc/SharedDIB.cpp
@@ -32,17 +32,17 @@ SharedDIB::Create(uint32_t aSize)
 }
 
 bool
 SharedDIB::IsValid()
 {
   if (!mShMem)
     return false;
 
-  return mShMem->IsHandleValid(mShMem->handle());
+  return base::SharedMemory::IsHandleValid(mShMem->handle());
 }
 
 nsresult
 SharedDIB::Close()
 {
   delete mShMem;
 
   mShMem = nullptr;
--- a/gfx/src/nsFontMetrics.cpp
+++ b/gfx/src/nsFontMetrics.cpp
@@ -133,17 +133,17 @@ nsFontMetrics::nsFontMetrics(const nsFon
                        aFont.synthesis & NS_FONT_SYNTHESIS_WEIGHT,
                        aFont.synthesis & NS_FONT_SYNTHESIS_STYLE,
                        aFont.languageOverride);
 
     aFont.AddFontFeaturesToStyle(&style, mOrientation == gfxFont::eVertical);
     aFont.AddFontVariationsToStyle(&style);
 
     gfxFloat devToCssSize = gfxFloat(mP2A) /
-        gfxFloat(mDeviceContext->AppUnitsPerCSSPixel());
+        gfxFloat(nsDeviceContext::AppUnitsPerCSSPixel());
     mFontGroup = gfxPlatform::GetPlatform()->
         CreateFontGroup(aFont.fontlist, &style, aParams.textPerf,
                         aParams.userFontSet, devToCssSize);
 }
 
 nsFontMetrics::~nsFontMetrics()
 {
     // Should not be dropped by stylo
--- a/ipc/glue/IPCStreamUtils.cpp
+++ b/ipc/glue/IPCStreamUtils.cpp
@@ -269,17 +269,17 @@ CleanupIPCStream(IPCStream& aValue, bool
       MOZ_ASSERT(fdSetActor);
 
       // FileDescriptorSet doesn't clear its fds in its ActorDestroy, so we
       // unconditionally forget them here.  The fds themselves are auto-closed in
       // ~FileDescriptor since they originated in this process.
       fdSetActor->ForgetFileDescriptors(fds);
 
       if (!aConsumedByIPC) {
-        Unused << fdSetActor->Send__delete__(fdSetActor);
+        Unused << FileDescriptorSetChild::Send__delete__(fdSetActor);
       }
 
     } else if (streamWithFds.optionalFds().type() ==
                OptionalFileDescriptorSet::TPFileDescriptorSetParent) {
 
       AutoTArray<FileDescriptor, 4> fds;
 
       auto fdSetActor = static_cast<FileDescriptorSetParent*>(
@@ -287,17 +287,17 @@ CleanupIPCStream(IPCStream& aValue, bool
       MOZ_ASSERT(fdSetActor);
 
       // FileDescriptorSet doesn't clear its fds in its ActorDestroy, so we
       // unconditionally forget them here.  The fds themselves are auto-closed in
       // ~FileDescriptor since they originated in this process.
       fdSetActor->ForgetFileDescriptors(fds);
 
       if (!aConsumedByIPC) {
-        Unused << fdSetActor->Send__delete__(fdSetActor);
+        Unused << FileDescriptorSetParent::Send__delete__(fdSetActor);
       }
     }
 
     return;
   }
 
   MOZ_ASSERT(aValue.type() == IPCStream::TIPCRemoteStream);
   IPCRemoteStreamType& remoteInputStream =
@@ -395,31 +395,31 @@ DeserializeIPCStream(const IPCStream& aV
 
     auto fdSetActor = static_cast<FileDescriptorSetParent*>(
       streamWithFds.optionalFds().get_PFileDescriptorSetParent());
     MOZ_ASSERT(fdSetActor);
 
     fdSetActor->ForgetFileDescriptors(fds);
     MOZ_ASSERT(!fds.IsEmpty());
 
-    if (!fdSetActor->Send__delete__(fdSetActor)) {
+    if (!FileDescriptorSetParent::Send__delete__(fdSetActor)) {
       // child process is gone, warn and allow actor to clean up normally
       NS_WARNING("Failed to delete fd set actor.");
     }
   } else if (streamWithFds.optionalFds().type() ==
              OptionalFileDescriptorSet::TPFileDescriptorSetChild) {
 
     auto fdSetActor = static_cast<FileDescriptorSetChild*>(
       streamWithFds.optionalFds().get_PFileDescriptorSetChild());
     MOZ_ASSERT(fdSetActor);
 
     fdSetActor->ForgetFileDescriptors(fds);
     MOZ_ASSERT(!fds.IsEmpty());
 
-    Unused << fdSetActor->Send__delete__(fdSetActor);
+    Unused << FileDescriptorSetChild::Send__delete__(fdSetActor);
   }
 
   return InputStreamHelper::DeserializeInputStream(streamWithFds.stream(), fds);
 }
 
 already_AddRefed<nsIInputStream>
 DeserializeIPCStream(const OptionalIPCStream& aValue)
 {
--- a/js/src/irregexp/NativeRegExpMacroAssembler.cpp
+++ b/js/src/irregexp/NativeRegExpMacroAssembler.cpp
@@ -176,79 +176,79 @@ NativeRegExpMacroAssembler::GenerateCode
     // on Windows can cause segmentation faults. Assuming page size is 4k.
     const int kPageSize = 4096;
     for (int i = frameSize - sizeof(void*); i >= 0; i -= kPageSize)
         masm.storePtr(temp0, Address(masm.getStackPointer(), i));
 #endif // XP_WIN
 
 #ifndef JS_CODEGEN_X86
     // The InputOutputData* is stored on the stack immediately above the frame.
-    Address inputOutputAddress(masm.getStackPointer(), frameSize);
+    Address inputOutputAddress(MacroAssembler::getStackPointer(), frameSize);
 #else
     // The InputOutputData* is left in its original on stack location.
     Address inputOutputAddress(masm.getStackPointer(),
                                frameSize + (pushedNonVolatileRegisters + 1) * sizeof(void*));
 #endif
 
     masm.loadPtr(inputOutputAddress, temp0);
 
     // Copy output registers to FrameData.
     if (!match_only) {
         Register matchPairsRegister = input_end_pointer;
         masm.loadPtr(Address(temp0, offsetof(InputOutputData, matches)), matchPairsRegister);
         masm.loadPtr(Address(matchPairsRegister, MatchPairs::offsetOfPairs()), temp1);
-        masm.storePtr(temp1, Address(masm.getStackPointer(), offsetof(FrameData, outputRegisters)));
+        masm.storePtr(temp1, Address(MacroAssembler::getStackPointer(), offsetof(FrameData, outputRegisters)));
         masm.load32(Address(matchPairsRegister, MatchPairs::offsetOfPairCount()), temp1);
         masm.lshiftPtr(Imm32(1), temp1);
-        masm.store32(temp1, Address(masm.getStackPointer(), offsetof(FrameData, numOutputRegisters)));
+        masm.store32(temp1, Address(MacroAssembler::getStackPointer(), offsetof(FrameData, numOutputRegisters)));
 
 #ifdef DEBUG
         // Bounds check numOutputRegisters.
         Label enoughRegisters;
         masm.branchPtr(Assembler::GreaterThanOrEqual,
                        temp1, ImmWord(num_saved_registers_), &enoughRegisters);
         masm.assumeUnreachable("Not enough output registers for RegExp");
         masm.bind(&enoughRegisters);
 #endif
     } else {
         Register endIndexRegister = input_end_pointer;
         masm.loadPtr(Address(temp0, offsetof(InputOutputData, endIndex)), endIndexRegister);
-        masm.storePtr(endIndexRegister, Address(masm.getStackPointer(), offsetof(FrameData, endIndex)));
+        masm.storePtr(endIndexRegister, Address(MacroAssembler::getStackPointer(), offsetof(FrameData, endIndex)));
     }
 
     // Load string end pointer.
     masm.loadPtr(Address(temp0, offsetof(InputOutputData, inputEnd)), input_end_pointer);
 
     // Load input start pointer, and copy to FrameData.
     masm.loadPtr(Address(temp0, offsetof(InputOutputData, inputStart)), current_position);
-    masm.storePtr(current_position, Address(masm.getStackPointer(), offsetof(FrameData, inputStart)));
+    masm.storePtr(current_position, Address(MacroAssembler::getStackPointer(), offsetof(FrameData, inputStart)));
 
     // Load start index, and copy to FrameData.
     masm.loadPtr(Address(temp0, offsetof(InputOutputData, startIndex)), temp1);
-    masm.storePtr(temp1, Address(masm.getStackPointer(), offsetof(FrameData, startIndex)));
+    masm.storePtr(temp1, Address(MacroAssembler::getStackPointer(), offsetof(FrameData, startIndex)));
 
     // Set up input position to be negative offset from string end.
     masm.subPtr(input_end_pointer, current_position);
 
     // Set temp0 to address of char before start of the string.
     // (effectively string position -1).
     masm.computeEffectiveAddress(Address(current_position, -char_size()), temp0);
 
     // Store this value on the frame, for use when clearing
     // position registers.
-    masm.storePtr(temp0, Address(masm.getStackPointer(), offsetof(FrameData, inputStartMinusOne)));
+    masm.storePtr(temp0, Address(MacroAssembler::getStackPointer(), offsetof(FrameData, inputStartMinusOne)));
 
     // Update current position based on start index.
     masm.computeEffectiveAddress(BaseIndex(current_position, temp1, factor()), current_position);
 
     Label load_char_start_regexp, start_regexp;
 
     // Load newline if index is at start, previous character otherwise.
-    masm.branchPtr(Assembler::NotEqual, 
-                   Address(masm.getStackPointer(), offsetof(FrameData, startIndex)), ImmWord(0),
+    masm.branchPtr(Assembler::NotEqual,
+                   Address(MacroAssembler::getStackPointer(), offsetof(FrameData, startIndex)), ImmWord(0),
                    &load_char_start_regexp);
     masm.movePtr(ImmWord('\n'), current_character);
     masm.jump(&start_regexp);
 
     // Global regexp restarts matching here.
     masm.bind(&load_char_start_regexp);
 
     // Load previous char as initial value of current character register.
@@ -260,40 +260,40 @@ NativeRegExpMacroAssembler::GenerateCode
 
     // Fill saved registers with initial value = start offset - 1
     // Fill in stack push order, to avoid accessing across an unwritten
     // page (a problem on Windows).
     if (num_saved_registers_ > 8) {
         masm.movePtr(ImmWord(register_offset(0)), temp1);
         Label init_loop;
         masm.bind(&init_loop);
-        masm.storePtr(temp0, BaseIndex(masm.getStackPointer(), temp1, TimesOne));
+        masm.storePtr(temp0, BaseIndex(MacroAssembler::getStackPointer(), temp1, TimesOne));
         masm.addPtr(ImmWord(sizeof(void*)), temp1);
         masm.branchPtr(Assembler::LessThan, temp1,
                        ImmWord(register_offset(num_saved_registers_)), &init_loop);
     } else {
         // Unroll the loop.
         for (int i = 0; i < num_saved_registers_; i++)
             masm.storePtr(temp0, register_location(i));
     }
 
     // Initialize backtrack stack pointer.
     size_t baseOffset = offsetof(JSContext, regexpStack) + RegExpStack::offsetOfBase();
     masm.loadPtr(AbsoluteAddress(context_addr), backtrack_stack_pointer);
     masm.loadPtr(Address(backtrack_stack_pointer, baseOffset), backtrack_stack_pointer);
     masm.storePtr(backtrack_stack_pointer,
-                  Address(masm.getStackPointer(), offsetof(FrameData, backtrackStackBase)));
+                  Address(MacroAssembler::getStackPointer(), offsetof(FrameData, backtrackStackBase)));
 
     masm.jump(&start_label_);
 
     // Exit code:
     if (success_label_.used()) {
         MOZ_ASSERT(num_saved_registers_ > 0);
 
-        Address outputRegistersAddress(masm.getStackPointer(), offsetof(FrameData, outputRegisters));
+        Address outputRegistersAddress(MacroAssembler::getStackPointer(), offsetof(FrameData, outputRegisters));
 
         // Save captures when successful.
         masm.bind(&success_label_);
 
         if (!match_only) {
             Register outputRegisters = temp1;
             Register inputByteLength = backtrack_stack_pointer;
 
@@ -321,36 +321,36 @@ NativeRegExpMacroAssembler::GenerateCode
 
                 masm.store32(temp0, Address(outputRegisters, i * sizeof(int32_t)));
             }
         }
 
         // Restart matching if the regular expression is flagged as global.
         if (global()) {
             // Increment success counter.
-            masm.add32(Imm32(1), Address(masm.getStackPointer(), offsetof(FrameData, successfulCaptures)));
+            masm.add32(Imm32(1), Address(MacroAssembler::getStackPointer(), offsetof(FrameData, successfulCaptures)));
 
-            Address numOutputRegistersAddress(masm.getStackPointer(), offsetof(FrameData, numOutputRegisters));
+            Address numOutputRegistersAddress(MacroAssembler::getStackPointer(), offsetof(FrameData, numOutputRegisters));
 
             // Capture results have been stored, so the number of remaining global
             // output registers is reduced by the number of stored captures.
             masm.load32(numOutputRegistersAddress, temp0);
 
             masm.sub32(Imm32(num_saved_registers_), temp0);
 
             // Check whether we have enough room for another set of capture results.
             masm.branch32(Assembler::LessThan, temp0, Imm32(num_saved_registers_), &exit_label_);
 
             masm.store32(temp0, numOutputRegistersAddress);
 
             // Advance the location for output.
             masm.add32(Imm32(num_saved_registers_ * sizeof(void*)), outputRegistersAddress);
 
             // Prepare temp0 to initialize registers with its value in the next run.
-            masm.loadPtr(Address(masm.getStackPointer(), offsetof(FrameData, inputStartMinusOne)), temp0);
+            masm.loadPtr(Address(MacroAssembler::getStackPointer(), offsetof(FrameData, inputStartMinusOne)), temp0);
 
             if (global_with_zero_length_check()) {
                 // Special case for zero-length matches.
 
                 // The capture start index was loaded into current_character above.
                 masm.branchPtr(Assembler::NotEqual, current_position, current_character,
                                &load_char_start_regexp);
 
@@ -365,17 +365,17 @@ NativeRegExpMacroAssembler::GenerateCode
             masm.jump(&load_char_start_regexp);
         } else {
             if (match_only) {
                 // Store endIndex.
 
                 Register endIndexRegister = temp1;
                 Register inputByteLength = backtrack_stack_pointer;
 
-                masm.loadPtr(Address(masm.getStackPointer(), offsetof(FrameData, endIndex)), endIndexRegister);
+                masm.loadPtr(Address(MacroAssembler::getStackPointer(), offsetof(FrameData, endIndex)), endIndexRegister);
 
                 masm.loadPtr(inputOutputAddress, temp0);
                 masm.loadPtr(Address(temp0, offsetof(InputOutputData, inputEnd)), inputByteLength);
                 masm.subPtr(Address(temp0, offsetof(InputOutputData, inputStart)), inputByteLength);
 
                 masm.loadPtr(register_location(1), temp0);
 
                 // Convert to index from start of string, not end.
@@ -391,17 +391,17 @@ NativeRegExpMacroAssembler::GenerateCode
             masm.movePtr(ImmWord(RegExpRunStatus_Success), temp0);
         }
     }
 
     masm.bind(&exit_label_);
 
     if (global()) {
         // Return the number of successful captures.
-        masm.load32(Address(masm.getStackPointer(), offsetof(FrameData, successfulCaptures)), temp0);
+        masm.load32(Address(MacroAssembler::getStackPointer(), offsetof(FrameData, successfulCaptures)), temp0);
     }
 
     masm.bind(&return_temp0);
 
     // Store the result to the input structure.
     masm.loadPtr(inputOutputAddress, temp1);
     masm.storePtr(temp0, Address(temp1, offsetof(InputOutputData, result)));
 
@@ -578,41 +578,41 @@ NativeRegExpMacroAssembler::Bind(Label* 
 void
 NativeRegExpMacroAssembler::CheckAtStart(Label* on_at_start)
 {
     JitSpew(SPEW_PREFIX "CheckAtStart");
 
     Label not_at_start;
 
     // Did we start the match at the start of the string at all?
-    Address startIndex(masm.getStackPointer(), offsetof(FrameData, startIndex));
+    Address startIndex(MacroAssembler::getStackPointer(), offsetof(FrameData, startIndex));
     masm.branchPtr(Assembler::NotEqual, startIndex, ImmWord(0), &not_at_start);
 
     // If we did, are we still at the start of the input?
     masm.computeEffectiveAddress(BaseIndex(input_end_pointer, current_position, TimesOne), temp0);
 
-    Address inputStart(masm.getStackPointer(), offsetof(FrameData, inputStart));
+    Address inputStart(MacroAssembler::getStackPointer(), offsetof(FrameData, inputStart));
     masm.branchPtr(Assembler::Equal, inputStart, temp0, BranchOrBacktrack(on_at_start));
 
     masm.bind(&not_at_start);
 }
 
 void
 NativeRegExpMacroAssembler::CheckNotAtStart(Label* on_not_at_start)
 {
     JitSpew(SPEW_PREFIX "CheckNotAtStart");
 
     // Did we start the match at the start of the string at all?
-    Address startIndex(masm.getStackPointer(), offsetof(FrameData, startIndex));
+    Address startIndex(MacroAssembler::getStackPointer(), offsetof(FrameData, startIndex));
     masm.branchPtr(Assembler::NotEqual, startIndex, ImmWord(0), BranchOrBacktrack(on_not_at_start));
 
     // If we did, are we still at the start of the input?
     masm.computeEffectiveAddress(BaseIndex(input_end_pointer, current_position, TimesOne), temp0);
 
-    Address inputStart(masm.getStackPointer(), offsetof(FrameData, inputStart));
+    Address inputStart(MacroAssembler::getStackPointer(), offsetof(FrameData, inputStart));
     masm.branchPtr(Assembler::NotEqual, inputStart, temp0, BranchOrBacktrack(on_not_at_start));
 }
 
 void
 NativeRegExpMacroAssembler::CheckCharacter(unsigned c, Label* on_equal)
 {
     JitSpew(SPEW_PREFIX "CheckCharacter(%d)", (int) c);
     masm.branch32(Assembler::Equal, current_character, Imm32(c), BranchOrBacktrack(on_equal));
@@ -1179,27 +1179,27 @@ NativeRegExpMacroAssembler::WriteCurrent
 }
 
 void
 NativeRegExpMacroAssembler::ReadBacktrackStackPointerFromRegister(int reg)
 {
     JitSpew(SPEW_PREFIX "ReadBacktrackStackPointerFromRegister(%d)", reg);
 
     masm.loadPtr(register_location(reg), backtrack_stack_pointer);
-    masm.addPtr(Address(masm.getStackPointer(),
+    masm.addPtr(Address(MacroAssembler::getStackPointer(),
                 offsetof(FrameData, backtrackStackBase)), backtrack_stack_pointer);
 }
 
 void
 NativeRegExpMacroAssembler::WriteBacktrackStackPointerToRegister(int reg)
 {
     JitSpew(SPEW_PREFIX "WriteBacktrackStackPointerToRegister(%d)", reg);
 
     masm.movePtr(backtrack_stack_pointer, temp0);
-    masm.subPtr(Address(masm.getStackPointer(),
+    masm.subPtr(Address(MacroAssembler::getStackPointer(),
                 offsetof(FrameData, backtrackStackBase)), temp0);
     masm.storePtr(temp0, register_location(reg));
 }
 
 void
 NativeRegExpMacroAssembler::SetCurrentPositionFromEnd(int by)
 {
     JitSpew(SPEW_PREFIX "SetCurrentPositionFromEnd(%d)", by);
@@ -1235,17 +1235,17 @@ NativeRegExpMacroAssembler::Succeed()
 }
 
 void
 NativeRegExpMacroAssembler::ClearRegisters(int reg_from, int reg_to)
 {
     JitSpew(SPEW_PREFIX "ClearRegisters(%d, %d)", reg_from, reg_to);
 
     MOZ_ASSERT(reg_from <= reg_to);
-    masm.loadPtr(Address(masm.getStackPointer(), offsetof(FrameData, inputStartMinusOne)), temp0);
+    masm.loadPtr(Address(MacroAssembler::getStackPointer(), offsetof(FrameData, inputStartMinusOne)), temp0);
     for (int reg = reg_from; reg <= reg_to; reg++)
         masm.storePtr(temp0, register_location(reg));
 }
 
 void
 NativeRegExpMacroAssembler::CheckPosition(int cp_offset, Label* on_outside_input)
 {
     JitSpew(SPEW_PREFIX "CheckPosition(%d)", cp_offset);
--- a/js/src/irregexp/NativeRegExpMacroAssembler.h
+++ b/js/src/irregexp/NativeRegExpMacroAssembler.h
@@ -209,17 +209,17 @@ class MOZ_STACK_CLASS NativeRegExpMacroA
     jit::Register current_character;
     jit::Register current_position;
     jit::Register backtrack_stack_pointer;
     jit::Register temp0, temp1, temp2;
 
     // The frame_pointer-relative location of a regexp register.
     jit::Address register_location(int register_index) {
         checkRegister(register_index);
-        return jit::Address(masm.getStackPointer(), register_offset(register_index));
+        return jit::Address(jit::MacroAssembler::getStackPointer(), register_offset(register_index));
     }
 
     int32_t register_offset(int register_index) {
         return sizeof(FrameData) + register_index * sizeof(void*);
     }
 };
 
 } }  // namespace js::irregexp
--- a/js/src/jit/BaselineCacheIRCompiler.cpp
+++ b/js/src/jit/BaselineCacheIRCompiler.cpp
@@ -22,17 +22,17 @@ using namespace js::jit;
 using mozilla::Maybe;
 
 class AutoStubFrame;
 
 Address
 CacheRegisterAllocator::addressOf(MacroAssembler& masm, BaselineFrameSlot slot) const
 {
     uint32_t offset = stackPushed_ + ICStackValueOffset + slot.slot() * sizeof(JS::Value);
-    return Address(masm.getStackPointer(), offset);
+    return Address(jit::MacroAssembler::getStackPointer(), offset);
 }
 
 // BaselineCacheIRCompiler compiles CacheIR to BaselineIC native code.
 class MOZ_RAII BaselineCacheIRCompiler : public CacheIRCompiler
 {
 #ifdef DEBUG
     // Some Baseline IC stubs can be used in IonMonkey through SharedStubs.
     // Those stubs have different machine code, so we need to track whether
@@ -582,17 +582,17 @@ BaselineCacheIRCompiler::emitMegamorphic
     masm.passABIArg(scratch3);
     if (handleMissing)
         masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, (GetNativeDataProperty<true>)));
     else
         masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, (GetNativeDataProperty<false>)));
     masm.mov(ReturnReg, scratch2);
     masm.PopRegsInMask(volatileRegs);
 
-    masm.loadTypedOrValue(Address(masm.getStackPointer(), 0), output);
+    masm.loadTypedOrValue(Address(jit::MacroAssembler::getStackPointer(), 0), output);
     masm.adjustStack(sizeof(Value));
 
     masm.branchIfFalseBool(scratch2, failure->label());
     return true;
 }
 
 bool
 BaselineCacheIRCompiler::emitMegamorphicStoreSlot()
@@ -627,17 +627,17 @@ BaselineCacheIRCompiler::emitMegamorphic
     masm.passABIArg(val.scratchReg());
     if (needsTypeBarrier)
         masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, (SetNativeDataProperty<true>)));
     else
         masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, (SetNativeDataProperty<false>)));
     masm.mov(ReturnReg, scratch1);
     masm.PopRegsInMask(volatileRegs);
 
-    masm.loadValue(Address(masm.getStackPointer(), 0), val);
+    masm.loadValue(Address(jit::MacroAssembler::getStackPointer(), 0), val);
     masm.adjustStack(sizeof(Value));
 
     masm.branchIfFalseBool(scratch1, failure->label());
     return true;
 }
 
 bool
 BaselineCacheIRCompiler::emitGuardHasGetterSetter()
--- a/js/src/jit/BaselineCompiler.cpp
+++ b/js/src/jit/BaselineCompiler.cpp
@@ -926,17 +926,17 @@ BaselineCompiler::emitTraceLoggerResume(
 
 void
 BaselineCompiler::emitProfilerEnterFrame()
 {
     // Store stack position to lastProfilingFrame variable, guarded by a toggled jump.
     // Starts off initially disabled.
     Label noInstrument;
     CodeOffset toggleOffset = masm.toggledJump(&noInstrument);
-    masm.profilerEnterFrame(masm.getStackPointer(), R0.scratchReg());
+    masm.profilerEnterFrame(MacroAssembler::getStackPointer(), R0.scratchReg());
     masm.bind(&noInstrument);
 
     // Store the start offset in the appropriate location.
     MOZ_ASSERT(!profilerEnterFrameToggleOffset_.bound());
     profilerEnterFrameToggleOffset_ = toggleOffset;
 }
 
 void
@@ -4902,17 +4902,17 @@ BaselineCompiler::emit_JSOP_RESUME()
     pushArg(genObj);
 
     if (!callVM(InterpretResumeInfo))
         return false;
 
     // After the generator returns, we restore the stack pointer, push the
     // return value and we're done.
     masm.bind(&returnTarget);
-    masm.computeEffectiveAddress(frame.addressOfStackValue(frame.peek(-1)), masm.getStackPointer());
+    masm.computeEffectiveAddress(frame.addressOfStackValue(frame.peek(-1)), MacroAssembler::getStackPointer());
     frame.popn(2);
     frame.push(R0);
     return true;
 }
 
 typedef bool (*CheckSelfHostedFn)(JSContext*, HandleValue);
 static const VMFunction CheckSelfHostedInfo =
     FunctionInfo<CheckSelfHostedFn>(js::Debug_CheckSelfHosted, "Debug_CheckSelfHosted");
--- a/js/src/jit/BaselineIC.cpp
+++ b/js/src/jit/BaselineIC.cpp
@@ -184,17 +184,17 @@ ICWarmUpCounter_Fallback::Compiler::gene
     // Push a stub frame so that we can perform a non-tail call.
     enterStubFrame(masm, R1.scratchReg());
 
     Label noCompiledCode;
     // Call DoWarmUpCounterFallbackOSR to compile/check-for Ion-compiled function
     {
         // Push IonOsrTempData pointer storage
         masm.subFromStackPtr(Imm32(sizeof(void*)));
-        masm.push(masm.getStackPointer());
+        masm.push(MacroAssembler::getStackPointer());
 
         // Push stub pointer.
         masm.push(ICStubReg);
 
         pushStubPayload(masm, R0.scratchReg());
 
         if (!callVM(DoWarmUpCounterFallbackOSRInfo, masm))
             return false;
@@ -736,22 +736,22 @@ ICGetElem_Fallback::Compiler::generateSt
     // Super property getters use a |this| that differs from base object
     if (hasReceiver_) {
         // State: index in R0, receiver in R1, obj on the stack
 
         // Ensure stack is fully synced for the expression decompiler.
         // We need: index, receiver, obj
         masm.pushValue(R0);
         masm.pushValue(R1);
-        masm.pushValue(Address(masm.getStackPointer(), sizeof(Value) * 2));
+        masm.pushValue(Address(MacroAssembler::getStackPointer(), sizeof(Value) * 2));
 
         // Push arguments.
         masm.pushValue(R0); // Index
         masm.pushValue(R1); // Reciver
-        masm.pushValue(Address(masm.getStackPointer(), sizeof(Value) * 5)); // Obj
+        masm.pushValue(Address(MacroAssembler::getStackPointer(), sizeof(Value) * 5)); // Obj
         masm.push(ICStubReg);
         pushStubPayload(masm, R0.scratchReg());
 
         return tailCallVM(DoGetElemSuperFallbackInfo, masm);
     }
 
     // Ensure stack is fully synced for the expression decompiler.
     masm.pushValue(R0);
@@ -938,32 +938,32 @@ ICSetElem_Fallback::Compiler::generateSt
 
     EmitRestoreTailCallReg(masm);
 
     // State: R0: object, R1: index, stack: rhs.
     // For the decompiler, the stack has to be: object, index, rhs,
     // so we push the index, then overwrite the rhs Value with R0
     // and push the rhs value.
     masm.pushValue(R1);
-    masm.loadValue(Address(masm.getStackPointer(), sizeof(Value)), R1);
-    masm.storeValue(R0, Address(masm.getStackPointer(), sizeof(Value)));
+    masm.loadValue(Address(MacroAssembler::getStackPointer(), sizeof(Value)), R1);
+    masm.storeValue(R0, Address(MacroAssembler::getStackPointer(), sizeof(Value)));
     masm.pushValue(R1);
 
     // Push arguments.
     masm.pushValue(R1); // RHS
 
     // Push index. On x86 and ARM two push instructions are emitted so use a
     // separate register to store the old stack pointer.
     masm.moveStackPtrTo(R1.scratchReg());
     masm.pushValue(Address(R1.scratchReg(), 2 * sizeof(Value)));
     masm.pushValue(R0); // Object.
 
     // Push pointer to stack values, so that the stub can overwrite the object
     // (pushed for the decompiler) with the rhs.
-    masm.computeEffectiveAddress(Address(masm.getStackPointer(), 3 * sizeof(Value)), R0.scratchReg());
+    masm.computeEffectiveAddress(Address(MacroAssembler::getStackPointer(), 3 * sizeof(Value)), R0.scratchReg());
     masm.push(R0.scratchReg());
 
     masm.push(ICStubReg);
     pushStubPayload(masm, R0.scratchReg());
 
     return tailCallVM(DoSetElemFallbackInfo, masm);
 }
 
@@ -1605,26 +1605,26 @@ ICSetProp_Fallback::Compiler::generateSt
     MOZ_ASSERT(engine_ == Engine::Baseline);
     MOZ_ASSERT(R0 == JSReturnOperand);
 
     EmitRestoreTailCallReg(masm);
 
     // Ensure stack is fully synced for the expression decompiler.
     // Overwrite the RHS value on top of the stack with the object, then push
     // the RHS in R1 on top of that.
-    masm.storeValue(R0, Address(masm.getStackPointer(), 0));
+    masm.storeValue(R0, Address(MacroAssembler::getStackPointer(), 0));
     masm.pushValue(R1);
 
     // Push arguments.
     masm.pushValue(R1);
     masm.pushValue(R0);
 
     // Push pointer to stack values, so that the stub can overwrite the object
     // (pushed for the decompiler) with the RHS.
-    masm.computeEffectiveAddress(Address(masm.getStackPointer(), 2 * sizeof(Value)),
+    masm.computeEffectiveAddress(Address(MacroAssembler::getStackPointer(), 2 * sizeof(Value)),
                                  R0.scratchReg());
     masm.push(R0.scratchReg());
 
     masm.push(ICStubReg);
     pushStubPayload(masm, R0.scratchReg());
 
     if (!tailCallVM(DoSetPropFallbackInfo, masm))
         return false;
@@ -2515,17 +2515,17 @@ ICCallStubCompiler::pushCallArguments(Ma
     }
     masm.bind(&done);
 }
 
 void
 ICCallStubCompiler::guardSpreadCall(MacroAssembler& masm, Register argcReg, Label* failure,
                                     bool isConstructing)
 {
-    masm.unboxObject(Address(masm.getStackPointer(),
+    masm.unboxObject(Address(MacroAssembler::getStackPointer(),
                      isConstructing * sizeof(Value) + ICStackValueOffset), argcReg);
     masm.loadPtr(Address(argcReg, NativeObject::offsetOfElements()), argcReg);
     masm.load32(Address(argcReg, ObjectElements::offsetOfLength()), argcReg);
 
     // Limit actual argc to something reasonable (huge number of arguments can
     // blow the stack limit).
     static_assert(ICCall_Scripted::MAX_ARGS_SPREAD_LENGTH <= ARGS_LENGTH_MAX,
                   "maximum arguments length for optimized stub should be <= ARGS_LENGTH_MAX");
@@ -2536,17 +2536,17 @@ ICCallStubCompiler::guardSpreadCall(Macr
 void
 ICCallStubCompiler::pushSpreadCallArguments(MacroAssembler& masm,
                                             AllocatableGeneralRegisterSet regs,
                                             Register argcReg, bool isJitCall,
                                             bool isConstructing)
 {
     // Pull the array off the stack before aligning.
     Register startReg = regs.takeAny();
-    masm.unboxObject(Address(masm.getStackPointer(),
+    masm.unboxObject(Address(MacroAssembler::getStackPointer(),
                              (isConstructing * sizeof(Value)) + STUB_FRAME_SIZE), startReg);
     masm.loadPtr(Address(startReg, NativeObject::offsetOfElements()), startReg);
 
     // Align the stack such that the JitFrameLayout is aligned on the
     // JitStackAlignment.
     if (isJitCall) {
         Register alignReg = argcReg;
         if (isConstructing) {
@@ -2596,17 +2596,17 @@ ICCallStubCompiler::guardFunApply(MacroA
                                   Label* failure)
 {
     // Ensure argc == 2
     masm.branch32(Assembler::NotEqual, argcReg, Imm32(2), failure);
 
     // Stack looks like:
     //      [..., CalleeV, ThisV, Arg0V, Arg1V <MaybeReturnReg>]
 
-    Address secondArgSlot(masm.getStackPointer(), ICStackValueOffset);
+    Address secondArgSlot(MacroAssembler::getStackPointer(), ICStackValueOffset);
     if (applyThing == FunApply_MagicArgs) {
         // Ensure that the second arg is magic arguments.
         masm.branchTestMagic(Assembler::NotEqual, secondArgSlot, failure);
 
         // Ensure that this frame doesn't have an arguments object.
         masm.branchTest32(Assembler::NonZero,
                           Address(BaselineFrameReg, BaselineFrame::reverseOffsetOfFlags()),
                           Imm32(BaselineFrame::HAS_ARGS_OBJ),
@@ -2669,31 +2669,31 @@ ICCallStubCompiler::guardFunApply(MacroA
         masm.bind(&endLoop);
     }
 
     // Stack now confirmed to be like:
     //      [..., CalleeV, ThisV, Arg0V, MagicValue(Arguments), <MaybeReturnAddr>]
 
     // Load the callee, ensure that it's fun_apply
     ValueOperand val = regs.takeAnyValue();
-    Address calleeSlot(masm.getStackPointer(), ICStackValueOffset + (3 * sizeof(Value)));
+    Address calleeSlot(MacroAssembler::getStackPointer(), ICStackValueOffset + (3 * sizeof(Value)));
     masm.loadValue(calleeSlot, val);
 
     masm.branchTestObject(Assembler::NotEqual, val, failure);
     Register callee = masm.extractObject(val, ExtractTemp1);
 
     masm.branchTestObjClass(Assembler::NotEqual, callee, &JSFunction::class_, regs.getAny(),
                             callee, failure);
     masm.loadPtr(Address(callee, JSFunction::offsetOfNativeOrEnv()), callee);
 
     masm.branchPtr(Assembler::NotEqual, callee, ImmPtr(fun_apply), failure);
 
     // Load the |thisv|, ensure that it's a scripted function with a valid baseline or ion
     // script, or a native function.
-    Address thisSlot(masm.getStackPointer(), ICStackValueOffset + (2 * sizeof(Value)));
+    Address thisSlot(MacroAssembler::getStackPointer(), ICStackValueOffset + (2 * sizeof(Value)));
     masm.loadValue(thisSlot, val);
 
     masm.branchTestObject(Assembler::NotEqual, val, failure);
     Register target = masm.extractObject(val, ExtractTemp1);
     regs.add(val);
     regs.takeUnchecked(target);
 
     masm.branchTestObjClass(Assembler::NotEqual, target, &JSFunction::class_, regs.getAny(),
@@ -2798,17 +2798,17 @@ ICCall_Fallback::Compiler::generateStubC
         masm.pushValue(Address(BaselineFrameReg, valueOffset++ * sizeof(Value) + STUB_FRAME_SIZE));
 
         // this
         masm.pushValue(Address(BaselineFrameReg, valueOffset++ * sizeof(Value) + STUB_FRAME_SIZE));
 
         // callee
         masm.pushValue(Address(BaselineFrameReg, valueOffset++ * sizeof(Value) + STUB_FRAME_SIZE));
 
-        masm.push(masm.getStackPointer());
+        masm.push(MacroAssembler::getStackPointer());
         masm.push(ICStubReg);
 
         PushStubPayload(masm, R0.scratchReg());
 
         if (!callVM(DoSpreadCallFallbackInfo, masm))
             return false;
 
         leaveStubFrame(masm);
@@ -2821,17 +2821,17 @@ ICCall_Fallback::Compiler::generateStubC
 
     // Push a stub frame so that we can perform a non-tail call.
     enterStubFrame(masm, R1.scratchReg());
 
     regs.take(R0.scratchReg()); // argc.
 
     pushCallArguments(masm, regs, R0.scratchReg(), /* isJitCall = */ false, isConstructing_);
 
-    masm.push(masm.getStackPointer());
+    masm.push(MacroAssembler::getStackPointer());
     masm.push(R0.scratchReg());
     masm.push(ICStubReg);
 
     PushStubPayload(masm, R0.scratchReg());
 
     if (!callVM(DoCallFallbackInfo, masm))
         return false;
 
@@ -2842,17 +2842,17 @@ ICCall_Fallback::Compiler::generateStubC
     // Ion inlined frames. The return address pushed onto reconstructed stack
     // will point here.
     assumeStubFrame();
     bailoutReturnOffset_.bind(masm.currentOffset());
 
     // Load passed-in ThisV into R1 just in case it's needed.  Need to do this before
     // we leave the stub frame since that info will be lost.
     // Current stack:  [...., ThisV, ActualArgc, CalleeToken, Descriptor ]
-    masm.loadValue(Address(masm.getStackPointer(), 3 * sizeof(size_t)), R1);
+    masm.loadValue(Address(MacroAssembler::getStackPointer(), 3 * sizeof(size_t)), R1);
 
     leaveStubFrame(masm, true);
 
     // If this is a |constructing| call, if the callee returns a non-object, we replace it with
     // the |this| object passed in.
     if (isConstructing_) {
         MOZ_ASSERT(JSReturnOperand == R0);
         Label skipThisReplace;
@@ -2911,21 +2911,21 @@ ICCallScriptedCompiler::generateStubCode
 
     if (isSpread_)
         guardSpreadCall(masm, argcReg, &failure, isConstructing_);
 
     // Load the callee in R1, accounting for newTarget, if necessary
     // Stack Layout: [ ..., CalleeVal, ThisVal, Arg0Val, ..., ArgNVal, [newTarget] +ICStackValueOffset+ ]
     if (isSpread_) {
         unsigned skipToCallee = (2 + isConstructing_) * sizeof(Value);
-        masm.loadValue(Address(masm.getStackPointer(), skipToCallee + ICStackValueOffset), R1);
+        masm.loadValue(Address(MacroAssembler::getStackPointer(), skipToCallee + ICStackValueOffset), R1);
     } else {
         // Account for newTarget, if necessary
         unsigned nonArgsSkip = (1 + isConstructing_) * sizeof(Value);
-        BaseValueIndex calleeSlot(masm.getStackPointer(), argcReg, ICStackValueOffset + nonArgsSkip);
+        BaseValueIndex calleeSlot(MacroAssembler::getStackPointer(), argcReg, ICStackValueOffset + nonArgsSkip);
         masm.loadValue(calleeSlot, R1);
     }
     regs.take(R1);
 
     // Ensure callee is an object.
     masm.branchTestObject(Assembler::NotEqual, R1, &failure);
 
     // Ensure callee is a function.
@@ -2971,26 +2971,26 @@ ICCallScriptedCompiler::generateStubCode
         regs.add(ICTailCallReg);
 
     if (isConstructing_) {
         // Save argc before call.
         masm.push(argcReg);
 
         // Stack now looks like:
         //      [..., Callee, ThisV, Arg0V, ..., ArgNV, NewTarget, StubFrameHeader, ArgC ]
-        masm.loadValue(Address(masm.getStackPointer(), STUB_FRAME_SIZE + sizeof(size_t)), R1);
+        masm.loadValue(Address(MacroAssembler::getStackPointer(), STUB_FRAME_SIZE + sizeof(size_t)), R1);
         masm.push(masm.extractObject(R1, ExtractTemp0));
 
         if (isSpread_) {
-            masm.loadValue(Address(masm.getStackPointer(),
+            masm.loadValue(Address(MacroAssembler::getStackPointer(),
                                    3 * sizeof(Value) + STUB_FRAME_SIZE + sizeof(size_t) +
                                    sizeof(JSObject*)),
                                    R1);
         } else {
-            BaseValueIndex calleeSlot2(masm.getStackPointer(), argcReg,
+            BaseValueIndex calleeSlot2(MacroAssembler::getStackPointer(), argcReg,
                                        2 * sizeof(Value) + STUB_FRAME_SIZE + sizeof(size_t) +
                                        sizeof(JSObject*));
             masm.loadValue(calleeSlot2, R1);
         }
         masm.push(masm.extractObject(R1, ExtractTemp0));
         if (!callVM(CreateThisInfoBaseline, masm))
             return false;
 
@@ -3012,40 +3012,40 @@ ICCallScriptedCompiler::generateStubCode
         // Restore saved argc so we can use it to calculate the address to save
         // the resulting this object to.
         masm.pop(argcReg);
 
         // Save "this" value back into pushed arguments on stack.  R0 can be clobbered after that.
         // Stack now looks like:
         //      [..., Callee, ThisV, Arg0V, ..., ArgNV, [NewTarget], StubFrameHeader ]
         if (isSpread_) {
-            masm.storeValue(R0, Address(masm.getStackPointer(),
+            masm.storeValue(R0, Address(MacroAssembler::getStackPointer(),
                                         (1 + isConstructing_) * sizeof(Value) + STUB_FRAME_SIZE));
         } else {
-            BaseValueIndex thisSlot(masm.getStackPointer(), argcReg,
+            BaseValueIndex thisSlot(MacroAssembler::getStackPointer(), argcReg,
                                     STUB_FRAME_SIZE + isConstructing_ * sizeof(Value));
             masm.storeValue(R0, thisSlot);
         }
 
         // Restore the stub register from the baseline stub frame.
-        masm.loadPtr(Address(masm.getStackPointer(), STUB_FRAME_SAVED_STUB_OFFSET), ICStubReg);
+        masm.loadPtr(Address(MacroAssembler::getStackPointer(), STUB_FRAME_SAVED_STUB_OFFSET), ICStubReg);
 
         // Reload callee script. Note that a GC triggered by CreateThis may
         // have destroyed the callee BaselineScript and IonScript. CreateThis
         // is safely repeatable though, so in this case we just leave the stub
         // frame and jump to the next stub.
 
         // Just need to load the script now.
         if (isSpread_) {
             unsigned skipForCallee = (2 + isConstructing_) * sizeof(Value);
-            masm.loadValue(Address(masm.getStackPointer(), skipForCallee + STUB_FRAME_SIZE), R0);
+            masm.loadValue(Address(MacroAssembler::getStackPointer(), skipForCallee + STUB_FRAME_SIZE), R0);
         } else {
             // Account for newTarget, if necessary
             unsigned nonArgsSkip = (1 + isConstructing_) * sizeof(Value);
-            BaseValueIndex calleeSlot3(masm.getStackPointer(), argcReg, nonArgsSkip + STUB_FRAME_SIZE);
+            BaseValueIndex calleeSlot3(MacroAssembler::getStackPointer(), argcReg, nonArgsSkip + STUB_FRAME_SIZE);
             masm.loadValue(calleeSlot3, R0);
         }
         callee = masm.extractObject(R0, ExtractTemp0);
         regs.add(R0);
         regs.takeUnchecked(callee);
 
         code = regs.takeAny();
         masm.loadJitCodeRaw(callee, code);
@@ -3108,29 +3108,29 @@ ICCallScriptedCompiler::generateStubCode
         //                  Padding?, ARGVALS..., ThisVal, ActualArgc, Callee, Descriptor ]
 
         // Restore the BaselineFrameReg based on the frame descriptor.
         //
         // BaselineFrameReg = BaselineStackReg
         //                  + sizeof(Descriptor) + sizeof(Callee) + sizeof(ActualArgc)
         //                  + stubFrameSize(Descriptor)
         //                  - sizeof(ICStubReg) - sizeof(BaselineFrameReg)
-        Address descriptorAddr(masm.getStackPointer(), 0);
+        Address descriptorAddr(MacroAssembler::getStackPointer(), 0);
         masm.loadPtr(descriptorAddr, BaselineFrameReg);
         masm.rshiftPtr(Imm32(FRAMESIZE_SHIFT), BaselineFrameReg);
         masm.addPtr(Imm32((3 - 2) * sizeof(size_t)), BaselineFrameReg);
         masm.addStackPtrTo(BaselineFrameReg);
 
         // Load the number of arguments present before the stub frame.
         Register argcReg = JSReturnOperand.scratchReg();
         if (isSpread_) {
             // Account for the Array object.
             masm.move32(Imm32(1), argcReg);
         } else {
-            Address argcAddr(masm.getStackPointer(), 2 * sizeof(size_t));
+            Address argcAddr(MacroAssembler::getStackPointer(), 2 * sizeof(size_t));
             masm.loadPtr(argcAddr, argcReg);
         }
 
         // Current stack: [ ThisVal, ARGVALS..., ...STUB FRAME..., <-- BaselineFrameReg
         //                  Padding?, ARGVALS..., ThisVal, ActualArgc, Callee, Descriptor ]
         //
         // &ThisVal = BaselineFrameReg + argc * sizeof(Value) + STUB_FRAME_SIZE + sizeof(Value)
         // This last sizeof(Value) accounts for the newTarget on the end of the arguments vector
@@ -3175,17 +3175,17 @@ ICCall_ConstStringSplit::Compiler::gener
     masm.branch32(Assembler::Equal, argcReg, Imm32(2), &twoArg);
     masm.assumeUnreachable("Expected argc == 2");
     masm.bind(&twoArg);
 #endif
     Register scratchReg = regs.takeAny();
 
     // Guard that callee is native function js::intrinsic_StringSplitString.
     {
-        Address calleeAddr(masm.getStackPointer(), ICStackValueOffset + CALLEE_DEPTH);
+        Address calleeAddr(MacroAssembler::getStackPointer(), ICStackValueOffset + CALLEE_DEPTH);
         ValueOperand calleeVal = regs.takeAnyValue();
 
         // Ensure that callee is an object.
         masm.loadValue(calleeAddr, calleeVal);
         masm.branchTestObject(Assembler::NotEqual, calleeVal, &failureRestoreArgc);
 
         // Ensure that callee is a function.
         Register calleeObj = masm.extractObject(calleeVal, ExtractTemp0);
@@ -3198,32 +3198,32 @@ ICCall_ConstStringSplit::Compiler::gener
                        &failureRestoreArgc);
 
         regs.add(calleeVal);
     }
 
     // Guard sep.
     {
         // Ensure that sep is a string.
-        Address sepAddr(masm.getStackPointer(), ICStackValueOffset + SEP_DEPTH);
+        Address sepAddr(MacroAssembler::getStackPointer(), ICStackValueOffset + SEP_DEPTH);
         ValueOperand sepVal = regs.takeAnyValue();
 
         masm.loadValue(sepAddr, sepVal);
         masm.branchTestString(Assembler::NotEqual, sepVal, &failureRestoreArgc);
 
         Register sep = masm.extractString(sepVal, ExtractTemp0);
         masm.branchPtr(Assembler::NotEqual, Address(ICStubReg, offsetOfExpectedSep()),
                        sep, &failureRestoreArgc);
         regs.add(sepVal);
     }
 
     // Guard str.
     {
         // Ensure that str is a string.
-        Address strAddr(masm.getStackPointer(), ICStackValueOffset + STR_DEPTH);
+        Address strAddr(MacroAssembler::getStackPointer(), ICStackValueOffset + STR_DEPTH);
         ValueOperand strVal = regs.takeAnyValue();
 
         masm.loadValue(strAddr, strVal);
         masm.branchTestString(Assembler::NotEqual, strVal, &failureRestoreArgc);
 
         Register str = masm.extractString(strVal, ExtractTemp0);
         masm.branchPtr(Assembler::NotEqual, Address(ICStubReg, offsetOfExpectedStr()),
                        str, &failureRestoreArgc);
@@ -3262,17 +3262,17 @@ ICCall_IsSuspendedGenerator::Compiler::g
 
     // The IsSuspendedGenerator intrinsic is only called in self-hosted code,
     // so it's safe to assume we have a single argument and the callee is our
     // intrinsic.
 
     AllocatableGeneralRegisterSet regs(availableGeneralRegs(0));
 
     // Load the argument.
-    Address argAddr(masm.getStackPointer(), ICStackValueOffset);
+    Address argAddr(MacroAssembler::getStackPointer(), ICStackValueOffset);
     ValueOperand argVal = regs.takeAnyValue();
     masm.loadValue(argAddr, argVal);
 
     // Check if it's an object.
     Label returnFalse;
     Register genObj = regs.takeAny();
     masm.branchTestObject(Assembler::NotEqual, argVal, &returnFalse);
     masm.unboxObject(argVal, genObj);
@@ -3313,20 +3313,20 @@ ICCall_Native::Compiler::generateStubCod
     regs.takeUnchecked(ICTailCallReg);
 
     if (isSpread_)
         guardSpreadCall(masm, argcReg, &failure, isConstructing_);
 
     // Load the callee in R1.
     if (isSpread_) {
         unsigned skipToCallee = (2 + isConstructing_) * sizeof(Value);
-        masm.loadValue(Address(masm.getStackPointer(), skipToCallee + ICStackValueOffset), R1);
+        masm.loadValue(Address(MacroAssembler::getStackPointer(), skipToCallee + ICStackValueOffset), R1);
     } else {
         unsigned nonArgsSlots = (1 + isConstructing_) * sizeof(Value);
-        BaseValueIndex calleeSlot(masm.getStackPointer(), argcReg, ICStackValueOffset + nonArgsSlots);
+        BaseValueIndex calleeSlot(MacroAssembler::getStackPointer(), argcReg, ICStackValueOffset + nonArgsSlots);
         masm.loadValue(calleeSlot, R1);
     }
     regs.take(R1);
 
     masm.branchTestObject(Assembler::NotEqual, R1, &failure);
 
     // Ensure callee matches this stub's callee.
     Register callee = masm.extractObject(R1, ExtractTemp0);
@@ -3390,17 +3390,17 @@ ICCall_Native::Compiler::generateStubCod
         masm.callWithABI(Address(callee, JSFunction::offsetOfNative()));
     }
 #endif
 
     // Test for failure.
     masm.branchIfFalseBool(ReturnReg, masm.exceptionLabel());
 
     // Load the return value into R0.
-    masm.loadValue(Address(masm.getStackPointer(), NativeExitFrameLayout::offsetOfResult()), R0);
+    masm.loadValue(Address(MacroAssembler::getStackPointer(), NativeExitFrameLayout::offsetOfResult()), R0);
 
     leaveStubFrame(masm);
 
     // Enter type monitor IC to type-check result.
     EmitEnterTypeMonitorIC(masm);
 
     masm.bind(&failure);
     EmitStubGuardFailure(masm);
@@ -3416,17 +3416,17 @@ ICCall_ClassHook::Compiler::generateStub
     AllocatableGeneralRegisterSet regs(availableGeneralRegs(0));
 
     Register argcReg = R0.scratchReg();
     regs.take(argcReg);
     regs.takeUnchecked(ICTailCallReg);
 
     // Load the callee in R1.
     unsigned nonArgSlots = (1 + isConstructing_) * sizeof(Value);
-    BaseValueIndex calleeSlot(masm.getStackPointer(), argcReg, ICStackValueOffset + nonArgSlots);
+    BaseValueIndex calleeSlot(MacroAssembler::getStackPointer(), argcReg, ICStackValueOffset + nonArgSlots);
     masm.loadValue(calleeSlot, R1);
     regs.take(R1);
 
     masm.branchTestObject(Assembler::NotEqual, R1, &failure);
 
     // Ensure the callee's class matches the one in this stub.
     // We use |Address(ICStubReg, ICCall_ClassHook::offsetOfNative())| below
     // instead of extracting the hook from callee. As a result the callee
@@ -3477,17 +3477,17 @@ ICCall_ClassHook::Compiler::generateStub
     masm.passABIArg(argcReg);
     masm.passABIArg(vpReg);
     masm.callWithABI(Address(ICStubReg, ICCall_ClassHook::offsetOfNative()));
 
     // Test for failure.
     masm.branchIfFalseBool(ReturnReg, masm.exceptionLabel());
 
     // Load the return value into R0.
-    masm.loadValue(Address(masm.getStackPointer(), NativeExitFrameLayout::offsetOfResult()), R0);
+    masm.loadValue(Address(MacroAssembler::getStackPointer(), NativeExitFrameLayout::offsetOfResult()), R0);
 
     leaveStubFrame(masm);
 
     // Enter type monitor IC to type-check result.
     EmitEnterTypeMonitorIC(masm);
 
     masm.bind(&failure);
     EmitStubGuardFailure(masm);
@@ -3686,31 +3686,31 @@ ICCall_ScriptedFunCall::Compiler::genera
     bool canUseTailCallReg = regs.has(ICTailCallReg);
 
     Register argcReg = R0.scratchReg();
     regs.take(argcReg);
     regs.takeUnchecked(ICTailCallReg);
 
     // Load the callee in R1.
     // Stack Layout: [ ..., CalleeVal, ThisVal, Arg0Val, ..., ArgNVal, +ICStackValueOffset+ ]
-    BaseValueIndex calleeSlot(masm.getStackPointer(), argcReg, ICStackValueOffset + sizeof(Value));
+    BaseValueIndex calleeSlot(MacroAssembler::getStackPointer(), argcReg, ICStackValueOffset + sizeof(Value));
     masm.loadValue(calleeSlot, R1);
     regs.take(R1);
 
     // Ensure callee is fun_call.
     masm.branchTestObject(Assembler::NotEqual, R1, &failure);
 
     Register callee = masm.extractObject(R1, ExtractTemp0);
     masm.branchTestObjClass(Assembler::NotEqual, callee, &JSFunction::class_, regs.getAny(),
                             callee, &failure);
     masm.loadPtr(Address(callee, JSFunction::offsetOfNativeOrEnv()), callee);
     masm.branchPtr(Assembler::NotEqual, callee, ImmPtr(fun_call), &failure);
 
     // Ensure |this| is a function with a jit entry.
-    BaseIndex thisSlot(masm.getStackPointer(), argcReg, TimesEight, ICStackValueOffset);
+    BaseIndex thisSlot(MacroAssembler::getStackPointer(), argcReg, TimesEight, ICStackValueOffset);
     masm.loadValue(thisSlot, R1);
 
     masm.branchTestObject(Assembler::NotEqual, R1, &failure);
     callee = masm.extractObject(R1, ExtractTemp0);
 
     masm.branchTestObjClass(Assembler::NotEqual, callee, &JSFunction::class_, regs.getAny(),
                             callee, &failure);
     masm.branchIfFunctionHasNoJitEntry(callee, /* constructing */ false, &failure);
--- a/js/src/jit/CacheIRCompiler.cpp
+++ b/js/src/jit/CacheIRCompiler.cpp
@@ -154,23 +154,23 @@ CacheRegisterAllocator::useRegister(Macr
         return reg;
       }
 
       case OperandLocation::ValueStack: {
         // The value is on the stack, but boxed. If it's on top of the stack we
         // unbox it and then remove it from the stack, else we just unbox.
         Register reg = allocateRegister(masm);
         if (loc.valueStack() == stackPushed_) {
-            masm.unboxNonDouble(Address(masm.getStackPointer(), 0), reg, typedId.type());
+            masm.unboxNonDouble(Address(MacroAssembler::getStackPointer(), 0), reg, typedId.type());
             masm.addToStackPtr(Imm32(sizeof(js::Value)));
             MOZ_ASSERT(stackPushed_ >= sizeof(js::Value));
             stackPushed_ -= sizeof(js::Value);
         } else {
             MOZ_ASSERT(loc.valueStack() < stackPushed_);
-            masm.unboxNonDouble(Address(masm.getStackPointer(), stackPushed_ - loc.valueStack()),
+            masm.unboxNonDouble(Address(MacroAssembler::getStackPointer(), stackPushed_ - loc.valueStack()),
                                 reg, typedId.type());
         }
         loc.setPayloadReg(reg, typedId.type());
         return reg;
       }
 
       case OperandLocation::BaselineFrame: {
         Register reg = allocateRegister(masm);
@@ -567,33 +567,33 @@ void
 CacheRegisterAllocator::spillOperandToStack(MacroAssembler& masm, OperandLocation* loc)
 {
     MOZ_ASSERT(loc >= operandLocations_.begin() && loc < operandLocations_.end());
 
     if (loc->kind() == OperandLocation::ValueReg) {
         if (!freeValueSlots_.empty()) {
             uint32_t stackPos = freeValueSlots_.popCopy();
             MOZ_ASSERT(stackPos <= stackPushed_);
-            masm.storeValue(loc->valueReg(), Address(masm.getStackPointer(),
+            masm.storeValue(loc->valueReg(), Address(MacroAssembler::getStackPointer(),
                                                      stackPushed_ - stackPos));
             loc->setValueStack(stackPos);
             return;
         }
         stackPushed_ += sizeof(js::Value);
         masm.pushValue(loc->valueReg());
         loc->setValueStack(stackPushed_);
         return;
     }
 
     MOZ_ASSERT(loc->kind() == OperandLocation::PayloadReg);
 
     if (!freePayloadSlots_.empty()) {
         uint32_t stackPos = freePayloadSlots_.popCopy();
         MOZ_ASSERT(stackPos <= stackPushed_);
-        masm.storePtr(loc->payloadReg(), Address(masm.getStackPointer(),
+        masm.storePtr(loc->payloadReg(), Address(MacroAssembler::getStackPointer(),
                                                  stackPushed_ - stackPos));
         loc->setPayloadStack(stackPos, loc->payloadType());
         return;
     }
     stackPushed_ += sizeof(uintptr_t);
     masm.push(loc->payloadReg());
     loc->setPayloadStack(stackPushed_, loc->payloadType());
 }
@@ -634,17 +634,17 @@ CacheRegisterAllocator::popPayload(Macro
 
     // The payload is on the stack. If it's on top of the stack we can just
     // pop it, else we emit a load.
     if (loc->payloadStack() == stackPushed_) {
         masm.pop(dest);
         stackPushed_ -= sizeof(uintptr_t);
     } else {
         MOZ_ASSERT(loc->payloadStack() < stackPushed_);
-        masm.loadPtr(Address(masm.getStackPointer(), stackPushed_ - loc->payloadStack()), dest);
+        masm.loadPtr(Address(MacroAssembler::getStackPointer(), stackPushed_ - loc->payloadStack()), dest);
         masm.propagateOOM(freePayloadSlots_.append(loc->payloadStack()));
     }
 
     loc->setPayloadReg(dest, loc->payloadType());
 }
 
 void
 CacheRegisterAllocator::popValue(MacroAssembler& masm, OperandLocation* loc, ValueOperand dest)
@@ -654,17 +654,17 @@ CacheRegisterAllocator::popValue(MacroAs
 
     // The Value is on the stack. If it's on top of the stack we can just
     // pop it, else we emit a load.
     if (loc->valueStack() == stackPushed_) {
         masm.popValue(dest);
         stackPushed_ -= sizeof(js::Value);
     } else {
         MOZ_ASSERT(loc->valueStack() < stackPushed_);
-        masm.loadValue(Address(masm.getStackPointer(), stackPushed_ - loc->valueStack()), dest);
+        masm.loadValue(Address(MacroAssembler::getStackPointer(), stackPushed_ - loc->valueStack()), dest);
         masm.propagateOOM(freeValueSlots_.append(loc->valueStack()));
     }
 
     loc->setValueReg(dest);
 }
 
 bool
 OperandLocation::aliasesReg(const OperandLocation& other) const
@@ -751,17 +751,17 @@ CacheRegisterAllocator::restoreInputStat
                 MOZ_ASSERT(cur.payloadType() == dest.payloadType());
                 popPayload(masm, &cur, dest.payloadReg());
                 continue;
               }
               case OperandLocation::ValueStack:
                 MOZ_ASSERT(stackPushed_ >= sizeof(js::Value));
                 MOZ_ASSERT(cur.valueStack() <= stackPushed_);
                 MOZ_ASSERT(dest.payloadType() != JSVAL_TYPE_DOUBLE);
-                masm.unboxNonDouble(Address(masm.getStackPointer(), stackPushed_ - cur.valueStack()),
+                masm.unboxNonDouble(Address(MacroAssembler::getStackPointer(), stackPushed_ - cur.valueStack()),
                                     dest.payloadReg(), dest.payloadType());
                 continue;
               case OperandLocation::Constant:
               case OperandLocation::BaselineFrame:
               case OperandLocation::DoubleReg:
               case OperandLocation::Uninitialized:
                 break;
             }
@@ -779,17 +779,17 @@ CacheRegisterAllocator::restoreInputStat
     for (const SpilledRegister& spill : spilledRegs_) {
         MOZ_ASSERT(stackPushed_ >= sizeof(uintptr_t));
 
         if (spill.stackPushed == stackPushed_) {
             masm.pop(spill.reg);
             stackPushed_ -= sizeof(uintptr_t);
         } else {
             MOZ_ASSERT(spill.stackPushed < stackPushed_);
-            masm.loadPtr(Address(masm.getStackPointer(), stackPushed_ - spill.stackPushed),
+            masm.loadPtr(Address(MacroAssembler::getStackPointer(), stackPushed_ - spill.stackPushed),
                          spill.reg);
         }
     }
 
     if (shouldDiscardStack)
         discardStack(masm);
 }
 
@@ -2702,17 +2702,17 @@ CacheIRCompiler::emitMegamorphicLoadSlot
     Label ok;
     uint32_t framePushed = masm.framePushed();
     masm.branchIfTrueBool(scratch, &ok);
     masm.adjustStack(sizeof(Value));
     masm.jump(failure->label());
 
     masm.bind(&ok);
     masm.setFramePushed(framePushed);
-    masm.loadTypedOrValue(Address(masm.getStackPointer(), 0), output);
+    masm.loadTypedOrValue(Address(MacroAssembler::getStackPointer(), 0), output);
     masm.adjustStack(sizeof(Value));
     return true;
 }
 
 bool
 CacheIRCompiler::emitMegamorphicHasPropResult()
 {
     AutoOutputRegister output(*this);
@@ -2754,17 +2754,17 @@ CacheIRCompiler::emitMegamorphicHasPropR
     Label ok;
     uint32_t framePushed = masm.framePushed();
     masm.branchIfTrueBool(scratch, &ok);
     masm.adjustStack(sizeof(Value));
     masm.jump(failure->label());
 
     masm.bind(&ok);
     masm.setFramePushed(framePushed);
-    masm.loadTypedOrValue(Address(masm.getStackPointer(), 0), output);
+    masm.loadTypedOrValue(Address(MacroAssembler::getStackPointer(), 0), output);
     masm.adjustStack(sizeof(Value));
     return true;
 }
 
 bool
 CacheIRCompiler::emitCallObjectHasSparseElementResult()
 {
     AutoOutputRegister output(*this);
@@ -2800,17 +2800,17 @@ CacheIRCompiler::emitCallObjectHasSparse
     Label ok;
     uint32_t framePushed = masm.framePushed();
     masm.branchIfTrueBool(scratch1, &ok);
     masm.adjustStack(sizeof(Value));
     masm.jump(failure->label());
 
     masm.bind(&ok);
     masm.setFramePushed(framePushed);
-    masm.loadTypedOrValue(Address(masm.getStackPointer(), 0), output);
+    masm.loadTypedOrValue(Address(MacroAssembler::getStackPointer(), 0), output);
     masm.adjustStack(sizeof(Value));
     return true;
 }
 
 bool
 CacheIRCompiler::emitLoadInstanceOfObjectResult()
 {
     AutoOutputRegister output(*this);
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -1371,17 +1371,17 @@ static size_t
 RegExpPairsVectorStartOffset(size_t inputOutputDataStartOffset)
 {
     return inputOutputDataStartOffset + sizeof(irregexp::InputOutputData) + sizeof(MatchPairs);
 }
 
 static Address
 RegExpPairCountAddress(MacroAssembler& masm, size_t inputOutputDataStartOffset)
 {
-    return Address(masm.getStackPointer(), inputOutputDataStartOffset
+    return Address(MacroAssembler::getStackPointer(), inputOutputDataStartOffset
                                            + sizeof(irregexp::InputOutputData)
                                            + MatchPairs::offsetOfPairCount());
 }
 
 // Prepare an InputOutputData and optional MatchPairs which space has been
 // allocated for on the stack, and try to execute a RegExp on a string input.
 // If the RegExp was successfully executed and matched the input, fallthrough,
 // otherwise jump to notFound or failure.
@@ -1391,34 +1391,34 @@ PrepareAndExecuteRegExp(JSContext* cx, M
                         Register temp1, Register temp2, Register temp3,
                         size_t inputOutputDataStartOffset,
                         RegExpShared::CompilationMode mode,
                         Label* notFound, Label* failure)
 {
     size_t matchPairsStartOffset = inputOutputDataStartOffset + sizeof(irregexp::InputOutputData);
     size_t pairsVectorStartOffset = RegExpPairsVectorStartOffset(inputOutputDataStartOffset);
 
-    Address inputStartAddress(masm.getStackPointer(),
+    Address inputStartAddress(MacroAssembler::getStackPointer(),
         inputOutputDataStartOffset + offsetof(irregexp::InputOutputData, inputStart));
-    Address inputEndAddress(masm.getStackPointer(),
+    Address inputEndAddress(MacroAssembler::getStackPointer(),
         inputOutputDataStartOffset + offsetof(irregexp::InputOutputData, inputEnd));
-    Address matchesPointerAddress(masm.getStackPointer(),
+    Address matchesPointerAddress(MacroAssembler::getStackPointer(),
         inputOutputDataStartOffset + offsetof(irregexp::InputOutputData, matches));
-    Address startIndexAddress(masm.getStackPointer(),
+    Address startIndexAddress(MacroAssembler::getStackPointer(),
         inputOutputDataStartOffset + offsetof(irregexp::InputOutputData, startIndex));
-    Address endIndexAddress(masm.getStackPointer(),
+    Address endIndexAddress(MacroAssembler::getStackPointer(),
         inputOutputDataStartOffset + offsetof(irregexp::InputOutputData, endIndex));
-    Address matchResultAddress(masm.getStackPointer(),
+    Address matchResultAddress(MacroAssembler::getStackPointer(),
         inputOutputDataStartOffset + offsetof(irregexp::InputOutputData, result));
 
     Address pairCountAddress = RegExpPairCountAddress(masm, inputOutputDataStartOffset);
-    Address pairsPointerAddress(masm.getStackPointer(),
+    Address pairsPointerAddress(MacroAssembler::getStackPointer(),
         matchPairsStartOffset + MatchPairs::offsetOfPairs());
 
-    Address pairsVectorAddress(masm.getStackPointer(), pairsVectorStartOffset);
+    Address pairsVectorAddress(MacroAssembler::getStackPointer(), pairsVectorStartOffset);
 
     RegExpStatics* res = GlobalObject::getRegExpStatics(cx, cx->global());
     if (!res)
         return false;
 #ifdef JS_USE_LINK_REGISTER
     if (mode != RegExpShared::MatchOnly)
         masm.pushReturnAddress();
 #endif
@@ -1520,17 +1520,17 @@ PrepareAndExecuteRegExp(JSContext* cx, M
     }
 
     // Check the RegExpShared has been compiled for this type of input.
     masm.branchPtr(Assembler::Equal, codePointer, ImmWord(0), failure);
     masm.loadPtr(Address(codePointer, JitCode::offsetOfCode()), codePointer);
 
     // Finish filling in the InputOutputData instance on the stack.
     if (mode == RegExpShared::Normal) {
-        masm.computeEffectiveAddress(Address(masm.getStackPointer(), matchPairsStartOffset), temp2);
+        masm.computeEffectiveAddress(Address(MacroAssembler::getStackPointer(), matchPairsStartOffset), temp2);
         masm.storePtr(temp2, matchesPointerAddress);
     } else {
         // Use InputOutputData.endIndex itself for output.
         masm.computeEffectiveAddress(endIndexAddress, temp2);
         masm.storePtr(temp2, endIndexAddress);
     }
     masm.storePtr(lastIndex, startIndexAddress);
     masm.store32(Imm32(0), matchResultAddress);
@@ -1549,17 +1549,17 @@ PrepareAndExecuteRegExp(JSContext* cx, M
         masm.push(temp1);
         masm.loadTraceLogger(temp1);
         masm.tracelogStartId(temp1, TraceLogger_IrregexpExecute);
         masm.pop(temp1);
     }
 #endif
 
     // Execute the RegExp.
-    masm.computeEffectiveAddress(Address(masm.getStackPointer(), inputOutputDataStartOffset), temp2);
+    masm.computeEffectiveAddress(Address(MacroAssembler::getStackPointer(), inputOutputDataStartOffset), temp2);
     masm.PushRegsInMask(volatileRegs);
     masm.setupUnalignedABICall(temp3);
     masm.passABIArg(temp2);
     masm.callWithABI(codePointer);
     masm.PopRegsInMask(volatileRegs);
 
 #ifdef JS_TRACE_LOGGING
     if (TraceLogTextIdEnabled(TraceLogger_IrregexpExecute)) {
@@ -1708,17 +1708,17 @@ CreateDependentString::generate(MacroAss
 
         masm.bind(&stringAllocated);
         masm.store32(temp1, Address(string, JSString::offsetOfLength()));
 
         masm.push(string);
         masm.push(base);
 
         // Adjust the start index address for the above pushes.
-        MOZ_ASSERT(startIndexAddress.base == masm.getStackPointer());
+        MOZ_ASSERT(startIndexAddress.base == MacroAssembler::getStackPointer());
         BaseIndex newStartIndexAddress = startIndexAddress;
         newStartIndexAddress.offset += 2 * sizeof(void*);
 
         // Load chars pointer for the new string.
         masm.loadInlineStringCharsForStore(string, string);
 
         // Load the source characters pointer.
         masm.loadStringChars(base, temp2,
@@ -1961,25 +1961,25 @@ JitCompartment::generateRegExpMatcherStu
         masm.bind(&lengthOK);
     }
 #endif
 
     Register matchIndex = temp2;
     masm.move32(Imm32(0), matchIndex);
 
     size_t pairsVectorStartOffset = RegExpPairsVectorStartOffset(inputOutputDataStartOffset);
-    Address pairsVectorAddress(masm.getStackPointer(), pairsVectorStartOffset);
+    Address pairsVectorAddress(MacroAssembler::getStackPointer(), pairsVectorStartOffset);
     Address pairCountAddress = RegExpPairCountAddress(masm, inputOutputDataStartOffset);
 
     BaseIndex stringAddress(object, matchIndex, TimesEight, elementsOffset);
 
     JS_STATIC_ASSERT(sizeof(MatchPair) == 8);
-    BaseIndex stringIndexAddress(masm.getStackPointer(), matchIndex, TimesEight,
+    BaseIndex stringIndexAddress(MacroAssembler::getStackPointer(), matchIndex, TimesEight,
                                  pairsVectorStartOffset + offsetof(MatchPair, start));
-    BaseIndex stringLimitAddress(masm.getStackPointer(), matchIndex, TimesEight,
+    BaseIndex stringLimitAddress(MacroAssembler::getStackPointer(), matchIndex, TimesEight,
                                  pairsVectorStartOffset + offsetof(MatchPair, limit));
 
     // Loop to construct the match strings. There are two different loops,
     // depending on whether the input is latin1.
     CreateDependentString depStr[2];
 
     // depStr may refer to failureRestore during generateFallback below,
     // so this variable must live outside of the block.
@@ -2145,17 +2145,17 @@ CodeGenerator::visitOutOfLineRegExpMatch
     Register regexp = ToRegister(lir->regexp());
 
     AllocatableGeneralRegisterSet regs(GeneralRegisterSet::All());
     regs.take(lastIndex);
     regs.take(input);
     regs.take(regexp);
     Register temp = regs.takeAny();
 
-    masm.computeEffectiveAddress(Address(masm.getStackPointer(),
+    masm.computeEffectiveAddress(Address(MacroAssembler::getStackPointer(),
         sizeof(irregexp::InputOutputData)), temp);
 
     pushArg(temp);
     pushArg(lastIndex);
     pushArg(input);
     pushArg(regexp);
 
     // We are not using oolCallVM because we are in a Call, and that live
@@ -2230,19 +2230,19 @@ JitCompartment::generateRegExpSearcherSt
     if (!PrepareAndExecuteRegExp(cx, masm, regexp, input, lastIndex,
                                  temp1, temp2, temp3, inputOutputDataStartOffset,
                                  RegExpShared::Normal, &notFound, &oolEntry))
     {
         return nullptr;
     }
 
     size_t pairsVectorStartOffset = RegExpPairsVectorStartOffset(inputOutputDataStartOffset);
-    Address stringIndexAddress(masm.getStackPointer(),
+    Address stringIndexAddress(MacroAssembler::getStackPointer(),
                                pairsVectorStartOffset + offsetof(MatchPair, start));
-    Address stringLimitAddress(masm.getStackPointer(),
+    Address stringLimitAddress(MacroAssembler::getStackPointer(),
                                pairsVectorStartOffset + offsetof(MatchPair, limit));
 
     masm.load32(stringIndexAddress, result);
     masm.load32(stringLimitAddress, input);
     masm.lshiftPtr(Imm32(15), input);
     masm.or32(input, result);
     masm.ret();
 
@@ -2303,17 +2303,17 @@ CodeGenerator::visitOutOfLineRegExpSearc
     Register regexp = ToRegister(lir->regexp());
 
     AllocatableGeneralRegisterSet regs(GeneralRegisterSet::All());
     regs.take(lastIndex);
     regs.take(input);
     regs.take(regexp);
     Register temp = regs.takeAny();
 
-    masm.computeEffectiveAddress(Address(masm.getStackPointer(),
+    masm.computeEffectiveAddress(Address(MacroAssembler::getStackPointer(),
         sizeof(irregexp::InputOutputData)), temp);
 
     pushArg(temp);
     pushArg(lastIndex);
     pushArg(input);
     pushArg(regexp);
 
     // We are not using oolCallVM because we are in a Call, and that live
@@ -3156,26 +3156,26 @@ void
 CodeGenerator::visitParameter(LParameter* lir)
 {
 }
 
 void
 CodeGenerator::visitCallee(LCallee* lir)
 {
     Register callee = ToRegister(lir->output());
-    Address ptr(masm.getStackPointer(), frameSize() + JitFrameLayout::offsetOfCalleeToken());
+    Address ptr(MacroAssembler::getStackPointer(), frameSize() + JitFrameLayout::offsetOfCalleeToken());
 
     masm.loadFunctionFromCalleeToken(ptr, callee);
 }
 
 void
 CodeGenerator::visitIsConstructing(LIsConstructing* lir)
 {
     Register output = ToRegister(lir->output());
-    Address calleeToken(masm.getStackPointer(), frameSize() + JitFrameLayout::offsetOfCalleeToken());
+    Address calleeToken(MacroAssembler::getStackPointer(), frameSize() + JitFrameLayout::offsetOfCalleeToken());
     masm.loadPtr(calleeToken, output);
 
     // We must be inside a function.
     MOZ_ASSERT(current->mir()->info().script()->functionNonDelazifying());
 
     // The low bit indicates whether this call is constructing, just clear the
     // other bits.
     static_assert(CalleeToken_Function == 0x0, "CalleeTokenTag value should match");
@@ -3216,17 +3216,17 @@ CodeGenerator::visitOsrEntry(LOsrEntry* 
 
 #ifdef JS_TRACE_LOGGING
     emitTracelogStopEvent(TraceLogger_Baseline);
     emitTracelogStartEvent(TraceLogger_IonMonkey);
 #endif
 
     // If profiling, save the current frame pointer to a per-thread global field.
     if (isProfilerInstrumentationEnabled())
-        masm.profilerEnterFrame(masm.getStackPointer(), temp);
+        masm.profilerEnterFrame(MacroAssembler::getStackPointer(), temp);
 
     // Allocate the full frame for this function
     // Note we have a new entry here. So we reset MacroAssembler::framePushed()
     // to 0, before reserving the stack.
     MOZ_ASSERT(masm.framePushed() == frameSize());
     masm.setFramePushed(0);
 
     // Ensure that the Ion frames is properly aligned.
@@ -3289,17 +3289,17 @@ void
 CodeGenerator::visitStackArgT(LStackArgT* lir)
 {
     const LAllocation* arg = lir->getArgument();
     MIRType argType = lir->type();
     uint32_t argslot = lir->argslot();
     MOZ_ASSERT(argslot - 1u < graph.argumentSlotCount());
 
     int32_t stack_offset = StackOffsetOfPassedArg(argslot);
-    Address dest(masm.getStackPointer(), stack_offset);
+    Address dest(MacroAssembler::getStackPointer(), stack_offset);
 
     if (arg->isFloatReg())
         masm.storeDouble(ToFloatRegister(arg), dest);
     else if (arg->isRegister())
         masm.storeValue(ValueTypeFromMIRType(argType), ToRegister(arg), dest);
     else
         masm.storeValue(arg->toConstant()->toJSValue(), dest);
 }
@@ -3308,17 +3308,17 @@ void
 CodeGenerator::visitStackArgV(LStackArgV* lir)
 {
     ValueOperand val = ToValue(lir, 0);
     uint32_t argslot = lir->argslot();
     MOZ_ASSERT(argslot - 1u < graph.argumentSlotCount());
 
     int32_t stack_offset = StackOffsetOfPassedArg(argslot);
 
-    masm.storeValue(val, Address(masm.getStackPointer(), stack_offset));
+    masm.storeValue(val, Address(MacroAssembler::getStackPointer(), stack_offset));
 }
 
 void
 CodeGenerator::visitMoveGroup(LMoveGroup* group)
 {
     if (!group->numMoves())
         return;
 
@@ -4299,17 +4299,17 @@ CodeGenerator::visitCallNative(LCallNati
                      CheckUnsafeCallWithABI::DontCheckHasExitFrame);
 
     emitTracelogStopEvent(TraceLogger_Call);
 
     // Test for failure.
     masm.branchIfFalseBool(ReturnReg, masm.failureLabel());
 
     // Load the outparam vp[0] into output register(s).
-    masm.loadValue(Address(masm.getStackPointer(), NativeExitFrameLayout::offsetOfResult()), JSReturnOperand);
+    masm.loadValue(Address(MacroAssembler::getStackPointer(), NativeExitFrameLayout::offsetOfResult()), JSReturnOperand);
 
     // Until C++ code is instrumented against Spectre, prevent speculative
     // execution from returning any private data.
     if (JitOptions.spectreJitToCxxCalls && !call->mir()->ignoresReturnValue() &&
         call->mir()->hasLiveDefUses())
     {
         masm.speculationBarrier();
     }
@@ -4387,30 +4387,30 @@ CodeGenerator::visitCallDOMNative(LCallD
     // outparam and the callee, vp[1] is |this|, and vp[2] onward are the
     // function arguments.  Note that args stores the argv, not the vp, and
     // argv == vp + 2.
 
     // Nestle the stack up against the pushed arguments, leaving StackPointer at
     // &vp[1]
     masm.adjustStack(unusedStack);
     // argObj is filled with the extracted object, then returned.
-    Register obj = masm.extractObject(Address(masm.getStackPointer(), 0), argObj);
+    Register obj = masm.extractObject(Address(MacroAssembler::getStackPointer(), 0), argObj);
     MOZ_ASSERT(obj == argObj);
 
     // Push a Value containing the callee object: natives are allowed to access their callee before
     // setitng the return value. After this the StackPointer points to &vp[0].
     masm.Push(ObjectValue(*target->rawJSFunction()));
 
     // Now compute the argv value.  Since StackPointer is pointing to &vp[0] and
     // argv is &vp[2] we just need to add 2*sizeof(Value) to the current
     // StackPointer.
     JS_STATIC_ASSERT(JSJitMethodCallArgsTraits::offsetOfArgv == 0);
     JS_STATIC_ASSERT(JSJitMethodCallArgsTraits::offsetOfArgc ==
                      IonDOMMethodExitFrameLayoutTraits::offsetOfArgcFromArgv);
-    masm.computeEffectiveAddress(Address(masm.getStackPointer(), 2 * sizeof(Value)), argArgs);
+    masm.computeEffectiveAddress(Address(MacroAssembler::getStackPointer(), 2 * sizeof(Value)), argArgs);
 
     LoadDOMPrivate(masm, obj, argPrivate, static_cast<MCallDOMNative*>(call->mir())->objectKind());
 
     // Push argc from the call instruction into what will become the IonExitFrame
     masm.Push(Imm32(call->numActualArgs()));
 
     // Push our argv onto the stack
     masm.Push(argArgs);
@@ -4436,24 +4436,24 @@ CodeGenerator::visitCallDOMNative(LCallD
     masm.passABIArg(argJSContext);
     masm.passABIArg(argObj);
     masm.passABIArg(argPrivate);
     masm.passABIArg(argArgs);
     masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, target->jitInfo()->method), MoveOp::GENERAL,
                      CheckUnsafeCallWithABI::DontCheckHasExitFrame);
 
     if (target->jitInfo()->isInfallible) {
-        masm.loadValue(Address(masm.getStackPointer(), IonDOMMethodExitFrameLayout::offsetOfResult()),
+        masm.loadValue(Address(MacroAssembler::getStackPointer(), IonDOMMethodExitFrameLayout::offsetOfResult()),
                        JSReturnOperand);
     } else {
         // Test for failure.
         masm.branchIfFalseBool(ReturnReg, masm.exceptionLabel());
 
         // Load the outparam vp[0] into output register(s).
-        masm.loadValue(Address(masm.getStackPointer(), IonDOMMethodExitFrameLayout::offsetOfResult()),
+        masm.loadValue(Address(MacroAssembler::getStackPointer(), IonDOMMethodExitFrameLayout::offsetOfResult()),
                        JSReturnOperand);
     }
 
     // Until C++ code is instrumented against Spectre, prevent speculative
     // execution from returning any private data.
     if (JitOptions.spectreJitToCxxCalls && call->mir()->hasLiveDefUses())
         masm.speculationBarrier();
 
@@ -4485,17 +4485,17 @@ void
 CodeGenerator::emitCallInvokeFunction(LInstruction* call, Register calleereg,
                                       bool constructing, bool ignoresReturnValue,
                                       uint32_t argc, uint32_t unusedStack)
 {
     // Nestle %esp up to the argument vector.
     // Each path must account for framePushed_ separately, for callVM to be valid.
     masm.freeStack(unusedStack);
 
-    pushArg(masm.getStackPointer()); // argv.
+    pushArg(MacroAssembler::getStackPointer()); // argv.
     pushArg(Imm32(argc));            // argc.
     pushArg(Imm32(ignoresReturnValue));
     pushArg(Imm32(constructing));    // constructing.
     pushArg(calleereg);              // JSFunction*.
 
     callVM(InvokeFunctionInfo, call);
 
     // Un-nestle %esp from the argument vector. No prefix was pushed.
@@ -4582,33 +4582,33 @@ CodeGenerator::visitCallGeneric(LCallGen
 
     masm.bind(&end);
 
     // If the return value of the constructing function is Primitive,
     // replace the return value with the Object from CreateThis.
     if (call->mir()->isConstructing()) {
         Label notPrimitive;
         masm.branchTestPrimitive(Assembler::NotEqual, JSReturnOperand, &notPrimitive);
-        masm.loadValue(Address(masm.getStackPointer(), unusedStack), JSReturnOperand);
+        masm.loadValue(Address(MacroAssembler::getStackPointer(), unusedStack), JSReturnOperand);
         masm.bind(&notPrimitive);
     }
 }
 
 typedef bool (*InvokeFunctionShuffleFn)(JSContext*, HandleObject, uint32_t, uint32_t, Value*,
                                         MutableHandleValue);
 static const VMFunction InvokeFunctionShuffleInfo =
     FunctionInfo<InvokeFunctionShuffleFn>(InvokeFunctionShuffleNewTarget,
                                           "InvokeFunctionShuffleNewTarget");
 void
 CodeGenerator::emitCallInvokeFunctionShuffleNewTarget(LCallKnown* call, Register calleeReg,
                                                       uint32_t numFormals, uint32_t unusedStack)
 {
     masm.freeStack(unusedStack);
 
-    pushArg(masm.getStackPointer());
+    pushArg(MacroAssembler::getStackPointer());
     pushArg(Imm32(numFormals));
     pushArg(Imm32(call->numActualArgs()));
     pushArg(calleeReg);
 
     callVM(InvokeFunctionShuffleInfo, call);
 
     masm.reserveStack(unusedStack);
 }
@@ -4686,17 +4686,17 @@ CodeGenerator::visitCallKnown(LCallKnown
         masm.bind(&end);
     }
 
     // If the return value of the constructing function is Primitive,
     // replace the return value with the Object from CreateThis.
     if (call->mir()->isConstructing()) {
         Label notPrimitive;
         masm.branchTestPrimitive(Assembler::NotEqual, JSReturnOperand, &notPrimitive);
-        masm.loadValue(Address(masm.getStackPointer(), unusedStack), JSReturnOperand);
+        masm.loadValue(Address(MacroAssembler::getStackPointer(), unusedStack), JSReturnOperand);
         masm.bind(&notPrimitive);
     }
 }
 
 template<typename T>
 void
 CodeGenerator::emitCallInvokeFunction(T* apply, Register extraStackSize)
 {
@@ -4748,17 +4748,17 @@ CodeGenerator::emitAllocateSpaceForApply
     // Put a magic value in the space reserved for padding. Note, this code
     // cannot be merged with the previous test, as not all architectures can
     // write below their stack pointers.
     if (JitStackValueAlignment > 1) {
         MOZ_ASSERT(JitStackValueAlignment == 2);
         Label noPaddingNeeded;
         // if the number of arguments is odd, then we do not need any padding.
         masm.branchTestPtr(Assembler::NonZero, argcreg, Imm32(1), &noPaddingNeeded);
-        BaseValueIndex dstPtr(masm.getStackPointer(), argcreg);
+        BaseValueIndex dstPtr(MacroAssembler::getStackPointer(), argcreg);
         masm.storeValue(MagicValue(JS_ARG_POISON), dstPtr);
         masm.bind(&noPaddingNeeded);
     }
 #endif
 
     // Skip the copy of arguments if there are none.
     masm.branchTestPtr(Assembler::Zero, argcreg, argcreg, end);
 }
@@ -4770,24 +4770,24 @@ CodeGenerator::emitCopyValuesForApply(Re
 {
     Label loop;
     masm.bind(&loop);
 
     // As argvIndex is off by 1, and we use the decBranchPtr instruction
     // to loop back, we have to substract the size of the word which are
     // copied.
     BaseValueIndex srcPtr(argvSrcBase, argvIndex, argvSrcOffset - sizeof(void*));
-    BaseValueIndex dstPtr(masm.getStackPointer(), argvIndex, argvDstOffset - sizeof(void*));
+    BaseValueIndex dstPtr(MacroAssembler::getStackPointer(), argvIndex, argvDstOffset - sizeof(void*));
     masm.loadPtr(srcPtr, copyreg);
     masm.storePtr(copyreg, dstPtr);
 
     // Handle 32 bits architectures.
     if (sizeof(Value) == 2 * sizeof(void*)) {
         BaseValueIndex srcPtrLow(argvSrcBase, argvIndex, argvSrcOffset - 2 * sizeof(void*));
-        BaseValueIndex dstPtrLow(masm.getStackPointer(), argvIndex, argvDstOffset - 2 * sizeof(void*));
+        BaseValueIndex dstPtrLow(MacroAssembler::getStackPointer(), argvIndex, argvDstOffset - 2 * sizeof(void*));
         masm.loadPtr(srcPtrLow, copyreg);
         masm.storePtr(copyreg, dstPtrLow);
     }
 
     masm.decBranchPtr(Assembler::NonZero, argvIndex, Imm32(1), &loop);
 }
 
 void
@@ -4995,17 +4995,17 @@ CodeGenerator::emitApplyGeneric(T* apply
 
         masm.bind(&rejoin);
 
         // Finally call the function in objreg, as assigned by one of the paths above.
         uint32_t callOffset = masm.callJit(objreg);
         markSafepointAt(callOffset, apply);
 
         // Recover the number of arguments from the frame descriptor.
-        masm.loadPtr(Address(masm.getStackPointer(), 0), stackSpace);
+        masm.loadPtr(Address(MacroAssembler::getStackPointer(), 0), stackSpace);
         masm.rshiftPtr(Imm32(FRAMESIZE_SHIFT), stackSpace);
         masm.subPtr(Imm32(pushed), stackSpace);
 
         // Increment to remove IonFramePrefix; decrement to fill FrameSizeClass.
         // The return address has already been removed from the Ion frame.
         int prefixGarbage = sizeof(JitFrameLayout) - sizeof(void*);
         masm.adjustStack(prefixGarbage);
         masm.jump(&end);
@@ -5100,17 +5100,17 @@ CodeGenerator::visitGetDynamicName(LGetD
     masm.passABIArg(temp3);
     masm.passABIArg(envChain);
     masm.passABIArg(name);
     masm.passABIArg(temp2);
     masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, GetDynamicName));
 
     const ValueOperand out = ToOutValue(lir);
 
-    masm.loadValue(Address(masm.getStackPointer(), 0), out);
+    masm.loadValue(Address(MacroAssembler::getStackPointer(), 0), out);
     masm.adjustStack(sizeof(Value));
 
     Label undefined;
     masm.branchTestUndefined(Assembler::Equal, out, &undefined);
     bailoutFrom(&undefined, lir->snapshot());
 }
 
 typedef bool (*DirectEvalSFn)(JSContext*, HandleObject, HandleScript, HandleValue,
@@ -5160,21 +5160,21 @@ CodeGenerator::generateArgumentsChecks(b
             continue;
 
 #ifndef JS_CODEGEN_ARM64
         // Calculate the offset on the stack of the argument.
         // (i - info.startArgSlot())    - Compute index of arg within arg vector.
         // ... * sizeof(Value)          - Scale by value size.
         // ArgToStackOffset(...)        - Compute displacement within arg vector.
         int32_t offset = ArgToStackOffset((i - info.startArgSlot()) * sizeof(Value));
-        Address argAddr(masm.getStackPointer(), offset);
+        Address argAddr(MacroAssembler::getStackPointer(), offset);
 
         // guardObjectType will zero the stack pointer register on speculative
         // paths.
-        Register spectreRegToZero = masm.getStackPointer();
+        Register spectreRegToZero = MacroAssembler::getStackPointer();
         masm.guardTypeSet(argAddr, types, BarrierKind::TypeSet, temp1, temp2,
                           spectreRegToZero, &miss);
 #else
         // On ARM64, the stack pointer situation is more complicated. When we
         // enable Ion, we should figure out how to mitigate Spectre there.
         mozilla::Unused << temp1;
         mozilla::Unused << temp2;
         MOZ_CRASH("NYI");
@@ -5192,17 +5192,17 @@ CodeGenerator::generateArgumentsChecks(b
             // changing object groups.
             for (uint32_t i = info.startArgSlot(); i < info.endArgSlot(); i++) {
                 MParameter* param = rp->getOperand(i)->toParameter();
                 const TemporaryTypeSet* types = param->resultTypeSet();
                 if (!types || types->unknown())
                     continue;
 
                 Label skip;
-                Address addr(masm.getStackPointer(), ArgToStackOffset((i - info.startArgSlot()) * sizeof(Value)));
+                Address addr(MacroAssembler::getStackPointer(), ArgToStackOffset((i - info.startArgSlot()) * sizeof(Value)));
                 masm.branchTestObject(Assembler::NotEqual, addr, &skip);
                 Register obj = masm.extractObject(addr, temp1);
                 masm.guardTypeSetMightBeIncomplete(types, obj, temp1, &success);
                 masm.bind(&skip);
             }
 
             masm.assumeUnreachable("Argument check fail.");
             masm.bind(&success);
@@ -8428,17 +8428,17 @@ JitRuntime::generateInterpreterStub(Macr
     masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, InvokeFromInterpreterStub), MoveOp::GENERAL,
                      CheckUnsafeCallWithABI::DontCheckHasExitFrame);
 
     masm.branchIfFalseBool(ReturnReg, masm.failureLabel());
     masm.leaveExitFrame();
 
     // InvokeFromInterpreterStub stores the return value in argv[0], where the
     // caller stored |this|.
-    masm.loadValue(Address(masm.getStackPointer(), JitFrameLayout::offsetOfThis()),
+    masm.loadValue(Address(MacroAssembler::getStackPointer(), JitFrameLayout::offsetOfThis()),
                    JSReturnOperand);
     masm.ret();
 }
 
 bool
 JitRuntime::generateTLEventVM(MacroAssembler& masm, const VMFunction& f, bool enter)
 {
 #ifdef JS_TRACE_LOGGING
@@ -8650,18 +8650,18 @@ CodeGenerator::visitSinCos(LSinCos *lir)
     masm.passABIArg(MoveOperand(params, sizeof(double), MoveOperand::EFFECTIVE_ADDRESS),
                                 MoveOp::GENERAL);
     masm.passABIArg(MoveOperand(params, 0, MoveOperand::EFFECTIVE_ADDRESS),
                                 MoveOp::GENERAL);
 
     masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, MAYBE_CACHED_(js::math_sincos)));
 #undef MAYBE_CACHED_
 
-    masm.loadDouble(Address(masm.getStackPointer(), 0), outputCos);
-    masm.loadDouble(Address(masm.getStackPointer(), sizeof(double)), outputSin);
+    masm.loadDouble(Address(MacroAssembler::getStackPointer(), 0), outputCos);
+    masm.loadDouble(Address(MacroAssembler::getStackPointer(), sizeof(double)), outputSin);
     masm.freeStack(sizeof(double) * 2);
 }
 
 typedef ArrayObject* (*StringSplitFn)(JSContext*, HandleObjectGroup, HandleString, HandleString, uint32_t);
 static const VMFunction StringSplitInfo =
     FunctionInfo<StringSplitFn>(js::str_split_string, "str_split_string");
 
 void
@@ -9699,73 +9699,73 @@ CodeGenerator::visitIteratorEnd(LIterato
     masm.bind(ool->rejoin());
 }
 
 void
 CodeGenerator::visitArgumentsLength(LArgumentsLength* lir)
 {
     // read number of actual arguments from the JS frame.
     Register argc = ToRegister(lir->output());
-    Address ptr(masm.getStackPointer(), frameSize() + JitFrameLayout::offsetOfNumActualArgs());
+    Address ptr(MacroAssembler::getStackPointer(), frameSize() + JitFrameLayout::offsetOfNumActualArgs());
 
     masm.loadPtr(ptr, argc);
 }
 
 void
 CodeGenerator::visitGetFrameArgument(LGetFrameArgument* lir)
 {
     ValueOperand result = ToOutValue(lir);
     const LAllocation* index = lir->index();
     size_t argvOffset = frameSize() + JitFrameLayout::offsetOfActualArgs();
 
     if (index->isConstant()) {
         int32_t i = index->toConstant()->toInt32();
-        Address argPtr(masm.getStackPointer(), sizeof(Value) * i + argvOffset);
+        Address argPtr(MacroAssembler::getStackPointer(), sizeof(Value) * i + argvOffset);
         masm.loadValue(argPtr, result);
     } else {
         Register i = ToRegister(index);
-        BaseValueIndex argPtr(masm.getStackPointer(), i, argvOffset);
+        BaseValueIndex argPtr(MacroAssembler::getStackPointer(), i, argvOffset);
         masm.loadValue(argPtr, result);
     }
 }
 
 void
 CodeGenerator::visitSetFrameArgumentT(LSetFrameArgumentT* lir)
 {
     size_t argOffset = frameSize() + JitFrameLayout::offsetOfActualArgs() +
                        (sizeof(Value) * lir->mir()->argno());
 
     MIRType type = lir->mir()->value()->type();
 
     if (type == MIRType::Double) {
         // Store doubles directly.
         FloatRegister input = ToFloatRegister(lir->input());
-        masm.storeDouble(input, Address(masm.getStackPointer(), argOffset));
+        masm.storeDouble(input, Address(MacroAssembler::getStackPointer(), argOffset));
 
     } else {
         Register input = ToRegister(lir->input());
-        masm.storeValue(ValueTypeFromMIRType(type), input, Address(masm.getStackPointer(), argOffset));
+        masm.storeValue(ValueTypeFromMIRType(type), input, Address(MacroAssembler::getStackPointer(), argOffset));
     }
 }
 
 void
 CodeGenerator:: visitSetFrameArgumentC(LSetFrameArgumentC* lir)
 {
     size_t argOffset = frameSize() + JitFrameLayout::offsetOfActualArgs() +
                        (sizeof(Value) * lir->mir()->argno());
-    masm.storeValue(lir->val(), Address(masm.getStackPointer(), argOffset));
+    masm.storeValue(lir->val(), Address(MacroAssembler::getStackPointer(), argOffset));
 }
 
 void
 CodeGenerator:: visitSetFrameArgumentV(LSetFrameArgumentV* lir)
 {
     const ValueOperand val = ToValue(lir, LSetFrameArgumentV::Input);
     size_t argOffset = frameSize() + JitFrameLayout::offsetOfActualArgs() +
                        (sizeof(Value) * lir->mir()->argno());
-    masm.storeValue(val, Address(masm.getStackPointer(), argOffset));
+    masm.storeValue(val, Address(MacroAssembler::getStackPointer(), argOffset));
 }
 
 typedef bool (*RunOnceScriptPrologueFn)(JSContext*, HandleScript);
 static const VMFunction RunOnceScriptPrologueInfo =
     FunctionInfo<RunOnceScriptPrologueFn>(js::RunOnceScriptPrologue, "RunOnceScriptPrologue");
 
 void
 CodeGenerator::visitRunOncePrologue(LRunOncePrologue* lir)
@@ -12002,22 +12002,22 @@ CodeGenerator::visitGetDOMProperty(LGetD
     masm.passABIArg(JSContextReg);
     masm.passABIArg(ObjectReg);
     masm.passABIArg(PrivateReg);
     masm.passABIArg(ValueReg);
     masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, ins->mir()->fun()), MoveOp::GENERAL,
                      CheckUnsafeCallWithABI::DontCheckHasExitFrame);
 
     if (ins->mir()->isInfallible()) {
-        masm.loadValue(Address(masm.getStackPointer(), IonDOMExitFrameLayout::offsetOfResult()),
+        masm.loadValue(Address(MacroAssembler::getStackPointer(), IonDOMExitFrameLayout::offsetOfResult()),
                        JSReturnOperand);
     } else {
         masm.branchIfFalseBool(ReturnReg, masm.exceptionLabel());
 
-        masm.loadValue(Address(masm.getStackPointer(), IonDOMExitFrameLayout::offsetOfResult()),
+        masm.loadValue(Address(MacroAssembler::getStackPointer(), IonDOMExitFrameLayout::offsetOfResult()),
                        JSReturnOperand);
     }
 
     // Until C++ code is instrumented against Spectre, prevent speculative
     // execution from returning any private data.
     if (JitOptions.spectreJitToCxxCalls && ins->mir()->hasLiveDefUses())
         masm.speculationBarrier();
 
@@ -12859,42 +12859,42 @@ CodeGenerator::visitDebugger(LDebugger* 
 
 void
 CodeGenerator::visitNewTarget(LNewTarget *ins)
 {
     ValueOperand output = ToOutValue(ins);
 
     // if (isConstructing) output = argv[Max(numActualArgs, numFormalArgs)]
     Label notConstructing, done;
-    Address calleeToken(masm.getStackPointer(), frameSize() + JitFrameLayout::offsetOfCalleeToken());
+    Address calleeToken(MacroAssembler::getStackPointer(), frameSize() + JitFrameLayout::offsetOfCalleeToken());
     masm.branchTestPtr(Assembler::Zero, calleeToken,
                        Imm32(CalleeToken_FunctionConstructing), &notConstructing);
 
     Register argvLen = output.scratchReg();
 
-    Address actualArgsPtr(masm.getStackPointer(), frameSize() + JitFrameLayout::offsetOfNumActualArgs());
+    Address actualArgsPtr(MacroAssembler::getStackPointer(), frameSize() + JitFrameLayout::offsetOfNumActualArgs());
     masm.loadPtr(actualArgsPtr, argvLen);
 
     Label useNFormals;
 
     size_t numFormalArgs = ins->mirRaw()->block()->info().funMaybeLazy()->nargs();
     masm.branchPtr(Assembler::Below, argvLen, Imm32(numFormalArgs),
                    &useNFormals);
 
     size_t argsOffset = frameSize() + JitFrameLayout::offsetOfActualArgs();
     {
-        BaseValueIndex newTarget(masm.getStackPointer(), argvLen, argsOffset);
+        BaseValueIndex newTarget(MacroAssembler::getStackPointer(), argvLen, argsOffset);
         masm.loadValue(newTarget, output);
         masm.jump(&done);
     }
 
     masm.bind(&useNFormals);
 
     {
-        Address newTarget(masm.getStackPointer(), argsOffset + (numFormalArgs * sizeof(Value)));
+        Address newTarget(MacroAssembler::getStackPointer(), argsOffset + (numFormalArgs * sizeof(Value)));
         masm.loadValue(newTarget, output);
         masm.jump(&done);
     }
 
     // else output = undefined
     masm.bind(&notConstructing);
     masm.moveValue(UndefinedValue(), output);
     masm.bind(&done);
--- a/js/src/jit/IonCacheIRCompiler.cpp
+++ b/js/src/jit/IonCacheIRCompiler.cpp
@@ -258,23 +258,23 @@ CacheRegisterAllocator::saveIonLiveRegis
             size_t extraBytes = sizeOfLiveRegsInBytes - stackPushed_;
             MOZ_ASSERT((extraBytes % sizeof(uintptr_t)) == 0);
             masm.subFromStackPtr(Imm32(extraBytes));
             stackPushed_ += extraBytes;
         }
 
         // Push the operand below the live register space.
         if (loc.kind() == OperandLocation::PayloadStack) {
-            masm.push(Address(masm.getStackPointer(), stackPushed_ - operandStackPushed));
+            masm.push(Address(MacroAssembler::getStackPointer(), stackPushed_ - operandStackPushed));
             stackPushed_ += operandSize;
             loc.setPayloadStack(stackPushed_, loc.payloadType());
             continue;
         }
         MOZ_ASSERT(loc.kind() == OperandLocation::ValueStack);
-        masm.pushValue(Address(masm.getStackPointer(), stackPushed_ - operandStackPushed));
+        masm.pushValue(Address(MacroAssembler::getStackPointer(), stackPushed_ - operandStackPushed));
         stackPushed_ += operandSize;
         loc.setValueStack(stackPushed_);
     }
 
     // Step 6. If we have any operands on the stack, adjust their stackPushed
     // values to not include sizeOfLiveRegsInBytes (this simplifies code down
     // the line). Then push/store the live registers.
     if (hasOperandOnStack) {
@@ -283,17 +283,17 @@ CacheRegisterAllocator::saveIonLiveRegis
 
         for (size_t i = numInputs; i < operandLocations_.length(); i++) {
             OperandLocation& loc = operandLocations_[i];
             if (loc.isOnStack())
                 loc.adjustStackPushed(-int32_t(sizeOfLiveRegsInBytes));
         }
 
         size_t stackBottom = stackPushed_ + sizeOfLiveRegsInBytes;
-        masm.storeRegsInMask(liveRegs, Address(masm.getStackPointer(), stackBottom), scratch);
+        masm.storeRegsInMask(liveRegs, Address(MacroAssembler::getStackPointer(), stackBottom), scratch);
         masm.setFramePushed(masm.framePushed() + sizeOfLiveRegsInBytes);
     } else {
         // If no operands are on the stack, discard the unused stack space.
         if (stackPushed_ > 0) {
             masm.addToStackPtr(Imm32(stackPushed_));
             stackPushed_ = 0;
         }
         masm.PushRegsInMask(liveRegs);
@@ -992,17 +992,17 @@ IonCacheIRCompiler::emitMegamorphicLoadS
     masm.passABIArg(scratch3);
     if (handleMissing)
         masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, (GetNativeDataProperty<true>)));
     else
         masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, (GetNativeDataProperty<false>)));
     masm.mov(ReturnReg, scratch2);
     masm.PopRegsInMask(volatileRegs);
 
-    masm.loadTypedOrValue(Address(masm.getStackPointer(), 0), output);
+    masm.loadTypedOrValue(Address(MacroAssembler::getStackPointer(), 0), output);
     masm.adjustStack(sizeof(Value));
 
     masm.branchIfFalseBool(scratch2, failure->label());
     return true;
 }
 
 bool
 IonCacheIRCompiler::emitMegamorphicStoreSlot()
@@ -1037,17 +1037,17 @@ IonCacheIRCompiler::emitMegamorphicStore
     masm.passABIArg(val.scratchReg());
     if (needsTypeBarrier)
         masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, (SetNativeDataProperty<true>)));
     else
         masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, (SetNativeDataProperty<false>)));
     masm.mov(ReturnReg, scratch1);
     masm.PopRegsInMask(volatileRegs);
 
-    masm.loadValue(Address(masm.getStackPointer(), 0), val);
+    masm.loadValue(Address(MacroAssembler::getStackPointer(), 0), val);
     masm.adjustStack(sizeof(Value));
 
     masm.branchIfFalseBool(scratch1, failure->label());
     return true;
 }
 
 bool
 IonCacheIRCompiler::emitGuardHasGetterSetter()
@@ -1186,17 +1186,17 @@ IonCacheIRCompiler::emitCallNativeGetter
     masm.passABIArg(argVp);
     masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, target->native()), MoveOp::GENERAL,
                      CheckUnsafeCallWithABI::DontCheckHasExitFrame);
 
     // Test for failure.
     masm.branchIfFalseBool(ReturnReg, masm.exceptionLabel());
 
     // Load the outparam vp[0] into output register(s).
-    Address outparam(masm.getStackPointer(), IonOOLNativeExitFrameLayout::offsetOfResult());
+    Address outparam(MacroAssembler::getStackPointer(), IonOOLNativeExitFrameLayout::offsetOfResult());
     masm.loadValue(outparam, output.valueReg());
 
     masm.adjustStack(IonOOLNativeExitFrameLayout::Size(0));
     return true;
 }
 
 bool
 IonCacheIRCompiler::emitCallProxyGetResult()
@@ -1245,17 +1245,17 @@ IonCacheIRCompiler::emitCallProxyGetResu
     masm.passABIArg(argVp);
     masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, ProxyGetProperty), MoveOp::GENERAL,
                      CheckUnsafeCallWithABI::DontCheckHasExitFrame);
 
     // Test for failure.
     masm.branchIfFalseBool(ReturnReg, masm.exceptionLabel());
 
     // Load the outparam vp[0] into output register(s).
-    Address outparam(masm.getStackPointer(), IonOOLProxyExitFrameLayout::offsetOfResult());
+    Address outparam(MacroAssembler::getStackPointer(), IonOOLProxyExitFrameLayout::offsetOfResult());
     masm.loadValue(outparam, output.valueReg());
 
     // masm.leaveExitFrame & pop locals
     masm.adjustStack(IonOOLProxyExitFrameLayout::Size());
     return true;
 }
 
 typedef bool (*ProxyGetPropertyByValueFn)(JSContext*, HandleObject, HandleValue, MutableHandleValue);
--- a/js/src/jit/MoveResolver.cpp
+++ b/js/src/jit/MoveResolver.cpp
@@ -30,20 +30,20 @@ MoveOperand::MoveOperand(MacroAssembler&
         break;
 #endif
       case ABIArg::FPU:
         kind_ = FLOAT_REG;
         code_ = arg.fpu().code();
         break;
       case ABIArg::Stack:
         kind_ = MEMORY;
-        if (IsHiddenSP(masm.getStackPointer()))
+        if (IsHiddenSP(MacroAssembler::getStackPointer()))
             MOZ_CRASH("Hidden SP cannot be represented as register code on this platform");
         else
-            code_ = AsRegister(masm.getStackPointer()).code();
+            code_ = AsRegister(MacroAssembler::getStackPointer()).code();
         disp_ = arg.offsetFromArgBase();
         break;
       case ABIArg::Uninitialized:
         MOZ_CRASH("Uninitialized ABIArg kind");
     }
 }
 
 MoveResolver::MoveResolver()
--- a/js/src/jit/shared/CodeGenerator-shared-inl.h
+++ b/js/src/jit/shared/CodeGenerator-shared-inl.h
@@ -281,17 +281,17 @@ CodeGeneratorShared::ToStackOffset(const
 {
     return ToStackOffset(*a);
 }
 
 Address
 CodeGeneratorShared::ToAddress(const LAllocation& a)
 {
     MOZ_ASSERT(a.isMemory());
-    return Address(masm.getStackPointer(), ToStackOffset(&a));
+    return Address(MacroAssembler::getStackPointer(), ToStackOffset(&a));
 }
 
 Address
 CodeGeneratorShared::ToAddress(const LAllocation* a)
 {
     return ToAddress(*a);
 }
 
--- a/js/src/jit/shared/CodeGenerator-shared.cpp
+++ b/js/src/jit/shared/CodeGenerator-shared.cpp
@@ -117,17 +117,17 @@ CodeGeneratorShared::generatePrologue()
     MOZ_ASSERT(!gen->compilingWasm());
 
 #ifdef JS_USE_LINK_REGISTER
     masm.pushReturnAddress();
 #endif
 
     // If profiling, save the current frame pointer to a per-thread global field.
     if (isProfilerInstrumentationEnabled())
-        masm.profilerEnterFrame(masm.getStackPointer(), CallTempReg0);
+        masm.profilerEnterFrame(MacroAssembler::getStackPointer(), CallTempReg0);
 
     // Ensure that the Ion frame is properly aligned.
     masm.assertStackAlignment(JitStackAlignment, 0);
 
     // Note that this automatically sets MacroAssembler::framePushed().
     masm.reserveStack(frameSize());
     masm.checkStackAlignment();
 
--- a/js/src/jit/x64/CodeGenerator-x64.cpp
+++ b/js/src/jit/x64/CodeGenerator-x64.cpp
@@ -38,17 +38,17 @@ CodeGeneratorX64::ToTempValue(LInstructi
 
 Operand
 CodeGeneratorX64::ToOperand64(const LInt64Allocation& a64)
 {
     const LAllocation& a = a64.value();
     MOZ_ASSERT(!a.isFloatReg());
     if (a.isGeneralReg())
         return Operand(a.toGeneralReg()->reg());
-    return Operand(masm.getStackPointer(), ToStackOffset(a));
+    return Operand(MacroAssembler::getStackPointer(), ToStackOffset(a));
 }
 
 FrameSizeClass
 FrameSizeClass::FromDepth(uint32_t frameDepth)
 {
     return FrameSizeClass::None();
 }
 
--- a/js/src/jit/x86-shared/CodeGenerator-x86-shared.cpp
+++ b/js/src/jit/x86-shared/CodeGenerator-x86-shared.cpp
@@ -1788,17 +1788,17 @@ CodeGeneratorX86Shared::visitUrshD(LUrsh
 
 Operand
 CodeGeneratorX86Shared::ToOperand(const LAllocation& a)
 {
     if (a.isGeneralReg())
         return Operand(a.toGeneralReg()->reg());
     if (a.isFloatReg())
         return Operand(a.toFloatReg()->reg());
-    return Operand(masm.getStackPointer(), ToStackOffset(&a));
+    return Operand(MacroAssembler::getStackPointer(), ToStackOffset(&a));
 }
 
 Operand
 CodeGeneratorX86Shared::ToOperand(const LAllocation* a)
 {
     return ToOperand(*a);
 }
 
--- a/js/src/jsnum.cpp
+++ b/js/src/jsnum.cpp
@@ -1298,17 +1298,17 @@ FracNumberToCString(JSContext* cx, ToCSt
          * This is V8's implementation of the algorithm described in the
          * following paper:
          *
          *   Printing floating-point numbers quickly and accurately with integers.
          *   Florian Loitsch, PLDI 2010.
          */
         const double_conversion::DoubleToStringConverter& converter
             = double_conversion::DoubleToStringConverter::EcmaScriptConverter();
-        double_conversion::StringBuilder builder(cbuf->sbuf, cbuf->sbufSize);
+        double_conversion::StringBuilder builder(cbuf->sbuf, js::ToCStringBuf::sbufSize);
         converter.ToShortest(d, &builder);
         numStr = builder.Finalize();
     } else {
         if (!EnsureDtoaState(cx))
             return nullptr;
         numStr = cbuf->dbuf = js_dtobasestr(cx->dtoaState, base, d);
     }
     return numStr;
--- a/js/src/perf/jsperf.cpp
+++ b/js/src/perf/jsperf.cpp
@@ -89,17 +89,17 @@ pm_reset(JSContext* cx, unsigned argc, V
 static bool
 pm_canMeasureSomething(JSContext* cx, unsigned argc, Value* vp)
 {
     CallArgs args = CallArgsFromVp(argc, vp);
     PerfMeasurement* p = GetPM(cx, args.thisv(), "canMeasureSomething");
     if (!p)
         return false;
 
-    args.rval().setBoolean(p->canMeasureSomething());
+    args.rval().setBoolean(PerfMeasurement::canMeasureSomething());
     return true;
 }
 
 static const uint8_t PM_FATTRS = JSPROP_READONLY | JSPROP_PERMANENT;
 static const JSFunctionSpec pm_fns[] = {
     JS_FN("start",               pm_start,               0, PM_FATTRS),
     JS_FN("stop",                pm_stop,                0, PM_FATTRS),
     JS_FN("reset",               pm_reset,               0, PM_FATTRS),
--- a/js/src/vm/Runtime.cpp
+++ b/js/src/vm/Runtime.cpp
@@ -589,20 +589,20 @@ JSContext::requestInterrupt(InterruptMod
     jitStackLimit = UINTPTR_MAX;
 
     if (mode == JSContext::RequestInterruptUrgent) {
         // If this interrupt is urgent (slow script dialog for instance), take
         // additional steps to interrupt corner cases where the above fields are
         // not regularly polled. Wake ilooping Ion code, irregexp JIT code and
         // Atomics.wait()
         interruptRegExpJit_ = true;
-        fx.lock();
+        FutexThread::lock();
         if (fx.isWaiting())
             fx.wake(FutexThread::WakeForJSInterrupt);
-        fx.unlock();
+        FutexThread::unlock();
         InterruptRunningJitCode(this);
     }
 }
 
 bool
 JSContext::handleInterrupt()
 {
     MOZ_ASSERT(CurrentThreadCanAccessRuntime(runtime()));
--- a/js/src/vm/TypedArrayObject.h
+++ b/js/src/vm/TypedArrayObject.h
@@ -151,17 +151,17 @@ class TypedArrayObject : public NativeOb
     }
     uint32_t length() const {
         return lengthValue(const_cast<TypedArrayObject*>(this)).toInt32();
     }
 
     bool hasInlineElements() const;
     void setInlineElements();
     uint8_t* elementsRaw() const {
-        return *(uint8_t **)((((char *)this) + this->dataOffset()));
+        return *(uint8_t **)((((char *)this) + js::TypedArrayObject::dataOffset()));
     }
     uint8_t* elements() const {
         assertZeroLengthArrayData();
         return elementsRaw();
     }
 
 #ifdef DEBUG
     void assertZeroLengthArrayData() const;
--- a/js/src/wasm/WasmBaselineCompile.cpp
+++ b/js/src/wasm/WasmBaselineCompile.cpp
@@ -1128,17 +1128,17 @@ class BaseStackFrame
         localSize_(UINT32_MAX),
         varLow_(UINT32_MAX),
         varHigh_(UINT32_MAX),
 #ifdef RABALDR_CHUNKY_STACK
         currentFramePushed_(0),
 #endif
         maxFramePushed_(0),
         stackAddOffset_(0),
-        sp_(masm.getStackPointer())
+        sp_(MacroAssembler::getStackPointer())
     {}
 
     //////////////////////////////////////////////////////////////////////
     //
     // The local area.
 
     // Locals - the static part of the frame.
 
@@ -3170,19 +3170,19 @@ class BaseCompiler final : public BaseCo
                                  mode_ == CompileMode::Tier1 ? Some(func_.index) : Nothing());
 
         fr.endFunctionPrologue();
 
         if (debugEnabled_) {
             // Initialize funcIndex and flag fields of DebugFrame.
             size_t debugFrame = masm.framePushed() - DebugFrame::offsetOfFrame();
             masm.store32(Imm32(func_.index),
-                         Address(masm.getStackPointer(), debugFrame + DebugFrame::offsetOfFuncIndex()));
+                         Address(MacroAssembler::getStackPointer(), debugFrame + DebugFrame::offsetOfFuncIndex()));
             masm.storePtr(ImmWord(0),
-                          Address(masm.getStackPointer(), debugFrame + DebugFrame::offsetOfFlagsWord()));
+                          Address(MacroAssembler::getStackPointer(), debugFrame + DebugFrame::offsetOfFlagsWord()));
         }
 
         fr.allocStack(ABINonArgReg0, trapOffset);
 
         // Copy arguments from registers to stack.
 
         const ValTypeVector& args = sig().args();
 
@@ -3214,17 +3214,17 @@ class BaseCompiler final : public BaseCo
 
         if (debugEnabled_)
             insertBreakablePoint(CallSiteDesc::EnterFrame);
     }
 
     void saveResult() {
         MOZ_ASSERT(debugEnabled_);
         size_t debugFrameOffset = masm.framePushed() - DebugFrame::offsetOfFrame();
-        Address resultsAddress(masm.getStackPointer(), debugFrameOffset + DebugFrame::offsetOfResults());
+        Address resultsAddress(MacroAssembler::getStackPointer(), debugFrameOffset + DebugFrame::offsetOfResults());
         switch (sig().ret()) {
           case ExprType::Void:
             break;
           case ExprType::I32:
             masm.store32(RegI32(ReturnReg), resultsAddress);
             break;
           case ExprType::I64:
             masm.store64(RegI64(ReturnReg64), resultsAddress);
@@ -3238,17 +3238,17 @@ class BaseCompiler final : public BaseCo
           default:
             MOZ_CRASH("Function return type");
         }
     }
 
     void restoreResult() {
         MOZ_ASSERT(debugEnabled_);
         size_t debugFrameOffset = masm.framePushed() - DebugFrame::offsetOfFrame();
-        Address resultsAddress(masm.getStackPointer(), debugFrameOffset + DebugFrame::offsetOfResults());
+        Address resultsAddress(MacroAssembler::getStackPointer(), debugFrameOffset + DebugFrame::offsetOfResults());
         switch (sig().ret()) {
           case ExprType::Void:
             break;
           case ExprType::I32:
             masm.load32(resultsAddress, RegI32(ReturnReg));
             break;
           case ExprType::I64:
             masm.load64(resultsAddress, RegI64(ReturnReg64));
@@ -3432,29 +3432,29 @@ class BaseCompiler final : public BaseCo
 
     void passArg(ValType type, const Stk& arg, FunctionCall* call) {
         switch (type) {
           case ValType::I32: {
             ABIArg argLoc = call->abi.next(MIRType::Int32);
             if (argLoc.kind() == ABIArg::Stack) {
                 ScratchI32 scratch(*this);
                 loadI32(arg, scratch);
-                masm.store32(scratch, Address(masm.getStackPointer(), argLoc.offsetFromArgBase()));
+                masm.store32(scratch, Address(MacroAssembler::getStackPointer(), argLoc.offsetFromArgBase()));
             } else {
                 loadI32(arg, RegI32(argLoc.gpr()));
             }
             break;
           }
           case ValType::I64: {
             ABIArg argLoc = call->abi.next(MIRType::Int64);
             if (argLoc.kind() == ABIArg::Stack) {
                 ScratchI32 scratch(*this);
 #ifdef JS_PUNBOX64
                 loadI64(arg, fromI32(scratch));
-                masm.storePtr(scratch, Address(masm.getStackPointer(), argLoc.offsetFromArgBase()));
+                masm.storePtr(scratch, Address(MacroAssembler::getStackPointer(), argLoc.offsetFromArgBase()));
 #else
                 loadI64Low(arg, scratch);
                 masm.store32(scratch, LowWord(Address(masm.getStackPointer(), argLoc.offsetFromArgBase())));
                 loadI64High(arg, scratch);
                 masm.store32(scratch, HighWord(Address(masm.getStackPointer(), argLoc.offsetFromArgBase())));
 #endif
             } else {
                 loadI64(arg, RegI64(argLoc.gpr64()));
@@ -3462,17 +3462,17 @@ class BaseCompiler final : public BaseCo
             break;
           }
           case ValType::F64: {
             ABIArg argLoc = call->abi.next(MIRType::Double);
             switch (argLoc.kind()) {
               case ABIArg::Stack: {
                 ScratchF64 scratch(*this);
                 loadF64(arg, scratch);
-                masm.storeDouble(scratch, Address(masm.getStackPointer(), argLoc.offsetFromArgBase()));
+                masm.storeDouble(scratch, Address(MacroAssembler::getStackPointer(), argLoc.offsetFromArgBase()));
                 break;
               }
 #if defined(JS_CODEGEN_REGISTER_PAIR)
               case ABIArg::GPR_PAIR: {
 # if defined(JS_CODEGEN_ARM)
                 ScratchF64 scratch(*this);
                 loadF64(arg, scratch);
                 masm.ma_vxfer(scratch, argLoc.evenGpr(), argLoc.oddGpr());
@@ -3502,17 +3502,17 @@ class BaseCompiler final : public BaseCo
             break;
           }
           case ValType::F32: {
             ABIArg argLoc = call->abi.next(MIRType::Float32);
             switch (argLoc.kind()) {
               case ABIArg::Stack: {
                 ScratchF32 scratch(*this);
                 loadF32(arg, scratch);
-                masm.storeFloat32(scratch, Address(masm.getStackPointer(), argLoc.offsetFromArgBase()));
+                masm.storeFloat32(scratch, Address(MacroAssembler::getStackPointer(), argLoc.offsetFromArgBase()));
                 break;
               }
               case ABIArg::GPR: {
                 ScratchF32 scratch(*this);
                 loadF32(arg, scratch);
                 masm.moveFloat32ToGPR(scratch, argLoc.gpr());
                 break;
               }
--- a/js/src/wasm/WasmStubs.cpp
+++ b/js/src/wasm/WasmStubs.cpp
@@ -129,56 +129,56 @@ SetupABIArguments(MacroAssembler& masm, 
                 break;
             }
             break;
           }
           case ABIArg::Stack:
             switch (type) {
               case MIRType::Int32:
                 masm.load32(src, scratch);
-                masm.storePtr(scratch, Address(masm.getStackPointer(), iter->offsetFromArgBase()));
+                masm.storePtr(scratch, Address(MacroAssembler::getStackPointer(), iter->offsetFromArgBase()));
                 break;
               case MIRType::Int64: {
-                RegisterOrSP sp = masm.getStackPointer();
+                RegisterOrSP sp = MacroAssembler::getStackPointer();
 #if JS_BITS_PER_WORD == 32
                 masm.load32(LowWord(src), scratch);
                 masm.store32(scratch, LowWord(Address(sp, iter->offsetFromArgBase())));
                 masm.load32(HighWord(src), scratch);
                 masm.store32(scratch, HighWord(Address(sp, iter->offsetFromArgBase())));
 #else
                 Register64 scratch64(scratch);
                 masm.load64(src, scratch64);
                 masm.store64(scratch64, Address(sp, iter->offsetFromArgBase()));
 #endif
                 break;
               }
               case MIRType::Double:
                 masm.loadDouble(src, ScratchDoubleReg);
                 masm.storeDouble(ScratchDoubleReg,
-                                 Address(masm.getStackPointer(), iter->offsetFromArgBase()));
+                                 Address(MacroAssembler::getStackPointer(), iter->offsetFromArgBase()));
                 break;
               case MIRType::Float32:
                 masm.loadFloat32(src, ScratchFloat32Reg);
                 masm.storeFloat32(ScratchFloat32Reg,
-                                  Address(masm.getStackPointer(), iter->offsetFromArgBase()));
+                                  Address(MacroAssembler::getStackPointer(), iter->offsetFromArgBase()));
                 break;
               case MIRType::Int8x16:
               case MIRType::Int16x8:
               case MIRType::Int32x4:
               case MIRType::Bool8x16:
               case MIRType::Bool16x8:
               case MIRType::Bool32x4:
                 masm.loadUnalignedSimd128Int(src, ScratchSimd128Reg);
                 masm.storeAlignedSimd128Int(
-                  ScratchSimd128Reg, Address(masm.getStackPointer(), iter->offsetFromArgBase()));
+                  ScratchSimd128Reg, Address(MacroAssembler::getStackPointer(), iter->offsetFromArgBase()));
                 break;
               case MIRType::Float32x4:
                 masm.loadUnalignedSimd128Float(src, ScratchSimd128Reg);
                 masm.storeAlignedSimd128Float(
-                  ScratchSimd128Reg, Address(masm.getStackPointer(), iter->offsetFromArgBase()));
+                  ScratchSimd128Reg, Address(MacroAssembler::getStackPointer(), iter->offsetFromArgBase()));
                 break;
               default:
                 MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("unexpected stack arg type");
             }
             break;
           case ABIArg::Uninitialized:
             MOZ_CRASH("Uninitialized ABIArg kind");
         }
@@ -358,24 +358,24 @@ GenerateInterpEntry(MacroAssembler& masm
     ABIArgGenerator abi;
     ABIArg arg;
 
     // arg 1: ExportArg*
     arg = abi.next(MIRType::Pointer);
     if (arg.kind() == ABIArg::GPR)
         masm.movePtr(arg.gpr(), argv);
     else
-        masm.loadPtr(Address(masm.getStackPointer(), argBase + arg.offsetFromArgBase()), argv);
+        masm.loadPtr(Address(MacroAssembler::getStackPointer(), argBase + arg.offsetFromArgBase()), argv);
 
     // Arg 2: TlsData*
     arg = abi.next(MIRType::Pointer);
     if (arg.kind() == ABIArg::GPR)
         masm.movePtr(arg.gpr(), WasmTlsReg);
     else
-        masm.loadPtr(Address(masm.getStackPointer(), argBase + arg.offsetFromArgBase()), WasmTlsReg);
+        masm.loadPtr(Address(MacroAssembler::getStackPointer(), argBase + arg.offsetFromArgBase()), WasmTlsReg);
 
     // Save 'argv' on the stack so that we can recover it after the call.
     WasmPush(masm, argv);
 
     // Since we're about to dynamically align the stack, reset the frame depth
     // so we can still assert static stack depth balancing.
     MOZ_ASSERT(masm.framePushed() == FramePushedBeforeAlign);
     masm.setFramePushed(0);
@@ -481,17 +481,17 @@ CallSymbolicAddress(MacroAssembler& masm
 // Load instance's TLS from the callee.
 static void
 GenerateJitEntryLoadTls(MacroAssembler& masm, unsigned frameSize)
 {
     AssertExpectedSP(masm);
 
     // ScratchIonEntry := callee => JSFunction*
     unsigned offset = frameSize + JitFrameLayout::offsetOfCalleeToken();
-    masm.loadFunctionFromCalleeToken(Address(masm.getStackPointer(), offset), ScratchIonEntry);
+    masm.loadFunctionFromCalleeToken(Address(MacroAssembler::getStackPointer(), offset), ScratchIonEntry);
 
     // ScratchValIonEntry := callee->getExtendedSlot(WASM_TLSDATA_SLOT)
     //                    => Private(TlsData*)
     offset = FunctionExtended::offsetOfExtendedSlot(FunctionExtended::WASM_TLSDATA_SLOT);
     masm.loadValue(Address(ScratchIonEntry, offset), ScratchValIonEntry);
 
     // ScratchIonEntry := ScratchIonEntry->toPrivate() => TlsData*
     masm.unboxPrivate(ScratchValIonEntry, WasmTlsReg);
@@ -527,18 +527,17 @@ GenerateJitEntryThrow(MacroAssembler& ma
 // recompute it on every return path, be it normal return or exception return.
 // The JIT code we return to assumes it is correct.
 
 static bool
 GenerateJitEntry(MacroAssembler& masm, size_t funcExportIndex, const FuncExport& fe,
                  const Maybe<ImmPtr>& funcPtr, Offsets* offsets)
 {
     AssertExpectedSP(masm);
-
-    RegisterOrSP sp = masm.getStackPointer();
+    RegisterOrSP sp = MacroAssembler::getStackPointer();
 
     GenerateJitEntryPrologue(masm, offsets);
 
     // The jit caller has set up the following stack layout (sp grows to the
     // left):
     // <-- retAddr | descriptor | callee | argc | this | arg1..N
 
     unsigned normalBytesNeeded = StackArgBytes(fe.sig().args());
@@ -858,17 +857,17 @@ StackCopy(MacroAssembler& masm, MIRType 
 
 typedef bool ToValue;
 
 static void
 FillArgumentArray(MacroAssembler& masm, const ValTypeVector& args, unsigned argOffset,
                   unsigned offsetToCallerStackArgs, Register scratch, ToValue toValue)
 {
     for (ABIArgValTypeIter i(args); !i.done(); i++) {
-        Address dst(masm.getStackPointer(), argOffset + i.index() * sizeof(Value));
+        Address dst(MacroAssembler::getStackPointer(), argOffset + i.index() * sizeof(Value));
 
         MIRType type = i.mirType();
         switch (i->kind()) {
           case ABIArg::GPR:
             if (type == MIRType::Int32) {
                 if (toValue)
                     masm.storeValue(JSVAL_TYPE_INT32, i->gpr(), dst);
                 else
@@ -914,17 +913,17 @@ FillArgumentArray(MacroAssembler& masm, 
                     masm.moveFloat32(srcReg, ScratchFloat32Reg);
                     masm.canonicalizeFloat(ScratchFloat32Reg);
                     masm.storeFloat32(ScratchFloat32Reg, dst);
                 }
             }
             break;
           }
           case ABIArg::Stack: {
-            Address src(masm.getStackPointer(), offsetToCallerStackArgs + i->offsetFromArgBase());
+            Address src(MacroAssembler::getStackPointer(), offsetToCallerStackArgs + i->offsetFromArgBase());
             if (toValue) {
                 if (type == MIRType::Int32) {
                     masm.load32(src, scratch);
                     masm.storeValue(JSVAL_TYPE_INT32, scratch, dst);
                 } else if (type == MIRType::Int64) {
                     // We can't box int64 into Values (yet).
                     masm.breakpoint();
                 } else {
@@ -973,18 +972,18 @@ GenerateImportFunction(jit::MacroAssembl
 
     // Copy our frame's stack arguments to the callee frame's stack argument.
     unsigned offsetToCallerStackArgs = sizeof(Frame) + masm.framePushed();
     ABIArgValTypeIter i(fi.sig().args());
     for (; !i.done(); i++) {
         if (i->kind() != ABIArg::Stack)
             continue;
 
-        Address src(masm.getStackPointer(), offsetToCallerStackArgs + i->offsetFromArgBase());
-        Address dst(masm.getStackPointer(), i->offsetFromArgBase());
+        Address src(jit::MacroAssembler::getStackPointer(), offsetToCallerStackArgs + i->offsetFromArgBase());
+        Address dst(jit::MacroAssembler::getStackPointer(), i->offsetFromArgBase());
         StackCopy(masm, i.mirType(), scratch, src, dst);
     }
 
     // Call the import exit stub.
     CallSiteDesc desc(CallSiteDesc::Dynamic);
     MoveSPForJitABI(masm);
     masm.wasmCallImport(desc, CalleeDesc::import(fi.tlsDataOffset()));
 
@@ -1063,42 +1062,42 @@ GenerateImportInterpExit(MacroAssembler&
     ABIArgMIRTypeIter i(invokeArgTypes);
 
     // argument 0: Instance*
     Address instancePtr(WasmTlsReg, offsetof(TlsData, instance));
     if (i->kind() == ABIArg::GPR) {
         masm.loadPtr(instancePtr, i->gpr());
     } else {
         masm.loadPtr(instancePtr, scratch);
-        masm.storePtr(scratch, Address(masm.getStackPointer(), i->offsetFromArgBase()));
+        masm.storePtr(scratch, Address(MacroAssembler::getStackPointer(), i->offsetFromArgBase()));
     }
     i++;
 
     // argument 1: funcImportIndex
     if (i->kind() == ABIArg::GPR)
         masm.mov(ImmWord(funcImportIndex), i->gpr());
     else
-        masm.store32(Imm32(funcImportIndex), Address(masm.getStackPointer(), i->offsetFromArgBase()));
+        masm.store32(Imm32(funcImportIndex), Address(MacroAssembler::getStackPointer(), i->offsetFromArgBase()));
     i++;
 
     // argument 2: argc
     unsigned argc = fi.sig().args().length();
     if (i->kind() == ABIArg::GPR)
         masm.mov(ImmWord(argc), i->gpr());
     else
-        masm.store32(Imm32(argc), Address(masm.getStackPointer(), i->offsetFromArgBase()));
+        masm.store32(Imm32(argc), Address(MacroAssembler::getStackPointer(), i->offsetFromArgBase()));
     i++;
 
     // argument 3: argv
-    Address argv(masm.getStackPointer(), argOffset);
+    Address argv(MacroAssembler::getStackPointer(), argOffset);
     if (i->kind() == ABIArg::GPR) {
         masm.computeEffectiveAddress(argv, i->gpr());
     } else {
         masm.computeEffectiveAddress(argv, scratch);
-        masm.storePtr(scratch, Address(masm.getStackPointer(), i->offsetFromArgBase()));
+        masm.storePtr(scratch, Address(MacroAssembler::getStackPointer(), i->offsetFromArgBase()));
     }
     i++;
     MOZ_ASSERT(i.done());
 
     // Make the call, test whether it succeeded, and extract the return value.
     AssertStackAlignment(masm, ABIStackAlignment);
     switch (fi.sig().ret()) {
       case ExprType::Void:
@@ -1184,38 +1183,38 @@ GenerateImportJitExit(MacroAssembler& ma
 #endif
 
     GenerateJitExitPrologue(masm, jitFramePushed + frameAlignExtra, offsets);
 
     // 1. Descriptor
     size_t argOffset = frameAlignExtra;
     uint32_t descriptor = MakeFrameDescriptor(sizeOfThisAndArgsAndPadding, JitFrame_WasmToJSJit,
                                               WasmToJSJitFrameLayout::Size());
-    masm.storePtr(ImmWord(uintptr_t(descriptor)), Address(masm.getStackPointer(), argOffset));
+    masm.storePtr(ImmWord(uintptr_t(descriptor)), Address(MacroAssembler::getStackPointer(), argOffset));
     argOffset += sizeof(size_t);
 
     // 2. Callee
     Register callee = ABINonArgReturnReg0;   // live until call
     Register scratch = ABINonArgReturnReg1;  // repeatedly clobbered
 
     // 2.1. Get JSFunction callee
     masm.loadWasmGlobalPtr(fi.tlsDataOffset() + offsetof(FuncImportTls, obj), callee);
 
     // 2.2. Save callee
-    masm.storePtr(callee, Address(masm.getStackPointer(), argOffset));
+    masm.storePtr(callee, Address(MacroAssembler::getStackPointer(), argOffset));
     argOffset += sizeof(size_t);
 
     // 3. Argc
     unsigned argc = fi.sig().args().length();
-    masm.storePtr(ImmWord(uintptr_t(argc)), Address(masm.getStackPointer(), argOffset));
+    masm.storePtr(ImmWord(uintptr_t(argc)), Address(MacroAssembler::getStackPointer(), argOffset));
     argOffset += sizeof(size_t);
     MOZ_ASSERT(argOffset == sizeOfPreFrame + frameAlignExtra);
 
     // 4. |this| value
-    masm.storeValue(UndefinedValue(), Address(masm.getStackPointer(), argOffset));
+    masm.storeValue(UndefinedValue(), Address(MacroAssembler::getStackPointer(), argOffset));
     argOffset += sizeof(Value);
 
     // 5. Fill the arguments
     unsigned offsetToCallerStackArgs = jitFramePushed + sizeof(Frame);
     FillArgumentArray(masm, fi.sig().args(), argOffset, offsetToCallerStackArgs, scratch, ToValue(true));
     argOffset += fi.sig().args().length() * sizeof(Value);
     MOZ_ASSERT(argOffset == sizeOfThisAndArgs + sizeOfPreFrame + frameAlignExtra);
 
@@ -1335,52 +1334,52 @@ GenerateImportJitExit(MacroAssembler& ma
         //   | args | padding | Value argv[1] | padding | exit Frame |
         MIRTypeVector coerceArgTypes;
         MOZ_ALWAYS_TRUE(coerceArgTypes.append(MIRType::Pointer));
         unsigned offsetToCoerceArgv = AlignBytes(StackArgBytes(coerceArgTypes), sizeof(Value));
         MOZ_ASSERT(nativeFramePushed >= offsetToCoerceArgv + sizeof(Value));
         AssertStackAlignment(masm, ABIStackAlignment);
 
         // Store return value into argv[0]
-        masm.storeValue(JSReturnOperand, Address(masm.getStackPointer(), offsetToCoerceArgv));
+        masm.storeValue(JSReturnOperand, Address(MacroAssembler::getStackPointer(), offsetToCoerceArgv));
 
         // From this point, it's safe to reuse the scratch register (which
         // might be part of the JSReturnOperand).
 
         // The JIT might have clobbered exitFP at this point. Since there's
         // going to be a CoerceInPlace call, pretend we're still doing the JIT
         // call by restoring our tagged exitFP.
         SetExitFP(masm, ExitReason::Fixed::ImportJit, scratch);
 
         // argument 0: argv
         ABIArgMIRTypeIter i(coerceArgTypes);
-        Address argv(masm.getStackPointer(), offsetToCoerceArgv);
+        Address argv(MacroAssembler::getStackPointer(), offsetToCoerceArgv);
         if (i->kind() == ABIArg::GPR) {
             masm.computeEffectiveAddress(argv, i->gpr());
         } else {
             masm.computeEffectiveAddress(argv, scratch);
-            masm.storePtr(scratch, Address(masm.getStackPointer(), i->offsetFromArgBase()));
+            masm.storePtr(scratch, Address(MacroAssembler::getStackPointer(), i->offsetFromArgBase()));
         }
         i++;
         MOZ_ASSERT(i.done());
 
         // Call coercion function. Note that right after the call, the value of
         // FP is correct because FP is non-volatile in the native ABI.
         AssertStackAlignment(masm, ABIStackAlignment);
         switch (fi.sig().ret()) {
           case ExprType::I32:
             masm.call(SymbolicAddress::CoerceInPlace_ToInt32);
             masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, throwLabel);
-            masm.unboxInt32(Address(masm.getStackPointer(), offsetToCoerceArgv), ReturnReg);
+            masm.unboxInt32(Address(MacroAssembler::getStackPointer(), offsetToCoerceArgv), ReturnReg);
             break;
           case ExprType::F64:
           case ExprType::F32:
             masm.call(SymbolicAddress::CoerceInPlace_ToNumber);
             masm.branchTest32(Assembler::Zero, ReturnReg, ReturnReg, throwLabel);
-            masm.loadDouble(Address(masm.getStackPointer(), offsetToCoerceArgv), ReturnDoubleReg);
+            masm.loadDouble(Address(MacroAssembler::getStackPointer(), offsetToCoerceArgv), ReturnDoubleReg);
             if (fi.sig().ret() == ExprType::F32)
                 masm.convertDoubleToFloat32(ReturnDoubleReg, ReturnFloat32Reg);
             break;
           default:
             MOZ_CRASH("Unsupported convert type");
         }
 
         // Maintain the invariant that exitFP is either unset or not set to a
@@ -1450,18 +1449,18 @@ wasm::GenerateBuiltinThunk(MacroAssemble
                     uint32_t regId = input.singleOverlay().id();
                     masm.ma_vxfer(input, Register::FromCode(regId), Register::FromCode(regId + 1));
                 }
             }
 #endif
             continue;
         }
 
-        Address src(masm.getStackPointer(), offsetToCallerStackArgs + i->offsetFromArgBase());
-        Address dst(masm.getStackPointer(), i->offsetFromArgBase());
+        Address src(MacroAssembler::getStackPointer(), offsetToCallerStackArgs + i->offsetFromArgBase());
+        Address dst(MacroAssembler::getStackPointer(), i->offsetFromArgBase());
         StackCopy(masm, i.mirType(), scratch, src, dst);
     }
 
     AssertStackAlignment(masm, ABIStackAlignment);
     MoveSPForJitABI(masm);
     masm.call(ImmPtr(funcPtr, ImmPtr::NoCheckToken()));
 
 #if defined(JS_CODEGEN_X86)
@@ -1528,17 +1527,17 @@ GenerateOldTrapExit(MacroAssembler& masm
     uint32_t framePushed = StackDecrementForCall(masm, ABIStackAlignment, args);
 
     GenerateExitPrologue(masm, framePushed, ExitReason::Fixed::Trap, offsets);
 
     ABIArgMIRTypeIter i(args);
     if (i->kind() == ABIArg::GPR)
         masm.move32(Imm32(int32_t(trap)), i->gpr());
     else
-        masm.store32(Imm32(int32_t(trap)), Address(masm.getStackPointer(), i->offsetFromArgBase()));
+        masm.store32(Imm32(int32_t(trap)), Address(MacroAssembler::getStackPointer(), i->offsetFromArgBase()));
     i++;
     MOZ_ASSERT(i.done());
 
     masm.assertStackAlignment(ABIStackAlignment);
     masm.call(SymbolicAddress::OldReportTrap);
 
     masm.jump(throwLabel);
 
@@ -1897,17 +1896,17 @@ GenerateDebugTrapStub(MacroAssembler& ma
 #ifdef JS_CODEGEN_ARM64
     // On ARM64 however the stack is always aligned.
     static_assert(ABIStackAlignment == 16, "ARM64 SP alignment");
 #else
     Register scratch = ABINonArgReturnReg0;
     masm.moveStackPtrTo(scratch);
     masm.subFromStackPtr(Imm32(sizeof(intptr_t)));
     masm.andToStackPtr(Imm32(~(ABIStackAlignment - 1)));
-    masm.storePtr(scratch, Address(masm.getStackPointer(), 0));
+    masm.storePtr(scratch, Address(MacroAssembler::getStackPointer(), 0));
 #endif
 
     if (ShadowStackSpace)
         masm.subFromStackPtr(Imm32(ShadowStackSpace));
     masm.assertStackAlignment(ABIStackAlignment);
     masm.call(SymbolicAddress::HandleDebugTrap);
 
     masm.branchIfFalseBool(ReturnReg, throwLabel);
--- a/js/xpconnect/loader/URLPreloader.h
+++ b/js/xpconnect/loader/URLPreloader.h
@@ -121,17 +121,17 @@ protected:
         }
 
         ~AutoBeginReading()
         {
             auto& reader = GetSingleton();
 
             MonitorAutoLock mal(reader.mMonitor);
 
-            while (!reader.mReaderInitialized && reader.sInitialized) {
+            while (!reader.mReaderInitialized && URLPreloader::sInitialized) {
                 mal.Wait();
             }
         }
     };
 
 private:
     // Represents a key for an entry in the URI cache, based on its file or JAR
     // location.
--- a/js/xpconnect/wrappers/XrayWrapper.cpp
+++ b/js/xpconnect/wrappers/XrayWrapper.cpp
@@ -953,17 +953,17 @@ bool
 JSXrayTraits::construct(JSContext* cx, HandleObject wrapper,
                         const JS::CallArgs& args, const js::Wrapper& baseInstance)
 {
     JSXrayTraits& self = JSXrayTraits::singleton;
     JS::RootedObject holder(cx, self.ensureHolder(cx, wrapper));
     if (!holder)
         return false;
 
-    if (self.getProtoKey(holder) == JSProto_Function) {
+    if (xpc::JSXrayTraits::getProtoKey(holder) == JSProto_Function) {
         JSProtoKey standardConstructor = constructorFor(holder);
         if (standardConstructor == JSProto_Null)
             return baseInstance.construct(cx, wrapper, args);
 
         const js::Class* clasp = js::ProtoKeyToClass(standardConstructor);
         MOZ_ASSERT(clasp);
         if (!(clasp->flags & JSCLASS_HAS_XRAYED_CONSTRUCTOR))
             return baseInstance.construct(cx, wrapper, args);
--- a/js/xpconnect/wrappers/XrayWrapper.h
+++ b/js/xpconnect/wrappers/XrayWrapper.h
@@ -273,17 +273,17 @@ public:
     virtual bool enumerateNames(JSContext* cx, JS::HandleObject wrapper, unsigned flags,
                                 JS::AutoIdVector& props);
 
     static bool call(JSContext* cx, JS::HandleObject wrapper,
                      const JS::CallArgs& args, const js::Wrapper& baseInstance)
     {
         JSXrayTraits& self = JSXrayTraits::singleton;
         JS::RootedObject holder(cx, self.ensureHolder(cx, wrapper));
-        if (self.getProtoKey(holder) == JSProto_Function)
+        if (xpc::JSXrayTraits::getProtoKey(holder) == JSProto_Function)
             return baseInstance.call(cx, wrapper, args);
 
         JS::RootedValue v(cx, JS::ObjectValue(*wrapper));
         js::ReportIsNotFunction(cx, v);
         return false;
     }
 
     static bool construct(JSContext* cx, JS::HandleObject wrapper,
--- a/layout/base/AccessibleCaretEventHub.cpp
+++ b/layout/base/AccessibleCaretEventHub.cpp
@@ -46,32 +46,32 @@ public:
 
   nsEventStatus OnPress(AccessibleCaretEventHub* aContext,
                         const nsPoint& aPoint, int32_t aTouchId,
                         EventClassID aEventClass) override
   {
     nsEventStatus rv = nsEventStatus_eIgnore;
 
     if (NS_SUCCEEDED(aContext->mManager->PressCaret(aPoint, aEventClass))) {
-      aContext->SetState(aContext->PressCaretState());
+      aContext->SetState(AccessibleCaretEventHub::PressCaretState());
       rv = nsEventStatus_eConsumeNoDefault;
     } else {
-      aContext->SetState(aContext->PressNoCaretState());
+      aContext->SetState(AccessibleCaretEventHub::PressNoCaretState());
     }
 
     aContext->mPressPoint = aPoint;
     aContext->mActiveTouchId = aTouchId;
 
     return rv;
   }
 
   void OnScrollStart(AccessibleCaretEventHub* aContext) override
   {
     aContext->mManager->OnScrollStart();
-    aContext->SetState(aContext->ScrollState());
+    aContext->SetState(AccessibleCaretEventHub::ScrollState());
   }
 
   void OnScrollPositionChanged(AccessibleCaretEventHub* aContext) override
   {
     aContext->mManager->OnScrollPositionChanged();
   }
 
   void OnSelectionChanged(AccessibleCaretEventHub* aContext,
@@ -108,28 +108,28 @@ class AccessibleCaretEventHub::PressCare
 public:
   const char* Name() const override { return "PressCaretState"; }
 
   nsEventStatus OnMove(AccessibleCaretEventHub* aContext,
                        const nsPoint& aPoint) override
   {
     if (aContext->MoveDistanceIsLarge(aPoint)) {
       if (NS_SUCCEEDED(aContext->mManager->DragCaret(aPoint))) {
-        aContext->SetState(aContext->DragCaretState());
+        aContext->SetState(AccessibleCaretEventHub::DragCaretState());
       }
     }
 
     return nsEventStatus_eConsumeNoDefault;
   }
 
   nsEventStatus OnRelease(AccessibleCaretEventHub* aContext) override
   {
     aContext->mManager->ReleaseCaret();
     aContext->mManager->TapCaret(aContext->mPressPoint);
-    aContext->SetState(aContext->NoActionState());
+    aContext->SetState(AccessibleCaretEventHub::NoActionState());
 
     return nsEventStatus_eConsumeNoDefault;
   }
 
   nsEventStatus OnLongTap(AccessibleCaretEventHub* aContext,
                           const nsPoint& aPoint) override
   {
     return nsEventStatus_eConsumeNoDefault;
@@ -151,17 +151,17 @@ public:
     aContext->mManager->DragCaret(aPoint);
 
     return nsEventStatus_eConsumeNoDefault;
   }
 
   nsEventStatus OnRelease(AccessibleCaretEventHub* aContext) override
   {
     aContext->mManager->ReleaseCaret();
-    aContext->SetState(aContext->NoActionState());
+    aContext->SetState(AccessibleCaretEventHub::NoActionState());
 
     return nsEventStatus_eConsumeNoDefault;
   }
 };
 
 // -----------------------------------------------------------------------------
 // PressNoCaretState
 //
@@ -170,49 +170,49 @@ class AccessibleCaretEventHub::PressNoCa
 {
 public:
   const char* Name() const override { return "PressNoCaretState"; }
 
   nsEventStatus OnMove(AccessibleCaretEventHub* aContext,
                        const nsPoint& aPoint) override
   {
     if (aContext->MoveDistanceIsLarge(aPoint)) {
-      aContext->SetState(aContext->NoActionState());
+      aContext->SetState(AccessibleCaretEventHub::NoActionState());
     }
 
     return nsEventStatus_eIgnore;
   }
 
   nsEventStatus OnRelease(AccessibleCaretEventHub* aContext) override
   {
-    aContext->SetState(aContext->NoActionState());
+    aContext->SetState(AccessibleCaretEventHub::NoActionState());
 
     return nsEventStatus_eIgnore;
   }
 
   nsEventStatus OnLongTap(AccessibleCaretEventHub* aContext,
                           const nsPoint& aPoint) override
   {
-    aContext->SetState(aContext->LongTapState());
+    aContext->SetState(AccessibleCaretEventHub::LongTapState());
 
     return aContext->GetState()->OnLongTap(aContext, aPoint);
   }
 
   void OnScrollStart(AccessibleCaretEventHub* aContext) override
   {
     aContext->mManager->OnScrollStart();
-    aContext->SetState(aContext->ScrollState());
+    aContext->SetState(AccessibleCaretEventHub::ScrollState());
   }
 
   void OnBlur(AccessibleCaretEventHub* aContext,
               bool aIsLeavingDocument) override
   {
     aContext->mManager->OnBlur();
     if (aIsLeavingDocument) {
-      aContext->SetState(aContext->NoActionState());
+      aContext->SetState(AccessibleCaretEventHub::NoActionState());
     }
   }
 
   void OnSelectionChanged(AccessibleCaretEventHub* aContext,
                           nsIDOMDocument* aDoc, nsISelection* aSel,
                           int16_t aReason) override
   {
     aContext->mManager->OnSelectionChanged(aDoc, aSel, aReason);
@@ -241,30 +241,30 @@ class AccessibleCaretEventHub::ScrollSta
   : public AccessibleCaretEventHub::State
 {
 public:
   const char* Name() const override { return "ScrollState"; }
 
   void OnScrollEnd(AccessibleCaretEventHub* aContext) override
   {
     aContext->mManager->OnScrollEnd();
-    aContext->SetState(aContext->NoActionState());
+    aContext->SetState(AccessibleCaretEventHub::NoActionState());
   }
 
   void OnScrollPositionChanged(AccessibleCaretEventHub* aContext) override
   {
     aContext->mManager->OnScrollPositionChanged();
   }
 
   void OnBlur(AccessibleCaretEventHub* aContext,
               bool aIsLeavingDocument) override
   {
     aContext->mManager->OnBlur();
     if (aIsLeavingDocument) {
-      aContext->SetState(aContext->NoActionState());
+      aContext->SetState(AccessibleCaretEventHub::NoActionState());
     }
   }
 };
 
 // -----------------------------------------------------------------------------
 // LongTapState
 //
 class AccessibleCaretEventHub::LongTapState
@@ -281,27 +281,27 @@ public:
     // showing up on desktop Firefox (because that happens on long-tap-up, if
     // the long-tap was not cancelled). So we return eIgnore instead.
     aContext->mManager->SelectWordOrShortcut(aPoint);
     return nsEventStatus_eIgnore;
   }
 
   nsEventStatus OnRelease(AccessibleCaretEventHub* aContext) override
   {
-    aContext->SetState(aContext->NoActionState());
+    aContext->SetState(AccessibleCaretEventHub::NoActionState());
 
     // Do not consume the release since the press is not consumed in
     // PressNoCaretState either.
     return nsEventStatus_eIgnore;
   }
 
   void OnScrollStart(AccessibleCaretEventHub* aContext) override
   {
     aContext->mManager->OnScrollStart();
-    aContext->SetState(aContext->ScrollState());
+    aContext->SetState(AccessibleCaretEventHub::ScrollState());
   }
 
   void OnReflow(AccessibleCaretEventHub* aContext) override
   {
     aContext->mManager->OnReflow();
   }
 };
 
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -8205,17 +8205,17 @@ PresShell::GetCurrentItemAndPositionForE
         // need to know about trees? Something like nsINodelessChildCreator which
         // could provide the current focus coordinates?
         if (treeBox) {
           treeBox->EnsureRowIsVisible(currentIndex);
           int32_t firstVisibleRow, rowHeight;
           treeBox->GetFirstVisibleRow(&firstVisibleRow);
           treeBox->GetRowHeight(&rowHeight);
 
-          extraTreeY += presContext->CSSPixelsToAppUnits(
+          extraTreeY += nsPresContext::CSSPixelsToAppUnits(
                           (currentIndex - firstVisibleRow + 1) * rowHeight);
           istree = true;
 
           nsCOMPtr<nsITreeColumns> cols;
           treeBox->GetColumns(getter_AddRefs(cols));
           if (cols) {
             nsCOMPtr<nsITreeColumn> col;
             cols->GetFirstColumn(getter_AddRefs(col));
--- a/layout/base/ServoRestyleManager.cpp
+++ b/layout/base/ServoRestyleManager.cpp
@@ -596,17 +596,17 @@ UpdateBackdropIfNeeded(nsIFrame* aFrame,
 
   // NOTE(emilio): We can't use the changes handled for the owner of the
   // backdrop frame, since it's out of flow, and parented to the viewport or
   // canvas frame (depending on the `position` value).
   MOZ_ASSERT(backdropFrame->GetParent()->IsViewportFrame() ||
              backdropFrame->GetParent()->IsCanvasFrame());
   nsTArray<nsIFrame*> wrappersToRestyle;
   ServoRestyleState state(aStyleSet, aChangeList, wrappersToRestyle);
-  aFrame->UpdateStyleOfOwnedChildFrame(backdropFrame, newContext, state);
+  nsIFrame::UpdateStyleOfOwnedChildFrame(backdropFrame, newContext, state);
 }
 
 static void
 UpdateFirstLetterIfNeeded(nsIFrame* aFrame, ServoRestyleState& aRestyleState)
 {
   MOZ_ASSERT(!aFrame->IsFrameOfType(nsIFrame::eBlockFrame),
              "You're probably duplicating work with UpdatePseudoElementStyles!");
   if (!aFrame->HasFirstLetterChild()) {
--- a/layout/base/nsCounterManager.cpp
+++ b/layout/base/nsCounterManager.cpp
@@ -48,30 +48,30 @@ nsCounterUseNode::InitTextFrame(nsGenCon
 
 // assign the correct |mValueAfter| value to a node that has been inserted
 // Should be called immediately after calling |Insert|.
 void
 nsCounterUseNode::Calc(nsCounterList* aList)
 {
   NS_ASSERTION(!aList->IsDirty(),
                "Why are we calculating with a dirty list?");
-  mValueAfter = aList->ValueBefore(this);
+  mValueAfter = nsCounterList::ValueBefore(this);
 }
 
 // assign the correct |mValueAfter| value to a node that has been inserted
 // Should be called immediately after calling |Insert|.
 void
 nsCounterChangeNode::Calc(nsCounterList* aList)
 {
   NS_ASSERTION(!aList->IsDirty(), "Why are we calculating with a dirty list?");
   if (mType == RESET) {
     mValueAfter = mChangeValue;
   } else {
     NS_ASSERTION(mType == INCREMENT, "invalid type");
-    mValueAfter = nsCounterManager::IncrementCounter(aList->ValueBefore(this),
+    mValueAfter = nsCounterManager::IncrementCounter(nsCounterList::ValueBefore(this),
                                                      mChangeValue);
   }
 }
 
 // The text that should be displayed for this counter.
 void
 nsCounterUseNode::GetText(nsString& aResult)
 {
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -1084,18 +1084,18 @@ nsHTMLScrollFrame::Reflow(nsPresContext*
       reflowHScrollbar || reflowVScrollbar || reflowScrollCorner ||
       (GetStateBits() & NS_FRAME_IS_DIRTY) ||
       didHaveHScrollbar != state.mShowHScrollbar ||
       didHaveVScrollbar != state.mShowVScrollbar ||
       !oldScrollAreaBounds.IsEqualEdges(newScrollAreaBounds) ||
       !oldScrolledAreaBounds.IsEqualEdges(newScrolledAreaBounds)) {
     if (!mHelper.mSuppressScrollbarUpdate) {
       mHelper.mSkippedScrollbarLayout = false;
-      mHelper.SetScrollbarVisibility(mHelper.mHScrollbarBox, state.mShowHScrollbar);
-      mHelper.SetScrollbarVisibility(mHelper.mVScrollbarBox, state.mShowVScrollbar);
+      ScrollFrameHelper::SetScrollbarVisibility(mHelper.mHScrollbarBox, state.mShowHScrollbar);
+      ScrollFrameHelper::SetScrollbarVisibility(mHelper.mVScrollbarBox, state.mShowVScrollbar);
       // place and reflow scrollbars
       nsRect insideBorderArea =
         nsRect(nsPoint(state.mComputedBorder.left, state.mComputedBorder.top),
                state.mInsideBorderSize);
       mHelper.LayoutScrollbars(state.mBoxState, insideBorderArea,
                               oldScrollAreaBounds);
     } else {
       mHelper.mSkippedScrollbarLayout = true;
@@ -5037,49 +5037,49 @@ nsXULScrollFrame::AddRemoveScrollbar(nsB
 {
   if (aHorizontal) {
      if (mHelper.mNeverHasHorizontalScrollbar || !mHelper.mHScrollbarBox)
        return false;
 
      nsSize hSize = mHelper.mHScrollbarBox->GetXULPrefSize(aState);
      nsBox::AddMargin(mHelper.mHScrollbarBox, hSize);
 
-     mHelper.SetScrollbarVisibility(mHelper.mHScrollbarBox, aAdd);
+     ScrollFrameHelper::SetScrollbarVisibility(mHelper.mHScrollbarBox, aAdd);
 
      // We can't directly pass mHasHorizontalScrollbar as the bool outparam for
      // AddRemoveScrollbar() because it's a bool:1 bitfield. Hence this var:
      bool hasHorizontalScrollbar;
      bool fit = AddRemoveScrollbar(hasHorizontalScrollbar,
                                    mHelper.mScrollPort.y,
                                    mHelper.mScrollPort.height,
                                    hSize.height, aOnRightOrBottom, aAdd);
      mHelper.mHasHorizontalScrollbar = hasHorizontalScrollbar;
      if (!fit) {
-       mHelper.SetScrollbarVisibility(mHelper.mHScrollbarBox, !aAdd);
+       ScrollFrameHelper::SetScrollbarVisibility(mHelper.mHScrollbarBox, !aAdd);
      }
      return fit;
   } else {
      if (mHelper.mNeverHasVerticalScrollbar || !mHelper.mVScrollbarBox)
        return false;
 
      nsSize vSize = mHelper.mVScrollbarBox->GetXULPrefSize(aState);
      nsBox::AddMargin(mHelper.mVScrollbarBox, vSize);
 
-     mHelper.SetScrollbarVisibility(mHelper.mVScrollbarBox, aAdd);
+     ScrollFrameHelper::SetScrollbarVisibility(mHelper.mVScrollbarBox, aAdd);
 
      // We can't directly pass mHasVerticalScrollbar as the bool outparam for
      // AddRemoveScrollbar() because it's a bool:1 bitfield. Hence this var:
      bool hasVerticalScrollbar;
      bool fit = AddRemoveScrollbar(hasVerticalScrollbar,
                                    mHelper.mScrollPort.x,
                                    mHelper.mScrollPort.width,
                                    vSize.width, aOnRightOrBottom, aAdd);
      mHelper.mHasVerticalScrollbar = hasVerticalScrollbar;
      if (!fit) {
-       mHelper.SetScrollbarVisibility(mHelper.mVScrollbarBox, !aAdd);
+       ScrollFrameHelper::SetScrollbarVisibility(mHelper.mVScrollbarBox, !aAdd);
      }
      return fit;
   }
 }
 
 bool
 nsXULScrollFrame::AddRemoveScrollbar(bool& aHasScrollbar, nscoord& aXY,
                                      nscoord& aSize, nscoord aSbSize,
--- a/layout/generic/nsGridContainerFrame.cpp
+++ b/layout/generic/nsGridContainerFrame.cpp
@@ -3509,17 +3509,17 @@ MeasuringReflow(nsIFrame*           aChi
   // ReflowInput::COMPUTE_SIZE_USE_AUTO_BSIZE.
   childRI.SetBResize(true);
 
   ReflowOutput childSize(childRI);
   nsReflowStatus childStatus;
   const uint32_t flags = NS_FRAME_NO_MOVE_FRAME | NS_FRAME_NO_SIZE_VIEW;
   parent->ReflowChild(aChild, pc, childSize, childRI, wm,
                       LogicalPoint(wm), nsSize(), flags, childStatus);
-  parent->FinishReflowChild(aChild, pc, childSize, &childRI, wm,
+  nsContainerFrame::FinishReflowChild(aChild, pc, childSize, &childRI, wm,
                             LogicalPoint(wm), nsSize(), flags);
 #ifdef DEBUG
     parent->DeleteProperty(nsContainerFrame::DebugReflowingWithInfiniteISize());
 #endif
   return childSize.BSize(wm);
 }
 
 /**
--- a/layout/generic/nsSimplePageSequenceFrame.cpp
+++ b/layout/generic/nsSimplePageSequenceFrame.cpp
@@ -191,34 +191,34 @@ nsSimplePageSequenceFrame::Reflow(nsPres
     nsIntMargin unwriteableTwips;
     mPageData->mPrintSettings->GetUnwriteableMarginInTwips(unwriteableTwips);
     NS_ASSERTION(unwriteableTwips.left  >= 0 && unwriteableTwips.top >= 0 &&
                  unwriteableTwips.right >= 0 && unwriteableTwips.bottom >= 0,
                  "Unwriteable twips should be non-negative");
 
     nsIntMargin marginTwips;
     mPageData->mPrintSettings->GetMarginInTwips(marginTwips);
-    mMargin = aPresContext->CSSTwipsToAppUnits(marginTwips + unwriteableTwips);
+    mMargin = nsPresContext::CSSTwipsToAppUnits(marginTwips + unwriteableTwips);
 
     int16_t printType;
     mPageData->mPrintSettings->GetPrintRange(&printType);
     mPrintRangeType = printType;
 
     nsIntMargin edgeTwips;
     mPageData->mPrintSettings->GetEdgeInTwips(edgeTwips);
 
     // sanity check the values. three inches are sometimes needed
     int32_t inchInTwips = NS_INCHES_TO_INT_TWIPS(3.0);
     edgeTwips.top    = clamped(edgeTwips.top,    0, inchInTwips);
     edgeTwips.bottom = clamped(edgeTwips.bottom, 0, inchInTwips);
     edgeTwips.left   = clamped(edgeTwips.left,   0, inchInTwips);
     edgeTwips.right  = clamped(edgeTwips.right,  0, inchInTwips);
 
     mPageData->mEdgePaperMargin =
-      aPresContext->CSSTwipsToAppUnits(edgeTwips + unwriteableTwips);
+      nsPresContext::CSSTwipsToAppUnits(edgeTwips + unwriteableTwips);
   }
 
   // *** Special Override ***
   // If this is a sub-sdoc (meaning it doesn't take the whole page)
   // and if this Document is in the upper left hand corner
   // we need to suppress the top margin or it will reflow too small
 
   nsSize pageSize = aPresContext->GetPageSize();
--- a/layout/mathml/nsMathMLContainerFrame.cpp
+++ b/layout/mathml/nsMathMLContainerFrame.cpp
@@ -1363,17 +1363,17 @@ AddInterFrameSpacingToSize(ReflowOutput&
     return 0;
   }
   if (parentContent->IsAnyOfMathMLElements(nsGkAtoms::math,
                                            nsGkAtoms::mtd_)) {
     gap = GetInterFrameSpacingFor(aFrame->StyleFont()->mScriptLevel,
                                   parent, aFrame);
     // add our own italic correction
     nscoord leftCorrection = 0, italicCorrection = 0;
-    aFrame->GetItalicCorrection(aDesiredSize.mBoundingMetrics,
+    nsMathMLContainerFrame::GetItalicCorrection(aDesiredSize.mBoundingMetrics,
                                 leftCorrection, italicCorrection);
     gap += leftCorrection;
     if (gap) {
       aDesiredSize.mBoundingMetrics.leftBearing += gap;
       aDesiredSize.mBoundingMetrics.rightBearing += gap;
       aDesiredSize.mBoundingMetrics.width += gap;
       aDesiredSize.Width() += gap;
     }
--- a/layout/painting/ActiveLayerTracker.cpp
+++ b/layout/painting/ActiveLayerTracker.cpp
@@ -262,17 +262,17 @@ IncrementScaleRestyleCountIfNeeded(nsIFr
   RuleNodeCacheConditions dummy;
   bool dummyBool;
   nsStyleTransformMatrix::TransformReferenceBox refBox(aFrame);
   Matrix4x4 transform =
     nsStyleTransformMatrix::ReadTransforms(transformList->mHead,
                                            aFrame->StyleContext(),
                                            presContext,
                                            dummy, refBox,
-                                           presContext->AppUnitsPerCSSPixel(),
+                                           nsPresContext::AppUnitsPerCSSPixel(),
                                            &dummyBool);
   Matrix transform2D;
   if (!transform.Is2D(&transform2D)) {
     // We don't attempt to handle 3D transforms; just assume the scale changed.
     aActivity->mPreviousTransformScale = Nothing();
     IncrementMutationCount(&aActivity->mRestyleCounts[LayerActivity::ACTIVITY_SCALE]);
     return;
   }
--- a/layout/painting/FrameLayerBuilder.cpp
+++ b/layout/painting/FrameLayerBuilder.cpp
@@ -1790,17 +1790,17 @@ public:
     }
 
     mDrawTarget = mTextureClient->BorrowDrawTarget();
     return mDrawTarget;
   }
 
   already_AddRefed<ImageContainer> CreateImageAndImageContainer()
   {
-    RefPtr<ImageContainer> container = mLayerManager->CreateImageContainer();
+    RefPtr<ImageContainer> container = LayerManager::CreateImageContainer();
     RefPtr<Image> image = CreateImage();
 
     if (!image) {
       return nullptr;
     }
     container->SetCurrentImageInTransaction(image);
 
     return container.forget();
--- a/layout/painting/nsCSSRenderingGradients.cpp
+++ b/layout/painting/nsCSSRenderingGradients.cpp
@@ -868,18 +868,18 @@ nsCSSGradientRenderer::Paint(gfxContext&
       matrix.PreTranslate(mLineStart);
       matrix.PreScale(1.0, mRadiusX/mRadiusY);
       matrix.PreTranslate(-mLineStart);
     }
   }
   // Use a pattern transform to take account of source and dest rects
   matrix.PreTranslate(gfxPoint(mPresContext->CSSPixelsToDevPixels(aSrc.x),
                                mPresContext->CSSPixelsToDevPixels(aSrc.y)));
-  matrix.PreScale(gfxFloat(mPresContext->CSSPixelsToAppUnits(aSrc.width))/aDest.width,
-                  gfxFloat(mPresContext->CSSPixelsToAppUnits(aSrc.height))/aDest.height);
+  matrix.PreScale(gfxFloat(nsPresContext::CSSPixelsToAppUnits(aSrc.width))/aDest.width,
+                  gfxFloat(nsPresContext::CSSPixelsToAppUnits(aSrc.height))/aDest.height);
   gradientPattern->SetMatrix(matrix);
 
   if (stopDelta == 0.0) {
     // Non-repeating gradient with all stops in same place -> just add
     // first stop and last stop, both at position 0.
     // Repeating gradient with all stops in the same place, or radial
     // gradient with radius of 0 -> just paint the last stop color.
     // We use firstStop offset to keep |stops| with same units (will later normalize to 0).
@@ -1061,20 +1061,20 @@ nsCSSGradientRenderer::BuildWebRenderDis
   // Calculate the tile spacing, which is the repeat size minus the tile size
   LayoutDeviceSize tileSpacing = tileRepeat - firstTileBounds.Size();
 
   // Make the rects relative to the parent stacking context
   wr::LayoutRect wrClipBounds = aSc.ToRelativeLayoutRect(clipBounds);
   wr::LayoutRect wrGradientBounds = aSc.ToRelativeLayoutRect(gradientBounds);
 
   // srcTransform is used for scaling the gradient to match aSrc
-  LayoutDeviceRect srcTransform = LayoutDeviceRect(mPresContext->CSSPixelsToAppUnits(aSrc.x),
-                                                   mPresContext->CSSPixelsToAppUnits(aSrc.y),
-                                                   aDest.width / ((float)mPresContext->CSSPixelsToAppUnits(aSrc.width)),
-                                                   aDest.height / ((float)mPresContext->CSSPixelsToAppUnits(aSrc.height)));
+  LayoutDeviceRect srcTransform = LayoutDeviceRect(nsPresContext::CSSPixelsToAppUnits(aSrc.x),
+                                                   nsPresContext::CSSPixelsToAppUnits(aSrc.y),
+                                                   aDest.width / ((float)nsPresContext::CSSPixelsToAppUnits(aSrc.width)),
+                                                   aDest.height / ((float)nsPresContext::CSSPixelsToAppUnits(aSrc.height)));
 
   lineStart.x = (lineStart.x - srcTransform.x) * srcTransform.width;
   lineStart.y = (lineStart.y - srcTransform.y) * srcTransform.height;
 
   if (mGradient->mShape == NS_STYLE_GRADIENT_SHAPE_LINEAR) {
     lineEnd.x = (lineEnd.x - srcTransform.x) * srcTransform.width;
     lineEnd.y = (lineEnd.y - srcTransform.y) * srcTransform.height;
 
--- a/layout/style/RuleProcessorCache.h
+++ b/layout/style/RuleProcessorCache.h
@@ -74,17 +74,17 @@ private:
       : nsExpirationTracker<nsCSSRuleProcessor,3>(
           10000, "RuleProcessorCache::ExpirationTracker",
           SystemGroup::EventTargetFor(TaskCategory::Other))
       , mCache(aCache) {}
 
     void RemoveObjectIfTracked(nsCSSRuleProcessor* aRuleProcessor);
 
     virtual void NotifyExpired(nsCSSRuleProcessor* aRuleProcessor) override {
-      mCache->RemoveRuleProcessor(aRuleProcessor);
+      mozilla::RuleProcessorCache::RemoveRuleProcessor(aRuleProcessor);
     }
 
   private:
     RuleProcessorCache* mCache;
   };
 
   RuleProcessorCache() : mExpirationTracker(this) {}
   ~RuleProcessorCache();
--- a/layout/svg/SVGTextFrame.cpp
+++ b/layout/svg/SVGTextFrame.cpp
@@ -90,20 +90,20 @@ AppUnitsToGfxUnits(const nsPoint& aPoint
 
 /**
  * Converts a gfxRect that is in app units to CSS pixels using the specified
  * nsPresContext and returns it as a gfxRect.
  */
 static gfxRect
 AppUnitsToFloatCSSPixels(const gfxRect& aRect, const nsPresContext* aContext)
 {
-  return gfxRect(aContext->AppUnitsToFloatCSSPixels(aRect.x),
-                 aContext->AppUnitsToFloatCSSPixels(aRect.y),
-                 aContext->AppUnitsToFloatCSSPixels(aRect.width),
-                 aContext->AppUnitsToFloatCSSPixels(aRect.height));
+  return gfxRect(nsPresContext::AppUnitsToFloatCSSPixels(aRect.x),
+                 nsPresContext::AppUnitsToFloatCSSPixels(aRect.y),
+                 nsPresContext::AppUnitsToFloatCSSPixels(aRect.width),
+                 nsPresContext::AppUnitsToFloatCSSPixels(aRect.height));
 }
 
 /**
  * Scales a gfxRect around a given point.
  *
  * @param aRect The rectangle to scale.
  * @param aPoint The point around which to scale.
  * @param aScale The scale amount.
@@ -796,18 +796,17 @@ TextRenderedRun::GetTransformFromUserSpa
   // We transform to device pixels positioned such that painting the text frame
   // at (0,0) with aItem will result in the text being in the right place.
 
   gfxMatrix m;
   if (!mFrame) {
     return m;
   }
 
-  float cssPxPerDevPx = aContext->
-    AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
 
   // Glyph position in user space.
   m.PreTranslate(mPosition / cssPxPerDevPx);
 
   // Take into account any font size scaling and scaling due to textLength="".
   m.PreScale(1.0 / mFontSizeScaleFactor, 1.0 / mFontSizeScaleFactor);
 
   // Rotation due to rotate="" or a <textPath>.
@@ -837,18 +836,17 @@ gfxMatrix
 TextRenderedRun::GetTransformFromRunUserSpaceToUserSpace(
                                                   nsPresContext* aContext) const
 {
   gfxMatrix m;
   if (!mFrame) {
     return m;
   }
 
-  float cssPxPerDevPx = aContext->
-    AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
 
   nscoord start, end;
   GetClipEdges(start, end);
 
   // Glyph position in user space.
   m.PreTranslate(mPosition);
 
   // Rotation due to rotate="" or a <textPath>.
@@ -885,17 +883,17 @@ TextRenderedRun::GetTransformFromRunUser
     return m;
   }
 
   nscoord start, end;
   GetClipEdges(start, end);
 
   // Translate by the horizontal distance into the text frame this
   // rendered run is.
-  gfxFloat appPerCssPx = aContext->AppUnitsPerCSSPixel();
+  gfxFloat appPerCssPx = nsPresContext::AppUnitsPerCSSPixel();
   gfxPoint t = IsVertical() ? gfxPoint(0, start / appPerCssPx)
                             : gfxPoint(start / appPerCssPx, 0);
   return m.PreTranslate(t);
 }
 
 SVGBBox
 TextRenderedRun::GetRunUserSpaceRect(nsPresContext* aContext,
                                      uint32_t aFlags) const
@@ -968,18 +966,18 @@ TextRenderedRun::GetRunUserSpaceRect(nsP
                                                   fillInAppUnits.width,
                                                   fillInAppUnits.height),
                                           aContext);
 
   // Scale the rectangle up due to any mFontSizeScaleFactor.  We scale
   // it around the text's origin.
   ScaleAround(fill,
               textRun->IsVertical()
-                ? gfxPoint(aContext->AppUnitsToFloatCSSPixels(baseline), 0.0)
-                : gfxPoint(0.0, aContext->AppUnitsToFloatCSSPixels(baseline)),
+                ? gfxPoint(nsPresContext::AppUnitsToFloatCSSPixels(baseline), 0.0)
+                : gfxPoint(0.0, nsPresContext::AppUnitsToFloatCSSPixels(baseline)),
               1.0 / mFontSizeScaleFactor);
 
   // Include the fill if requested.
   if (aFlags & eIncludeFill) {
     r = fill;
   }
 
   // Include the stroke if requested.
@@ -1092,18 +1090,17 @@ TextRenderedRun::GetAdvanceWidth() const
 int32_t
 TextRenderedRun::GetCharNumAtPosition(nsPresContext* aContext,
                                       const gfxPoint& aPoint) const
 {
   if (mTextFrameContentLength == 0) {
     return -1;
   }
 
-  float cssPxPerDevPx = aContext->
-    AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
 
   // Convert the point from user space into run user space, and take
   // into account any mFontSizeScaleFactor.
   gfxMatrix m = GetTransformFromRunUserSpaceToUserSpace(aContext);
   if (!m.Invert()) {
     return -1;
   }
   gfxPoint p = m.TransformPoint(aPoint) / cssPxPerDevPx * mFontSizeScaleFactor;
@@ -2618,29 +2615,27 @@ gfxFloat
 CharIterator::GetGlyphAdvance(nsPresContext* aContext) const
 {
   uint32_t offset, length;
   GetOriginalGlyphOffsets(offset, length);
 
   gfxSkipCharsIterator it = TextFrame()->EnsureTextRun(nsTextFrame::eInflated);
   Range range = ConvertOriginalToSkipped(it, offset, length);
 
-  float cssPxPerDevPx = aContext->
-    AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
 
   gfxFloat advance = mTextRun->GetAdvanceWidth(range, nullptr);
   return aContext->AppUnitsToGfxUnits(advance) *
          mLengthAdjustScaleFactor * cssPxPerDevPx;
 }
 
 gfxFloat
 CharIterator::GetAdvance(nsPresContext* aContext) const
 {
-  float cssPxPerDevPx = aContext->
-    AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
 
   uint32_t offset = mSkipCharsIterator.GetSkippedOffset();
   gfxFloat advance = mTextRun->
     GetAdvanceWidth(Range(offset, offset + 1), nullptr);
   return aContext->AppUnitsToGfxUnits(advance) *
          mLengthAdjustScaleFactor * cssPxPerDevPx;
 }
 
@@ -2652,18 +2647,17 @@ CharIterator::GetGlyphPartialAdvance(uin
   GetOriginalGlyphOffsets(offset, length);
 
   NS_ASSERTION(aPartLength <= length, "invalid aPartLength value");
   length = aPartLength;
 
   gfxSkipCharsIterator it = TextFrame()->EnsureTextRun(nsTextFrame::eInflated);
   Range range = ConvertOriginalToSkipped(it, offset, length);
 
-  float cssPxPerDevPx = aContext->
-    AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(aContext->AppUnitsPerDevPixel());
 
   gfxFloat advance = mTextRun->GetAdvanceWidth(range, nullptr);
   return aContext->AppUnitsToGfxUnits(advance) *
          mLengthAdjustScaleFactor * cssPxPerDevPx;
 }
 
 bool
 CharIterator::NextCharacter()
@@ -3626,17 +3620,17 @@ SVGTextFrame::PaintSVG(gfxContext& aCont
       return;
     }
   }
 
   // SVG frames' PaintSVG methods paint in CSS px, but normally frames paint in
   // dev pixels. Here we multiply a CSS-px-to-dev-pixel factor onto aTransform
   // so our non-SVG nsTextFrame children paint correctly.
   auto auPerDevPx = presContext->AppUnitsPerDevPixel();
-  float cssPxPerDevPx = presContext->AppUnitsToFloatCSSPixels(auPerDevPx);
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(auPerDevPx);
   gfxMatrix canvasTMForChildren = aTransform;
   canvasTMForChildren.PreScale(cssPxPerDevPx, cssPxPerDevPx);
   initialMatrix.PreScale(1 / cssPxPerDevPx, 1 / cssPxPerDevPx);
 
   gfxContextMatrixAutoSaveRestore matSR(&aContext);
   aContext.NewPath();
   aContext.Multiply(canvasTMForChildren);
   gfxMatrix currentMatrix = aContext.CurrentMatrixDouble();
@@ -3812,17 +3806,17 @@ SVGTextFrame::ReflowSVG()
       r.UnionEdges(run.GetUserSpaceRect(presContext, runFlags));
     }
   }
 
   if (r.IsEmpty()) {
     mRect.SetEmpty();
   } else {
     mRect =
-      nsLayoutUtils::RoundGfxRectToAppRect(r.ToThebesRect(), presContext->AppUnitsPerCSSPixel());
+      nsLayoutUtils::RoundGfxRectToAppRect(r.ToThebesRect(), nsPresContext::AppUnitsPerCSSPixel());
 
     // Due to rounding issues when we have a transform applied, we sometimes
     // don't include an additional row of pixels.  For now, just inflate our
     // covered region.
     mRect.Inflate(presContext->AppUnitsPerDevPixel());
   }
 
   if (mState & NS_FRAME_FIRST_REFLOW) {
@@ -4178,18 +4172,17 @@ SVGTextFrame::GetSubStringLength(nsICont
       textLength += textRun->GetAdvanceWidth(range, nullptr);
     }
 
     // Advance, ready for next call:
     frameStartTextElementCharIndex += untrimmedLength;
   }
 
   nsPresContext* presContext = PresContext();
-  float cssPxPerDevPx = presContext->
-    AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
 
   *aResult = presContext->AppUnitsToGfxUnits(textLength) *
                cssPxPerDevPx / mFontSizeScaleFactor;
   return NS_OK;
 }
 
 nsresult
 SVGTextFrame::GetSubStringLengthSlowFallback(nsIContent* aContent,
@@ -4254,18 +4247,17 @@ SVGTextFrame::GetSubStringLengthSlowFall
       // Accumulate the advance.
       textLength += textRun->GetAdvanceWidth(range, nullptr);
     }
 
     run = runIter.Next();
   }
 
   nsPresContext* presContext = PresContext();
-  float cssPxPerDevPx = presContext->
-    AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
 
   *aResult = presContext->AppUnitsToGfxUnits(textLength) *
                cssPxPerDevPx / mFontSizeScaleFactor;
   return NS_OK;
 }
 
 /**
  * Implements the SVG DOM GetCharNumAtPosition method for the specified
@@ -4405,18 +4397,17 @@ SVGTextFrame::GetExtentOfChar(nsIContent
   CharIterator it(this, CharIterator::eAddressable, aContent);
   if (!it.AdvanceToSubtree() ||
       !it.Next(aCharNum)) {
     return NS_ERROR_DOM_INDEX_SIZE_ERR;
   }
 
   nsPresContext* presContext = PresContext();
 
-  float cssPxPerDevPx = presContext->
-    AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
 
   // We need to return the extent of the whole glyph.
   uint32_t startIndex = it.GlyphStartTextElementCharIndex();
 
   // The ascent and descent gives the height of the glyph.
   gfxFloat ascent, descent;
   GetAscentAndDescentInAppUnits(it.TextFrame(), ascent, descent);
 
@@ -5271,18 +5262,17 @@ SVGTextFrame::DoGlyphPositioning()
   }
   if (!mPositions[0].IsAngleSpecified()) {
     mPositions[0].mAngle = 0.0;
   }
 
   nsPresContext* presContext = PresContext();
   bool vertical = GetWritingMode().IsVertical();
 
-  float cssPxPerDevPx = presContext->
-    AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
   double factor = cssPxPerDevPx / mFontSizeScaleFactor;
 
   // Determine how much to compress or expand glyph positions due to
   // textLength="" and lengthAdjust="".
   double adjustment = 0.0;
   mLengthAdjustScaleFactor = 1.0f;
   if (adjustingTextLength) {
     nscoord frameLength = vertical ? PrincipalChildList().FirstChild()->GetRect().height
@@ -5572,17 +5562,17 @@ SVGTextFrame::UpdateFontSizeScaleFactor(
   }
 
   if (min == nscoord_MAX) {
     // No text, so no need for scaling.
     mFontSizeScaleFactor = 1.0;
     return mFontSizeScaleFactor != oldFontSizeScaleFactor;
   }
 
-  double minSize = presContext->AppUnitsToFloatCSSPixels(min);
+  double minSize = nsPresContext::AppUnitsToFloatCSSPixels(min);
 
   if (geometricPrecision) {
     // We want to ensure minSize is scaled to PRECISE_SIZE.
     mFontSizeScaleFactor = PRECISE_SIZE / minSize;
     return mFontSizeScaleFactor != oldFontSizeScaleFactor;
   }
 
   // When we are non-display, we could be painted in different coordinate
@@ -5594,24 +5584,24 @@ SVGTextFrame::UpdateFontSizeScaleFactor(
   if (!(mState & NS_FRAME_IS_NONDISPLAY)) {
     gfxMatrix m(GetCanvasTM());
     if (!m.IsSingular()) {
       contextScale = GetContextScale(m);
     }
   }
   mLastContextScale = contextScale;
 
-  double maxSize = presContext->AppUnitsToFloatCSSPixels(max);
+  double maxSize = nsPresContext::AppUnitsToFloatCSSPixels(max);
 
   // But we want to ignore any scaling required due to HiDPI displays, since
   // regular CSS text frames will still create text runs using the font size
   // in CSS pixels, and we want SVG text to have the same rendering as HTML
   // text for regular font sizes.
   float cssPxPerDevPx =
-    presContext->AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
+    nsPresContext::AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
   contextScale *= cssPxPerDevPx;
 
   double minTextRunSize = minSize * contextScale;
   double maxTextRunSize = maxSize * contextScale;
 
   if (minTextRunSize >= CLAMP_MIN_SIZE &&
       maxTextRunSize <= CLAMP_MAX_SIZE) {
     // We are already in the ideal font size range for all text frames,
@@ -5653,19 +5643,18 @@ SVGTextFrame::TransformFramePointToTextC
 
   UpdateGlyphPositioning();
 
   nsPresContext* presContext = PresContext();
 
   // Add in the mRect offset to aPoint, as that will have been taken into
   // account when transforming the point from the ancestor frame down
   // to this one.
-  float cssPxPerDevPx = presContext->
-    AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
-  float factor = presContext->AppUnitsPerCSSPixel();
+  float cssPxPerDevPx = nsPresContext::AppUnitsToFloatCSSPixels(presContext->AppUnitsPerDevPixel());
+  float factor = nsPresContext::AppUnitsPerCSSPixel();
   Point framePosition(NSAppUnitsToFloatPixels(mRect.x, factor),
                       NSAppUnitsToFloatPixels(mRect.y, factor));
   Point pointInUserSpace = aPoint * cssPxPerDevPx + framePosition;
 
   // Find the closest rendered run for the text frames beneath aChildFrame.
   TextRenderedRunIterator it(this, TextRenderedRunIterator::eAllFrames,
                              aChildFrame);
   TextRenderedRun hit;
@@ -5762,17 +5751,17 @@ SVGTextFrame::TransformFrameRectFromText
 
       // Union it into the result.
       result.UnionRect(result, rectInUserSpace);
     }
   }
 
   // Subtract the mRect offset from the result, as our user space for
   // this frame is relative to the top-left of mRect.
-  float factor = presContext->AppUnitsPerCSSPixel();
+  float factor = nsPresContext::AppUnitsPerCSSPixel();
   gfxPoint framePosition(NSAppUnitsToFloatPixels(mRect.x, factor),
                          NSAppUnitsToFloatPixels(mRect.y, factor));
 
   return result - framePosition;
 }
 
 void
 SVGTextFrame::AppendDirectlyOwnedAnonBoxes(nsTArray<OwnedAnonBox>& aResult)
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -210,18 +210,18 @@ nsSVGIntegrationUtils::GetContinuationUn
 nsSVGIntegrationUtils::GetSVGCoordContextForNonSVGFrame(nsIFrame* aNonSVGFrame)
 {
   NS_ASSERTION(!aNonSVGFrame->IsFrameOfType(nsIFrame::eSVG),
                "SVG frames should not get here");
   nsIFrame* firstFrame =
     nsLayoutUtils::FirstContinuationOrIBSplitSibling(aNonSVGFrame);
   nsRect r = nsLayoutUtils::GetAllInFlowRectsUnion(firstFrame, firstFrame);
   nsPresContext* presContext = firstFrame->PresContext();
-  return gfx::Size(presContext->AppUnitsToFloatCSSPixels(r.width),
-                   presContext->AppUnitsToFloatCSSPixels(r.height));
+  return gfx::Size(nsPresContext::AppUnitsToFloatCSSPixels(r.width),
+                   nsPresContext::AppUnitsToFloatCSSPixels(r.height));
 }
 
 gfxRect
 nsSVGIntegrationUtils::GetSVGBBoxForNonSVGFrame(nsIFrame* aNonSVGFrame,
                                                 bool aUnionContinuations)
 {
   // Except for nsSVGOuterSVGFrame, we shouldn't be getting here with SVG
   // frames at all. This function is for elements that are laid out using the
--- a/layout/xul/nsMenuPopupFrame.cpp
+++ b/layout/xul/nsMenuPopupFrame.cpp
@@ -1433,17 +1433,17 @@ nsMenuPopupFrame::SetPopupPosition(nsIFr
     // If we can't reach a root pres context, don't bother continuing:
     if (!rootPresContext) {
       return NS_OK;
     }
 
     // If anchored to a rectangle, use that rectangle. Otherwise, determine the
     // rectangle from the anchor.
     if (mAnchorType == MenuPopupAnchorType_Rect) {
-      anchorRect = ToAppUnits(mScreenRect, presContext->AppUnitsPerCSSPixel());
+      anchorRect = ToAppUnits(mScreenRect, nsPresContext::AppUnitsPerCSSPixel());
     }
     else {
       // if the frame is not specified, use the anchor node passed to OpenPopup. If
       // that wasn't specified either, use the root frame. Note that mAnchorContent
       // might be a different document so its presshell must be used.
       if (!aAnchorFrame) {
         if (mAnchorContent) {
           aAnchorFrame = mAnchorContent->GetPrimaryFrame();
@@ -1515,40 +1515,40 @@ nsMenuPopupFrame::SetPopupPosition(nsIFr
       // with no anchor, the popup is positioned relative to the root frame
       anchorRect = rootScreenRect;
       screenPoint = anchorRect.TopLeft() + nsPoint(margin.left, margin.top);
     }
 
     // mXPos and mYPos specify an additonal offset passed to OpenPopup that
     // should be added to the position.  We also add the offset to the anchor
     // pos so a later flip/resize takes the offset into account.
-    nscoord anchorXOffset = presContext->CSSPixelsToAppUnits(mXPos);
+    nscoord anchorXOffset = nsPresContext::CSSPixelsToAppUnits(mXPos);
     if (IsDirectionRTL()) {
       screenPoint.x -= anchorXOffset;
       anchorRect.x -= anchorXOffset;
     } else {
       screenPoint.x += anchorXOffset;
       anchorRect.x += anchorXOffset;
     }
-    nscoord anchorYOffset = presContext->CSSPixelsToAppUnits(mYPos);
+    nscoord anchorYOffset = nsPresContext::CSSPixelsToAppUnits(mYPos);
     screenPoint.y += anchorYOffset;
     anchorRect.y += anchorYOffset;
 
     // If this is a noautohide popup, set the screen coordinates of the popup.
     // This way, the popup stays at the location where it was opened even when
     // the window is moved. Popups at the parent level follow the parent
     // window as it is moved and remained anchored, so we want to maintain the
     // anchoring instead.
     if (isNoAutoHide &&
         (popupLevel != ePopupLevelParent || mAnchorType == MenuPopupAnchorType_Rect)) {
       // Account for the margin that will end up being added to the screen coordinate
       // the next time SetPopupPosition is called.
       mAnchorType = MenuPopupAnchorType_Point;
-      mScreenRect.x = presContext->AppUnitsToIntCSSPixels(screenPoint.x - margin.left);
-      mScreenRect.y = presContext->AppUnitsToIntCSSPixels(screenPoint.y - margin.top);
+      mScreenRect.x = nsPresContext::AppUnitsToIntCSSPixels(screenPoint.x - margin.left);
+      mScreenRect.y = nsPresContext::AppUnitsToIntCSSPixels(screenPoint.y - margin.top);
     }
   }
   else {
     // The popup is positioned at a screen coordinate.
     // First convert the screen position in mScreenRect from CSS pixels into
     // device pixels, ignoring any zoom as mScreenRect holds unzoomed screen
     // coordinates.
     int32_t factor = devContext->AppUnitsPerDevPixelAtUnitFullZoom();
@@ -2408,18 +2408,18 @@ nsMenuPopupFrame::MoveTo(const CSSIntPoi
     margin.left += nsPresContext::CSSPixelsToAppUnits(LookAndFeel::GetInt(
                      LookAndFeel::eIntID_ContextMenuOffsetHorizontal));
     margin.top += nsPresContext::CSSPixelsToAppUnits(LookAndFeel::GetInt(
                      LookAndFeel::eIntID_ContextMenuOffsetVertical));
   }
 
   nsPresContext* presContext = PresContext();
   mAnchorType = MenuPopupAnchorType_Point;
-  mScreenRect.x = aPos.x - presContext->AppUnitsToIntCSSPixels(margin.left);
-  mScreenRect.y = aPos.y - presContext->AppUnitsToIntCSSPixels(margin.top);
+  mScreenRect.x = aPos.x - nsPresContext::AppUnitsToIntCSSPixels(margin.left);
+  mScreenRect.y = aPos.y - nsPresContext::AppUnitsToIntCSSPixels(margin.top);
 
   SetPopupPosition(nullptr, true, false, true);
 
   RefPtr<Element> popup = mContent->AsElement();
   if (aUpdateAttrs && (popup->HasAttr(kNameSpaceID_None, nsGkAtoms::left) ||
                        popup->HasAttr(kNameSpaceID_None, nsGkAtoms::top)))
   {
     nsAutoString left, top;
--- a/layout/xul/nsSplitterFrame.cpp
+++ b/layout/xul/nsSplitterFrame.cpp
@@ -691,19 +691,19 @@ nsSplitterFrameInner::MouseDown(nsIDOMEv
 
     // skip over any splitters
     if (atom != nsGkAtoms::splitter) {
         nsSize prefSize = childBox->GetXULPrefSize(state);
         nsSize minSize = childBox->GetXULMinSize(state);
         nsSize maxSize = nsBox::BoundsCheckMinMax(minSize, childBox->GetXULMaxSize(state));
         prefSize = nsBox::BoundsCheck(minSize, prefSize, maxSize);
 
-        mOuter->AddMargin(childBox, minSize);
-        mOuter->AddMargin(childBox, prefSize);
-        mOuter->AddMargin(childBox, maxSize);
+        nsSplitterFrame::AddMargin(childBox, minSize);
+        nsSplitterFrame::AddMargin(childBox, prefSize);
+        nsSplitterFrame::AddMargin(childBox, maxSize);
 
         nscoord flex = childBox->GetXULFlex();
 
         nsMargin margin(0,0,0,0);
         childBox->GetXULMargin(margin);
         nsRect r(childBox->GetRect());
         r.Inflate(margin);
 
--- a/media/webrtc/signaling/gtest/rtpsources_unittests.cpp
+++ b/media/webrtc/signaling/gtest/rtpsources_unittests.cpp
@@ -107,17 +107,17 @@ public:
     EXPECT_TRUE(history.Empty());
     EXPECT_FALSE(history.mHasEvictedEntry);
   }
 
   // Tests that a value inserted into the jitter window will age into long term
   // storage
   void TestAgeIntoLongTerm() {
     RtpSourceHistory history;
-    constexpr int64_t jitterWindow = history.kMinJitterWindow;
+    constexpr int64_t jitterWindow = RtpSourceHistory::kMinJitterWindow;
     constexpr int64_t jitter = jitterWindow / 2;
     constexpr int64_t timeNow0 = 100000;
     constexpr int64_t time0 = timeNow0;
     constexpr int64_t time1 = timeNow0 + jitter;
     // Prune at timeNow1 should evict time0
     constexpr int64_t timeNow1 = time0 + jitterWindow + 1;
     // Prune at timeNow2 should evict time1
     constexpr int64_t timeNow2 = time1 + jitterWindow + 1;
@@ -208,17 +208,17 @@ public:
     EXPECT_TRUE(history.Empty());
     EXPECT_EQ(history.mDetailedHistory.size(), static_cast<size_t>(0));
     EXPECT_FALSE(history.mHasEvictedEntry);
   }
 
   void TestSinglePrune() {
     RtpSourceHistory history;
     constexpr int64_t timeNow = 10000;
-    constexpr int64_t jitter = history.kMinJitterWindow / 2;
+    constexpr int64_t jitter = RtpSourceHistory::kMinJitterWindow / 2;
     const int64_t jitterAdjusted = timeNow + jitter;
 
     history.Insert(timeNow, jitterAdjusted, 0, false);
     history.Prune(timeNow + (jitter * 3) + 1);
     EXPECT_EQ(history.mDetailedHistory.size(), static_cast<size_t>(0));
     EXPECT_TRUE(history.mHasEvictedEntry);
     EXPECT_EQ(jitterAdjusted, history.mLatestEviction.jitterAdjustedTimestamp);
   }
@@ -344,9 +344,9 @@ TEST_F(RtpSourcesTest, TestMaximumAudioL
 TEST_F(RtpSourcesTest, TestEmptyPrune) { TestEmptyPrune(); }
 TEST_F(RtpSourcesTest, TestSinglePrune) { TestSinglePrune(); }
 TEST_F(RtpSourcesTest, TestKeyManipulation) { TestKeyManipulation(); }
 TEST_F(RtpSourcesTest, TestObserveOneCsrc) { TestObserveOneCsrc(); }
 TEST_F(RtpSourcesTest, TestObserveTwoCsrcs) { TestObserveTwoCsrcs(); }
 TEST_F(RtpSourcesTest, TestObserveCsrcWithAudioLevel) {
   TestObserveCsrcWithAudioLevel();
 }
-}
\ No newline at end of file
+}
--- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
+++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
@@ -192,17 +192,17 @@ nsresult
 JsepSessionImpl::CreateOfferMsection(const JsepOfferOptions& options,
                                      JsepTransceiver& transceiver,
                                      Sdp* local)
 {
   JsepTrack& sendTrack(transceiver.mSendTrack);
   JsepTrack& recvTrack(transceiver.mRecvTrack);
 
   SdpMediaSection::Protocol protocol(
-      mSdpHelper.GetProtocolForMediaType(sendTrack.GetMediaType()));
+      SdpHelper::GetProtocolForMediaType(sendTrack.GetMediaType()));
 
   const Sdp* answer(GetAnswer());
   const SdpMediaSection* lastAnswerMsection = nullptr;
 
   if (answer &&
       (local->GetMediaSectionCount() < answer->GetMediaSectionCount())) {
     lastAnswerMsection =
       &answer->GetMediaSection(local->GetMediaSectionCount());
@@ -221,17 +221,17 @@ JsepSessionImpl::CreateOfferMsection(con
 
   // Some of this stuff (eg; mid) sticks around even if disabled
   if (lastAnswerMsection) {
     nsresult rv = mSdpHelper.CopyStickyParams(*lastAnswerMsection, msection);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   if (transceiver.IsStopped()) {
-    mSdpHelper.DisableMsection(local, msection);
+    SdpHelper::DisableMsection(local, msection);
     return NS_OK;
   }
 
   msection->SetPort(9);
 
   // We don't do this in AddTransportAttributes because that is also used for
   // making answers, and we don't want to unconditionally set rtcp-mux there.
   if (mSdpHelper.HasRtcp(msection->GetProtocol())) {
@@ -593,17 +593,17 @@ JsepSessionImpl::CreateAnswerMsection(co
                            "0.0.0.0");
 
   nsresult rv = mSdpHelper.CopyStickyParams(remoteMsection, &msection);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (mSdpHelper.MsectionIsDisabled(remoteMsection) ||
       // JS might have stopped this
       transceiver.IsStopped()) {
-    mSdpHelper.DisableMsection(sdp, &msection);
+    SdpHelper::DisableMsection(sdp, &msection);
     return NS_OK;
   }
 
   SdpSetupAttribute::Role role;
   rv = DetermineAnswererSetupRole(remoteMsection, &role);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = AddTransportAttributes(&msection, role);
@@ -615,17 +615,17 @@ JsepSessionImpl::CreateAnswerMsection(co
   // Add extmap attributes. This logic will probably be moved to the track,
   // since it can be specified on a per-sender basis in JS.
   // We will need some validation to ensure that the ids are identical for
   // RTP streams that are bundled together, though (bug 1406529).
   AddCommonExtmaps(remoteMsection, &msection);
 
   if (msection.GetFormats().empty()) {
     // Could not negotiate anything. Disable m-section.
-    mSdpHelper.DisableMsection(sdp, &msection);
+    SdpHelper::DisableMsection(sdp, &msection);
   }
 
   return NS_OK;
 }
 
 nsresult
 JsepSessionImpl::DetermineAnswererSetupRole(
     const SdpMediaSection& remoteMsection,
--- a/netwerk/cache/nsCacheService.cpp
+++ b/netwerk/cache/nsCacheService.cpp
@@ -1427,17 +1427,17 @@ nsCacheService::EvictEntriesForClient(co
 
 nsresult
 nsCacheService::IsStorageEnabledForPolicy(nsCacheStoragePolicy  storagePolicy,
                                           bool *              result)
 {
     if (gService == nullptr) return NS_ERROR_NOT_AVAILABLE;
     nsCacheServiceAutoLock lock(LOCK_TELEM(NSCACHESERVICE_ISSTORAGEENABLEDFORPOLICY));
 
-    *result = gService->IsStorageEnabledForPolicy_Locked(storagePolicy);
+    *result = nsCacheService::IsStorageEnabledForPolicy_Locked(storagePolicy);
     return NS_OK;
 }
 
 
 nsresult
 nsCacheService::DoomEntry(nsCacheSession   *session,
                           const nsACString &key,
                           nsICacheListener *listener)
--- a/rdf/base/nsRDFXMLSerializer.cpp
+++ b/rdf/base/nsRDFXMLSerializer.cpp
@@ -1013,38 +1013,38 @@ private:
     nsRDFXMLSerializer* mParent;
 };
 
 NS_IMPL_ISUPPORTS(QNameCollector, rdfITripleVisitor)
 nsresult
 QNameCollector::Visit(nsIRDFNode* aSubject, nsIRDFResource* aPredicate,
                       nsIRDFNode* aObject, bool aTruthValue)
 {
-    if (aPredicate == mParent->kRDF_type) {
+    if (aPredicate == nsRDFXMLSerializer::kRDF_type) {
         // try to get a type QName for aObject, should be a resource
         nsCOMPtr<nsIRDFResource> resType = do_QueryInterface(aObject);
         if (!resType) {
             // ignore error
             return NS_OK;
         }
         if (mParent->mQNames.Get(resType, nullptr)) {
             return NS_OK;
         }
         mParent->RegisterQName(resType);
         return NS_OK;
     }
 
     if (mParent->mQNames.Get(aPredicate, nullptr)) {
         return NS_OK;
     }
-    if (aPredicate == mParent->kRDF_instanceOf ||
-        aPredicate == mParent->kRDF_nextVal)
+    if (aPredicate == nsRDFXMLSerializer::kRDF_instanceOf ||
+        aPredicate == nsRDFXMLSerializer::kRDF_nextVal)
         return NS_OK;
     bool isOrdinal = false;
-    mParent->gRDFC->IsOrdinalProperty(aPredicate, &isOrdinal);
+    nsRDFXMLSerializer::gRDFC->IsOrdinalProperty(aPredicate, &isOrdinal);
     if (isOrdinal)
         return NS_OK;
 
     mParent->RegisterQName(aPredicate);
 
     return NS_OK;
 }
 
--- a/security/manager/ssl/PSMContentListener.cpp
+++ b/security/manager/ssl/PSMContentListener.cpp
@@ -266,17 +266,17 @@ PSMContentDownloaderParent::OnStopReques
 }
 
 mozilla::ipc::IPCResult
 PSMContentDownloaderParent::RecvDivertToParentUsing(mozilla::net::PChannelDiverterParent* diverter)
 {
   MOZ_ASSERT(diverter);
   auto p = static_cast<mozilla::net::ChannelDiverterParent*>(diverter);
   p->DivertTo(this);
-  mozilla::Unused << p->Send__delete__(p);
+  mozilla::Unused << ChannelDiverterParent::Send__delete__(p);
   return IPC_OK();
 }
 
 void
 PSMContentDownloaderParent::ActorDestroy(ActorDestroyReason why)
 {
   mIPCOpen = false;
 }
--- a/toolkit/components/extensions/MatchPattern.cpp
+++ b/toolkit/components/extensions/MatchPattern.cpp
@@ -95,17 +95,17 @@ AtomSet::Add(nsAtom* aAtom)
     mElems.InsertElementAt(index, aAtom);
   }
 }
 
 void
 AtomSet::Remove(nsAtom* aAtom)
 {
   auto index = mElems.BinaryIndexOf(aAtom);
-  if (index != mElems.NoIndex) {
+  if (index != ArrayType::NoIndex) {
     mElems.RemoveElementAt(index);
   }
 }
 
 
 /*****************************************************************************
  * URLInfo
  *****************************************************************************/
--- a/toolkit/components/places/nsNavHistoryResult.cpp
+++ b/toolkit/components/places/nsNavHistoryResult.cpp
@@ -4132,17 +4132,17 @@ nsNavHistoryResult::AddHistoryObserver(n
       nsNavHistory* history = nsNavHistory::GetHistoryService();
       NS_ASSERTION(history, "Can't create history service");
       history->AddObserver(this, true);
       mIsHistoryObserver = true;
   }
   // Don't add duplicate observers.  In some case we don't unregister when
   // children are cleared (see ClearChildren) and the next FillChildren call
   // will try to add the observer again.
-  if (mHistoryObservers.IndexOf(aNode) == mHistoryObservers.NoIndex) {
+  if (mHistoryObservers.IndexOf(aNode) == QueryObserverList::NoIndex) {
     mHistoryObservers.AppendElement(aNode);
   }
 }
 
 
 void
 nsNavHistoryResult::AddAllBookmarksObserver(nsNavHistoryQueryResultNode* aNode)
 {
@@ -4153,17 +4153,17 @@ nsNavHistoryResult::AddAllBookmarksObser
       return;
     }
     bookmarks->AddObserver(this, true);
     mIsAllBookmarksObserver = true;
   }
   // Don't add duplicate observers.  In some case we don't unregister when
   // children are cleared (see ClearChildren) and the next FillChildren call
   // will try to add the observer again.
-  if (mAllBookmarksObservers.IndexOf(aNode) == mAllBookmarksObservers.NoIndex) {
+  if (mAllBookmarksObservers.IndexOf(aNode) == QueryObserverList::NoIndex) {
     mAllBookmarksObservers.AppendElement(aNode);
   }
 }
 
 
 void
 nsNavHistoryResult::AddMobilePrefsObserver(nsNavHistoryQueryResultNode* aNode)
 {
@@ -4194,17 +4194,17 @@ nsNavHistoryResult::AddBookmarkFolderObs
     }
     bookmarks->AddObserver(this, true);
     mIsBookmarkFolderObserver = true;
   }
   // Don't add duplicate observers.  In some case we don't unregister when
   // children are cleared (see ClearChildren) and the next FillChildren call
   // will try to add the observer again.
   FolderObserverList* list = BookmarkFolderObserversForId(aFolder, true);
-  if (list->IndexOf(aNode) == list->NoIndex) {
+  if (list->IndexOf(aNode) == FolderObserverList::NoIndex) {
     list->AppendElement(aNode);
   }
 }
 
 
 void
 nsNavHistoryResult::RemoveHistoryObserver(nsNavHistoryQueryResultNode* aNode)
 {
@@ -4367,17 +4367,17 @@ nsNavHistoryResult::GetRoot(nsINavHistor
   return NS_OK;
 }
 
 
 void
 nsNavHistoryResult::requestRefresh(nsNavHistoryContainerResultNode* aContainer)
 {
   // Don't add twice the same container.
-  if (mRefreshParticipants.IndexOf(aContainer) == mRefreshParticipants.NoIndex)
+  if (mRefreshParticipants.IndexOf(aContainer) == ContainerObserverList::NoIndex)
     mRefreshParticipants.AppendElement(aContainer);
 }
 
 // nsINavBookmarkObserver implementation
 
 // Here, it is important that we create a COPY of the observer array. Some
 // observers will requery themselves, which may cause the observer array to
 // be modified or added to.
--- a/toolkit/components/printingui/ipc/PrintingParent.cpp
+++ b/toolkit/components/printingui/ipc/PrintingParent.cpp
@@ -182,19 +182,19 @@ PrintingParent::RecvShowPrintDialog(PPri
   PrintData resultData;
   nsresult rv = ShowPrintDialog(aParent, aData, &resultData);
 
   // The child has been spinning an event loop while waiting
   // to hear about the print settings. We return the results
   // with an async message which frees the child process from
   // its nested event loop.
   if (NS_FAILED(rv)) {
-    mozilla::Unused << aDialog->Send__delete__(aDialog, rv);
+    mozilla::Unused << PPrintingParent::PPrintSettingsDialogParent::Send__delete__(aDialog, rv);
   } else {
-    mozilla::Unused << aDialog->Send__delete__(aDialog, resultData);
+    mozilla::Unused << PPrintingParent::PPrintSettingsDialogParent::Send__delete__(aDialog, resultData);
   }
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 PrintingParent::RecvSavePrintSettings(const PrintData& aData,
                                       const bool& aUsePrinterNamePrefix,
                                       const uint32_t& aFlags,
--- a/toolkit/crashreporter/breakpad-client/linux/minidump_writer/minidump_writer.cc
+++ b/toolkit/crashreporter/breakpad-client/linux/minidump_writer/minidump_writer.cc
@@ -731,17 +731,17 @@ class MinidumpWriter {
       struct link_map map;
       if (!dumper_->CopyFromProcess(&map, GetCrashThread(), ptr, sizeof(map)))
         return false;
 
       ptr = map.l_next;
       dso_count++;
     }
 
-    MDRVA linkmap_rva = minidump_writer_.kInvalidMDRVA;
+    MDRVA linkmap_rva = MinidumpFileWriter::kInvalidMDRVA;
     if (dso_count > 0) {
       // If we have at least one DSO, create an array of MDRawLinkMap
       // entries in the minidump file.
       TypedMDRVA<MDRawLinkMap> linkmap(&minidump_writer_);
       if (!linkmap.AllocateArray(dso_count))
         return false;
       linkmap_rva = linkmap.location().rva;
       int idx = 0;
--- a/toolkit/profile/nsToolkitProfileService.cpp
+++ b/toolkit/profile/nsToolkitProfileService.cpp
@@ -401,20 +401,20 @@ NS_IMPL_ISUPPORTS(nsToolkitProfileServic
                   nsIToolkitProfileService)
 
 nsresult
 nsToolkitProfileService::Init()
 {
     NS_ASSERTION(gDirServiceProvider, "No dirserviceprovider!");
     nsresult rv;
 
-    rv = gDirServiceProvider->GetUserAppDataDirectory(getter_AddRefs(mAppData));
+    rv = nsXREDirProvider::GetUserAppDataDirectory(getter_AddRefs(mAppData));
     NS_ENSURE_SUCCESS(rv, rv);
 
-    rv = gDirServiceProvider->GetUserLocalDataDirectory(getter_AddRefs(mTempData));
+    rv = nsXREDirProvider::GetUserLocalDataDirectory(getter_AddRefs(mTempData));
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = mAppData->Clone(getter_AddRefs(mListFile));
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = mListFile->AppendNative(NS_LITERAL_CSTRING("profiles.ini"));
     NS_ENSURE_SUCCESS(rv, rv);
 
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -3333,17 +3333,17 @@ XREMain::XRE_mainInit(bool* aExitFlag)
 
   nsCOMPtr<nsIFile> xreBinDirectory;
   xreBinDirectory = mDirProvider.GetGREBinDir();
 
   if ((mAppData->flags & NS_XRE_ENABLE_CRASH_REPORTER) &&
       NS_SUCCEEDED(
         CrashReporter::SetExceptionHandler(xreBinDirectory))) {
     nsCOMPtr<nsIFile> file;
-    rv = mDirProvider.GetUserAppDataDirectory(getter_AddRefs(file));
+    rv = nsXREDirProvider::GetUserAppDataDirectory(getter_AddRefs(file));
     if (NS_SUCCEEDED(rv)) {
       CrashReporter::SetUserAppDataDirectory(file);
     }
     if (mAppData->crashReporterURL)
       CrashReporter::SetServerURL(nsDependentCString(mAppData->crashReporterURL));
 
     // We overwrite this once we finish starting up.
     CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("StartupCrash"),
--- a/toolkit/xre/nsConsoleWriter.cpp
+++ b/toolkit/xre/nsConsoleWriter.cpp
@@ -29,17 +29,17 @@ WriteConsoleLog()
     rv = XRE_GetFileFromPath(logFileEnv, getter_AddRefs(lfile));
     if (NS_FAILED(rv))
       return;
   }
   else {
     if (!gLogConsoleErrors)
       return;
 
-    rv = gDirServiceProvider->GetUserAppDataDirectory(getter_AddRefs(lfile));
+    rv = nsXREDirProvider::GetUserAppDataDirectory(getter_AddRefs(lfile));
     if (NS_FAILED(rv))
       return;
 
     lfile->AppendNative(NS_LITERAL_CSTRING("console.log"));
   }
 
   PRFileDesc *file;
   rv = lfile->OpenNSPRFileDesc(PR_WRONLY | PR_APPEND | PR_CREATE_FILE,
--- a/uriloader/exthandler/ExternalHelperAppParent.cpp
+++ b/uriloader/exthandler/ExternalHelperAppParent.cpp
@@ -191,17 +191,17 @@ ExternalHelperAppParent::RecvDivertToPar
 {
   MOZ_ASSERT(diverter);
   UpdateContentContext(mListener, contentContext);
   auto p = static_cast<mozilla::net::ChannelDiverterParent*>(diverter);
   p->DivertTo(this);
 #ifdef DEBUG
   mDiverted = true;
 #endif
-  Unused << p->Send__delete__(p);
+  Unused << ChannelDiverterParent::Send__delete__(p);
   return IPC_OK();
 }
 
 //
 // nsIStreamListener
 //
 
 NS_IMETHODIMP
--- a/widget/nsBaseWidget.cpp
+++ b/widget/nsBaseWidget.cpp
@@ -1061,17 +1061,17 @@ nsBaseWidget::ProcessUntransformedAPZEve
 
   // Make a copy of the original event for the APZCCallbackHelper helpers that
   // we call later, because the event passed to DispatchEvent can get mutated in
   // ways that we don't want (i.e. touch points can get stripped out).
   nsEventStatus status;
   UniquePtr<WidgetEvent> original(aEvent->Duplicate());
   DispatchEvent(aEvent, status);
 
-  if (mAPZC && !context.WasRoutedToChildProcess() && aInputBlockId) {
+  if (mAPZC && !InputAPZContext::WasRoutedToChildProcess() && aInputBlockId) {
     // EventStateManager did not route the event into the child process.
     // It's safe to communicate to APZ that the event has been processed.
     // TODO: Eventually we'll be able to move the SendSetTargetAPZCNotification
     // call into APZEventState::Process*Event() as well.
     if (WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent()) {
       if (touchEvent->mMessage == eTouchStart) {
         if (gfxPrefs::TouchActionEnabled()) {
           APZCCallbackHelper::SendSetAllowedTouchBehaviorNotification(this,