Bug 973950 - Remove sContextList from nsJSEnvironment; r=bholley
authorMs2ger <ms2ger@gmail.com>
Thu, 27 Mar 2014 21:05:15 +0100
changeset 175808 2124bd62783f4da2ad46edae0c5b3c3ba2816269
parent 175807 a54f5ae6956d9b7f0dec965fd558f92b3ce05bae
child 175809 d6f9707cbf5321a9a22e2a279a4c729656edd0c5
push id26500
push userkwierso@gmail.com
push dateFri, 28 Mar 2014 23:16:18 +0000
treeherdermozilla-central@88ae1bfaaf3d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs973950
milestone31.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 973950 - Remove sContextList from nsJSEnvironment; r=bholley
dom/base/nsJSEnvironment.cpp
dom/base/nsJSEnvironment.h
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -186,17 +186,16 @@ static uint32_t sMinForgetSkippableTime 
 static uint32_t sMaxForgetSkippableTime = 0;
 static uint32_t sTotalForgetSkippableTime = 0;
 static uint32_t sRemovedPurples = 0;
 static uint32_t sForgetSkippableBeforeCC = 0;
 static uint32_t sPreviousSuspectedCount = 0;
 static uint32_t sCleanupsSinceLastGC = UINT32_MAX;
 static bool sNeedsFullCC = false;
 static bool sNeedsGCAfterCC = false;
-static nsJSContext *sContextList = nullptr;
 static bool sIncrementalCC = false;
 
 static nsScriptNameSpaceManager *gNameSpaceManager;
 
 static nsIJSRuntimeService *sRuntimeService;
 
 static const char kJSRuntimeServiceContractID[] =
   "@mozilla.org/js/xpc/RuntimeService;1";
@@ -762,23 +761,16 @@ nsJSContext::JSOptionChangedCallback(con
 nsJSContext::nsJSContext(bool aGCOnDestruction,
                          nsIScriptGlobalObject* aGlobalObject)
   : mWindowProxy(nullptr)
   , mGCOnDestruction(aGCOnDestruction)
   , mGlobalObjectRef(aGlobalObject)
 {
   EnsureStatics();
 
-  mNext = sContextList;
-  mPrev = &sContextList;
-  if (sContextList) {
-    sContextList->mPrev = &mNext;
-  }
-  sContextList = this;
-
   ++sContextCount;
 
   mContext = ::JS_NewContext(sRuntime, gStackSize);
   if (mContext) {
     ::JS_SetContextPrivate(mContext, static_cast<nsIScriptContext *>(this));
 
     // Make sure the new context gets the default context options
     JS::ContextOptionsRef(mContext).setPrivateIsNSISupports(true)
@@ -790,21 +782,16 @@ nsJSContext::nsJSContext(bool aGCOnDestr
   }
   mIsInitialized = false;
   mProcessingScriptTag = false;
   HoldJSObjects(this);
 }
 
 nsJSContext::~nsJSContext()
 {
-  *mPrev = mNext;
-  if (mNext) {
-    mNext->mPrev = mPrev;
-  }
-
   mGlobalObjectRef = nullptr;
 
   DestroyJSContext();
 
   --sContextCount;
 
   if (!sContextCount && sDidShutdown) {
     // The last context is being deleted, and we're already in the
--- a/dom/base/nsJSEnvironment.h
+++ b/dom/base/nsJSEnvironment.h
@@ -155,19 +155,16 @@ private:
 
   bool mIsInitialized;
   bool mGCOnDestruction;
   bool mProcessingScriptTag;
 
   PRTime mModalStateTime;
   uint32_t mModalStateDepth;
 
-  nsJSContext *mNext;
-  nsJSContext **mPrev;
-
   // mGlobalObjectRef ensures that the outer window stays alive as long as the
   // context does. It is eventually collected by the cycle collector.
   nsCOMPtr<nsIScriptGlobalObject> mGlobalObjectRef;
 
   static void JSOptionChangedCallback(const char *pref, void *data);
 
   static bool DOMOperationCallback(JSContext *cx);
 };