Bug 1332322 part 3. Rename nsWrapperCache::IsBlackAndDoesNotNeedTracing to nsWrapperCache::HasKnownLiveWrapperAndDoesNotNeedTracing. r=mccr8
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 24 Jan 2017 20:39:37 -0500
changeset 330969 b87d9d7b10b5ec2552853af76f37ce2faa2fbade
parent 330968 77087c94f9314d39ed9b7e3002659f5a6fdf49b6
child 330970 8fd0b1d9a60a42a5f680514403e5571ab8f52cd3
push id31256
push usercbook@mozilla.com
push dateWed, 25 Jan 2017 12:47:57 +0000
treeherdermozilla-central@c989c7b35227 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmccr8
bugs1332322
milestone54.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 1332322 part 3. Rename nsWrapperCache::IsBlackAndDoesNotNeedTracing to nsWrapperCache::HasKnownLiveWrapperAndDoesNotNeedTracing. r=mccr8
dom/base/Attr.cpp
dom/base/FragmentOrElement.cpp
dom/base/nsDOMAttributeMap.cpp
dom/base/nsWrapperCache.h
dom/base/nsWrapperCacheInlines.h
dom/events/DOMEventTargetHelper.cpp
dom/xhr/XMLHttpRequestMainThread.cpp
--- a/dom/base/Attr.cpp
+++ b/dom/base/Attr.cpp
@@ -84,17 +84,17 @@ NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(
   }
   if (ownerElement &&
       mozilla::dom::FragmentOrElement::CanSkip(ownerElement, true)) {
     return true;
   }
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(Attr)
-  return tmp->IsBlackAndDoesNotNeedTracing(static_cast<nsIAttribute*>(tmp));
+  return tmp->HasKnownLiveWrapperAndDoesNotNeedTracing(static_cast<nsIAttribute*>(tmp));
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(Attr)
   return tmp->HasKnownLiveWrapper();
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END
 
 // QueryInterface implementation for Attr
 NS_INTERFACE_TABLE_HEAD(Attr)
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -412,17 +412,17 @@ GetJSObjectChild(nsWrapperCache* aCache)
 {
   return aCache->PreservingWrapper() ? aCache->GetWrapperPreserveColor() : nullptr;
 }
 
 static bool
 NeedsScriptTraverse(nsINode* aNode)
 {
   return aNode->PreservingWrapper() && aNode->GetWrapperPreserveColor() &&
-         !aNode->IsBlackAndDoesNotNeedTracing(aNode);
+         !aNode->HasKnownLiveWrapperAndDoesNotNeedTracing(aNode);
 }
 
 //----------------------------------------------------------------------
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsChildContentList)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsChildContentList)
 
 // If nsChildContentList is changed so that any additional fields are
@@ -432,17 +432,17 @@ NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(
 
 // nsChildContentList only ever has a single child, its wrapper, so if
 // the wrapper is known-live, the list can't be part of a garbage cycle.
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsChildContentList)
   return tmp->HasKnownLiveWrapper();
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(nsChildContentList)
-  return tmp->IsBlackAndDoesNotNeedTracing(tmp);
+  return tmp->HasKnownLiveWrapperAndDoesNotNeedTracing(tmp);
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END
 
 // CanSkipThis returns false to avoid problems with incomplete unlinking.
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(nsChildContentList)
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END
 
 NS_INTERFACE_TABLE_HEAD(nsChildContentList)
   NS_WRAPPERCACHE_INTERFACE_TABLE_ENTRY
--- a/dom/base/nsDOMAttributeMap.cpp
+++ b/dom/base/nsDOMAttributeMap.cpp
@@ -81,17 +81,17 @@ NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(
   }
   if (tmp->mContent &&
       mozilla::dom::FragmentOrElement::CanSkip(tmp->mContent, true)) {
     return true;
   }
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(nsDOMAttributeMap)
-  return tmp->IsBlackAndDoesNotNeedTracing(tmp);
+  return tmp->HasKnownLiveWrapperAndDoesNotNeedTracing(tmp);
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(nsDOMAttributeMap)
   return tmp->HasKnownLiveWrapper();
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END
 
 // QueryInterface implementation for nsDOMAttributeMap
 NS_INTERFACE_TABLE_HEAD(nsDOMAttributeMap)
--- a/dom/base/nsWrapperCache.h
+++ b/dom/base/nsWrapperCache.h
@@ -163,20 +163,21 @@ public:
 
   /**
    * Returns true if the object has a wrapper that is known live from the point
    * of view of cycle collection.
    */
   bool HasKnownLiveWrapper() const;
 
   /**
-   * Returns true if the object has a black wrapper,
-   * and all the GC things it is keeping alive are black too.
+   * Returns true if the object has a known-live wrapper (from the CC point of
+   * view) and all the GC things it is keeping alive are already known-live from
+   * CC's point of view.
    */
-  bool IsBlackAndDoesNotNeedTracing(nsISupports* aThis);
+  bool HasKnownLiveWrapperAndDoesNotNeedTracing(nsISupports* aThis);
 
   bool HasNothingToTrace(nsISupports* aThis);
 
   /**
    * Mark our wrapper, if any, as live as far as the CC is concerned.
    */
   void MarkWrapperLive();
 
--- a/dom/base/nsWrapperCacheInlines.h
+++ b/dom/base/nsWrapperCacheInlines.h
@@ -48,17 +48,17 @@ nsWrapperCache::HasNothingToTrace(nsISup
   nsXPCOMCycleCollectionParticipant* participant = nullptr;
   CallQueryInterface(aThis, &participant);
   bool hasGrayObjects = false;
   participant->Trace(aThis, TraceCallbackFunc(SearchGray), &hasGrayObjects);
   return !hasGrayObjects;
 }
 
 inline bool
-nsWrapperCache::IsBlackAndDoesNotNeedTracing(nsISupports* aThis)
+nsWrapperCache::HasKnownLiveWrapperAndDoesNotNeedTracing(nsISupports* aThis)
 {
   return HasKnownLiveWrapper() && HasNothingToTrace(aThis);
 }
 
 inline void
 nsWrapperCache::MarkWrapperLive()
 {
   // Just call GetWrapper and ignore the return value.  It will do the
--- a/dom/events/DOMEventTargetHelper.cpp
+++ b/dom/events/DOMEventTargetHelper.cpp
@@ -59,17 +59,17 @@ NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(
     if (!tmp->HasKnownLiveWrapper() && tmp->PreservingWrapper()) {
       tmp->MarkWrapperLive();
     }
     return true;
   }
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(DOMEventTargetHelper)
-  return tmp->IsBlackAndDoesNotNeedTracing(tmp);
+  return tmp->HasKnownLiveWrapperAndDoesNotNeedTracing(tmp);
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(DOMEventTargetHelper)
   return tmp->HasKnownLiveWrapper();
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMEventTargetHelper)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
--- a/dom/xhr/XMLHttpRequestMainThread.cpp
+++ b/dom/xhr/XMLHttpRequestMainThread.cpp
@@ -323,18 +323,18 @@ NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(
     if (!hasLiveWrapper && tmp->PreservingWrapper()) {
       tmp->MarkWrapperLive();
     }
     return true;
   }
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_END
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_BEGIN(XMLHttpRequestMainThread)
-  return tmp->
-    IsBlackAndDoesNotNeedTracing(static_cast<DOMEventTargetHelper*>(tmp));
+  return tmp->HasKnownLiveWrapperAndDoesNotNeedTracing(
+    static_cast<DOMEventTargetHelper*>(tmp));
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_IN_CC_END
 
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_BEGIN(XMLHttpRequestMainThread)
   return tmp->HasKnownLiveWrapper();
 NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_END
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(XMLHttpRequestMainThread,
                                                   XMLHttpRequestEventTarget)