Bug 747675, try to decrease max forgetSkippable times, r=mccr8
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Wed, 25 Apr 2012 16:43:18 +0300
changeset 92570 4b6514ffcf16b266d8504f13e9c220104dedd3d1
parent 92423 83ef3c9a64b50b703f73399152f931413d47a904
child 92571 d470016df45dfa3141e2585f21d2ed09b9ace7f6
push id8756
push userphilringnalda@gmail.com
push dateFri, 27 Apr 2012 04:42:37 +0000
treeherdermozilla-inbound@a2f61f95b2c3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs747675
milestone15.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 747675, try to decrease max forgetSkippable times, r=mccr8
content/base/src/nsCCUncollectableMarker.cpp
--- a/content/base/src/nsCCUncollectableMarker.cpp
+++ b/content/base/src/nsCCUncollectableMarker.cpp
@@ -357,29 +357,35 @@ nsCCUncollectableMarker::Observe(nsISupp
     if (hw) {
       nsCOMPtr<nsIDocShell> shell;
       hw->GetDocShell(getter_AddRefs(shell));
       nsCOMPtr<nsIDocShellTreeNode> shellTreeNode = do_QueryInterface(shell);
       MarkDocShell(shellTreeNode, cleanupJS, prepareForCC);
     }
   }
 
-  if (cleanupJS) {
-    nsContentUtils::UnmarkGrayJSListenersInCCGenerationDocuments(sGeneration);
-    MarkMessageManagers();
-    xpc_UnmarkSkippableJSHolders();
-  }
-
 #ifdef MOZ_XUL
   nsXULPrototypeCache* xulCache = nsXULPrototypeCache::GetInstance();
   if (xulCache) {
     xulCache->MarkInCCGeneration(sGeneration);
   }
 #endif
 
+  static bool previousWasJSCleanup = false;
+  if (cleanupJS) {
+    nsContentUtils::UnmarkGrayJSListenersInCCGenerationDocuments(sGeneration);
+    MarkMessageManagers();
+    previousWasJSCleanup = true;
+  } else if (previousWasJSCleanup) {
+    previousWasJSCleanup = false;
+    if (!prepareForCC) {
+      xpc_UnmarkSkippableJSHolders();
+    }
+  }
+
   return NS_OK;
 }
 
 static PLDHashOperator
 TraceActiveWindowGlobal(const PRUint64& aId, nsGlobalWindow*& aWindow, void* aClosure)
 {
   if (aWindow->GetDocShell() && aWindow->IsOuterWindow()) {
     if (JSObject* global = aWindow->FastGetGlobalJSObject()) {