Backed out changeset b7e91bafdcd9
authorSteve Fink <sfink@mozilla.com>
Mon, 24 Jan 2011 15:10:52 -0800
changeset 61243 8f09ff778d691f8d9a08fd3acdd6d7882121924d
parent 61242 c52e5d68a7476f91d4b001b69e5829603f1beb60
child 61244 32cf4e3c7a20c8c7f481a17aca7a4d9387795fa6
push id18277
push usercleary@mozilla.com
push dateTue, 25 Jan 2011 03:52:51 +0000
treeherdermozilla-central@7ee91bd90e7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.0b10pre
backs outb7e91bafdcd9b826f145199105d5ab1c2fab8978
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
Backed out changeset b7e91bafdcd9
js/src/xpconnect/src/nsXPConnect.cpp
--- a/js/src/xpconnect/src/nsXPConnect.cpp
+++ b/js/src/xpconnect/src/nsXPConnect.cpp
@@ -2493,29 +2493,24 @@ nsXPConnect::Pop(JSContext * *_retval)
 NS_IMETHODIMP
 nsXPConnect::Push(JSContext * cx)
 {
     XPCPerThreadData* data = XPCPerThreadData::GetData(cx);
 
     if(!data)
         return NS_ERROR_FAILURE;
 
-    if (gDebugMode != gDesiredDebugMode && NS_IsMainThread()) {
-        const nsTArray<XPCJSContextInfo>* stack = data->GetJSContextStack()->GetStack();
-        bool runningJS = false;
-        for (PRUint32 i = 0; i < stack->Length(); ++i) {
-            JSContext *cx = (*stack)[i].cx;
-            if (cx && cx->regs) {
-                runningJS = true;
-                break;
-            }
-        }
-        if (!runningJS)
-            CheckForDebugMode(mRuntime->GetJSRuntime());
-    }
+    PRInt32 count;
+    nsresult rv;
+    rv = data->GetJSContextStack()->GetCount(&count);
+    if (NS_FAILED(rv))
+        return rv;
+
+    if (count == 0)
+        CheckForDebugMode(mRuntime->GetJSRuntime());
 
     return data->GetJSContextStack()->Push(cx);
 }
 
 /* attribute JSContext SafeJSContext; */
 NS_IMETHODIMP
 nsXPConnect::GetSafeJSContext(JSContext * *aSafeJSContext)
 {