Bug 899367 - Remove check for non-WindowProxy objects on an scx. r=mccr8
authorBobby Holley <bobbyholley@gmail.com>
Wed, 04 Sep 2013 14:06:56 -0700
changeset 145514 156e8e401a833f3281c8a9e7b8d5b96f80e5e464
parent 145513 32c995dfd0806a0ee44f5f3a739d3c900a723286
child 145515 dd6d206a9a8a87b3f8eed20a9b78f2afdd080715
push id33304
push userbobbyholley@gmail.com
push dateWed, 04 Sep 2013 21:07:07 +0000
treeherdermozilla-inbound@dd6d206a9a8a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs899367
milestone26.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 899367 - Remove check for non-WindowProxy objects on an scx. r=mccr8
xpcom/base/CycleCollectedJSRuntime.cpp
--- a/xpcom/base/CycleCollectedJSRuntime.cpp
+++ b/xpcom/base/CycleCollectedJSRuntime.cpp
@@ -875,29 +875,28 @@ CycleCollectedJSRuntime::UsefulToMergeZo
   if (!NS_IsMainThread()) {
     return false;
   }
 
   JSContext* iter = nullptr;
   JSContext* cx;
   JSAutoRequest ar(nsContentUtils::GetSafeJSContext());
   while ((cx = JS_ContextIterator(mJSRuntime, &iter))) {
-    // Skip anything without an nsIScriptContext, as well as any scx whose
-    // NativeGlobal() is not an outer window (this happens with XUL Prototype
-    // compilation scopes, for example, which we're not interested in).
+    // Skip anything without an nsIScriptContext.
     nsIScriptContext* scx = GetScriptContextFromJSContext(cx);
-    JS::RootedObject global(cx, scx ? scx->GetWindowProxyPreserveColor() : nullptr);
-    if (!global || !js::GetObjectParent(global)) {
+    JS::RootedObject obj(cx, scx ? scx->GetWindowProxyPreserveColor() : nullptr);
+    if (!obj) {
       continue;
     }
+    MOZ_ASSERT(js::IsOuterObject(obj));
     // Grab the inner from the outer.
-    global = JS_ObjectToInnerObject(cx, global);
-    MOZ_ASSERT(!js::GetObjectParent(global));
-    if (JS::GCThingIsMarkedGray(global) &&
-        !js::IsSystemCompartment(js::GetObjectCompartment(global))) {
+    obj = JS_ObjectToInnerObject(cx, obj);
+    MOZ_ASSERT(!js::GetObjectParent(obj));
+    if (JS::GCThingIsMarkedGray(obj) &&
+        !js::IsSystemCompartment(js::GetObjectCompartment(obj))) {
       return true;
     }
   }
   return false;
 }
 
 void
 CycleCollectedJSRuntime::FixWeakMappingGrayBits() const