Bug 665564 - change DescribeNode to DescribeRefCountedNode to remove CCNodeType. r=bent
authorAndrew McCreight <amccreight@mozilla.com>
Thu, 23 Jun 2011 14:10:52 -0700
changeset 71915 9de9b3a9458ceb0004459e228e8d9d9f436acb0b
parent 71914 6be508728e3b6c44d86c5afa93cfb03337ebae63
child 71916 7d3d5b9710eaa9efa5e077b8844ad7ff8919e4a6
push id209
push userbzbarsky@mozilla.com
push dateTue, 05 Jul 2011 17:42:16 +0000
treeherdermozilla-aurora@cc6e30cce8af [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbent
bugs665564
milestone7.0a1
Bug 665564 - change DescribeNode to DescribeRefCountedNode to remove CCNodeType. r=bent
content/base/src/nsContentUtils.cpp
content/base/src/nsDocument.cpp
content/base/src/nsGenericElement.cpp
content/base/src/nsNodeInfo.cpp
dom/base/nsJSTimeoutHandler.cpp
js/src/xpconnect/src/nsXPConnect.cpp
js/src/xpconnect/src/xpcwrappedjs.cpp
js/src/xpconnect/src/xpcwrappednative.cpp
xpcom/base/nsCycleCollector.cpp
xpcom/glue/nsCycleCollectionParticipant.h
--- a/content/base/src/nsContentUtils.cpp
+++ b/content/base/src/nsContentUtils.cpp
@@ -5373,20 +5373,24 @@ class DebugWrapperTraversalCallback : pu
 {
 public:
   DebugWrapperTraversalCallback(void* aWrapper) : mFound(PR_FALSE),
                                                   mWrapper(aWrapper)
   {
     mFlags = WANT_ALL_TRACES;
   }
 
-  NS_IMETHOD_(void) DescribeNode(CCNodeType type,
-                                 nsrefcnt refcount,
-                                 size_t objsz,
-                                 const char* objname)
+  NS_IMETHOD_(void) DescribeRefCountedNode(nsrefcnt refCount,
+                                           size_t objSz,
+                                           const char *objName)
+  {
+  }
+  NS_IMETHOD_(void) DescribeGCedNode(PRBool isMarked,
+                                     size_t objSz,
+                                     const char *objName)
   {
   }
   NS_IMETHOD_(void) NoteXPCOMRoot(nsISupports *root)
   {
   }
   NS_IMETHOD_(void) NoteRoot(PRUint32 langID, void* root,
                              nsCycleCollectionParticipant* helper)
   {
--- a/content/base/src/nsDocument.cpp
+++ b/content/base/src/nsDocument.cpp
@@ -1808,21 +1808,20 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
       tmp->mDocumentURI->GetSpec(uri);
     if (nsid < NS_ARRAY_LENGTH(kNSURIs)) {
       PR_snprintf(name, sizeof(name), "nsDocument%s %s", kNSURIs[nsid],
                   uri.get());
     }
     else {
       PR_snprintf(name, sizeof(name), "nsDocument %s", uri.get());
     }
-    cb.DescribeNode(RefCounted, tmp->mRefCnt.get(), sizeof(nsDocument), name);
+    cb.DescribeRefCountedNode(tmp->mRefCnt.get(), sizeof(nsDocument), name);
   }
   else {
-    cb.DescribeNode(RefCounted, tmp->mRefCnt.get(), sizeof(nsDocument),
-                    "nsDocument");
+    NS_IMPL_CYCLE_COLLECTION_DESCRIBE(nsDocument, tmp->mRefCnt.get())
   }
 
   // Always need to traverse script objects, so do that before we check
   // if we're uncollectable.
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
 
   if (nsCCUncollectableMarker::InGeneration(cb, tmp->GetMarkedCCGeneration())) {
     return NS_SUCCESS_INTERRUPTED_TRAVERSE;
--- a/content/base/src/nsGenericElement.cpp
+++ b/content/base/src/nsGenericElement.cpp
@@ -4317,22 +4317,21 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
     nsAtomCString localName(tmp->NodeInfo()->NameAtom());
     if (nsid < NS_ARRAY_LENGTH(kNSURIs)) {
       PR_snprintf(name, sizeof(name), "nsGenericElement%s %s", kNSURIs[nsid],
                   localName.get());
     }
     else {
       PR_snprintf(name, sizeof(name), "nsGenericElement %s", localName.get());
     }
-    cb.DescribeNode(RefCounted, tmp->mRefCnt.get(), sizeof(nsGenericElement),
-                    name);
+    cb.DescribeRefCountedNode(tmp->mRefCnt.get(), sizeof(nsGenericElement),
+                              name);
   }
   else {
-    cb.DescribeNode(RefCounted, tmp->mRefCnt.get(), sizeof(nsGenericElement),
-                    "nsGenericElement");
+    NS_IMPL_CYCLE_COLLECTION_DESCRIBE(nsGenericElement, tmp->mRefCnt.get())
   }
 
   // Always need to traverse script objects, so do that before we check
   // if we're uncollectable.
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
 
   nsIDocument* currentDoc = tmp->GetCurrentDoc();
   if (currentDoc && nsCCUncollectableMarker::InGeneration(
--- a/content/base/src/nsNodeInfo.cpp
+++ b/content/base/src/nsNodeInfo.cpp
@@ -193,21 +193,20 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
     if (nsid < NS_ARRAY_LENGTH(kNSURIs)) {
       PR_snprintf(name, sizeof(name), "nsNodeInfo%s %s", kNSURIs[nsid],
                   localName.get());
     }
     else {
       PR_snprintf(name, sizeof(name), "nsNodeInfo %s", localName.get());
     }
 
-    cb.DescribeNode(RefCounted, tmp->mRefCnt.get(), sizeof(nsNodeInfo), name);
+    cb.DescribeRefCountedNode(tmp->mRefCnt.get(), sizeof(nsNodeInfo), name);
   }
   else {
-    cb.DescribeNode(RefCounted, tmp->mRefCnt.get(), sizeof(nsNodeInfo),
-                    "nsNodeInfo");
+    NS_IMPL_CYCLE_COLLECTION_DESCRIBE(nsNodeInfo, tmp->mRefCnt.get())
   }
 
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NATIVE_MEMBER(mOwnerManager,
                                                   nsNodeInfoManager)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsNodeInfo)
 NS_IMPL_CYCLE_COLLECTING_RELEASE_WITH_DESTROY(nsNodeInfo, LastRelease())
--- a/dom/base/nsJSTimeoutHandler.cpp
+++ b/dom/base/nsJSTimeoutHandler.cpp
@@ -137,23 +137,22 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_
           JS_PutEscapedFlatString(name, size, funId, 0);
           foo.AppendLiteral(" [");
           foo.Append(name);
           delete[] name;
           foo.AppendLiteral("]");
         }
       }
     }
-    cb.DescribeNode(RefCounted, tmp->mRefCnt.get(),
-                    sizeof(nsJSScriptTimeoutHandler), foo.get());
+    cb.DescribeRefCountedNode(tmp->mRefCnt.get(),
+                              sizeof(nsJSScriptTimeoutHandler), foo.get());
   }
   else {
-    cb.DescribeNode(RefCounted, tmp->mRefCnt.get(),
-                    sizeof(nsJSScriptTimeoutHandler),
-                    "nsJSScriptTimeoutHandler");
+    NS_IMPL_CYCLE_COLLECTION_DESCRIBE(nsJSScriptTimeoutHandler,
+                                      tmp->mRefCnt.get())
   }
 
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mContext)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_NSCOMPTR(mArgv)
   NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsJSScriptTimeoutHandler)
--- a/js/src/xpconnect/src/nsXPConnect.cpp
+++ b/js/src/xpconnect/src/nsXPConnect.cpp
@@ -742,17 +742,17 @@ nsXPConnect::Traverse(void *p, nsCycleCo
         else if(IS_WRAPPER_CLASS(clazz) && IS_WN_WRAPPER_OBJECT(obj))
         {
             XPCWrappedNative *wrapper = (XPCWrappedNative*)xpc_GetJSPrivate(obj);
             dontTraverse = WrapperIsNotMainThreadOnly(wrapper);
             markJSObject = dontTraverse && wrapper->HasExternalReference();
         }
     }
 
-    CCNodeType type;
+    PRBool isMarked;
 
 #ifdef DEBUG_CC
     // Note that the conditions under which we specify GCMarked vs.
     // GCUnmarked are different between ExplainLiveExpectedGarbage and
     // the normal case.  In the normal case, we're saying that anything
     // reachable from a JS runtime root is itself such a root.  This
     // doesn't actually break anything; it really just does some of the
     // cycle collector's work for it.  However, when debugging, we
@@ -760,24 +760,23 @@ nsXPConnect::Traverse(void *p, nsCycleCo
     // do an extra GC, so we use mJSRoots, built from JS_TraceRuntime,
     // which produces a different result because we didn't call
     // JS_TraceChildren to trace everything that was reachable.
     if(mJSRoots.ops)
     {
         // ExplainLiveExpectedGarbage codepath
         PLDHashEntryHdr* entry =
             PL_DHashTableOperate(&mJSRoots, p, PL_DHASH_LOOKUP);
-        type = markJSObject || PL_DHASH_ENTRY_IS_BUSY(entry) ? GCMarked :
-                                                               GCUnmarked;
+        isMarked = markJSObject || PL_DHASH_ENTRY_IS_BUSY(entry);
     }
     else
 #endif
     {
         // Normal codepath (matches non-DEBUG_CC codepath).
-        type = !markJSObject && xpc_IsGrayGCThing(p) ? GCUnmarked : GCMarked;
+        isMarked = markJSObject || !xpc_IsGrayGCThing(p);
     }
 
     if (cb.WantDebugInfo()) {
         char name[72];
         if(traceKind == JSTRACE_OBJECT)
         {
             JSObject *obj = static_cast<JSObject*>(p);
             js::Class *clazz = obj->getClass();
@@ -840,29 +839,29 @@ nsXPConnect::Traverse(void *p, nsCycleCo
 
         if(traceKind == JSTRACE_OBJECT) {
             JSObject *global = static_cast<JSObject*>(p), *parent;
             while((parent = global->getParent()))
                 global = parent;
             char fullname[100];
             JS_snprintf(fullname, sizeof(fullname),
                         "%s (global=%p)", name, global);
-            cb.DescribeNode(type, 0, sizeof(JSObject), fullname);
+            cb.DescribeGCedNode(isMarked, sizeof(JSObject), fullname);
         } else {
-            cb.DescribeNode(type, 0, sizeof(JSObject), name);
+            cb.DescribeGCedNode(isMarked, sizeof(JSObject), name);
         }
     } else {
-        cb.DescribeNode(type, 0, sizeof(JSObject), "JS Object");
+        cb.DescribeGCedNode(isMarked, sizeof(JSObject), "JS Object");
     }
 
     // There's no need to trace objects that have already been marked by the JS
     // GC. Any JS objects hanging from them will already be marked. Only do this
     // if DEBUG_CC is not defined, else we do want to know about all JS objects
     // to get better graphs and explanations.
-    if(!cb.WantAllTraces() && type == GCMarked)
+    if(!cb.WantAllTraces() && isMarked)
         return NS_OK;
 
     TraversalTracer trc(cb);
 
     JS_TRACER_INIT(&trc, cx, NoteJSChild);
     JS_TraceChildren(&trc, p, traceKind);
 
     if(traceKind != JSTRACE_OBJECT || dontTraverse)
@@ -927,18 +926,17 @@ public:
     {
         JSContext *cx = static_cast<JSContext*>(n);
 
         // Add outstandingRequests to the count, if there are outstanding
         // requests the context needs to be kept alive and adding unknown
         // edges will ensure that any cycles this context is in won't be
         // collected.
         unsigned refCount = nsXPConnect::GetXPConnect()->GetOutstandingRequests(cx) + 1;
-
-        cb.DescribeNode(RefCounted, refCount, sizeof(JSContext), "JSContext");
+        NS_IMPL_CYCLE_COLLECTION_DESCRIBE(JSContext, refCount)
         NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "[global object]");
         if (cx->globalObject) {
             cb.NoteScriptChild(nsIProgrammingLanguage::JAVASCRIPT,
                                cx->globalObject);
         }
 
         return NS_OK;
     }
--- a/js/src/xpconnect/src/xpcwrappedjs.cpp
+++ b/js/src/xpconnect/src/xpcwrappedjs.cpp
@@ -62,20 +62,19 @@ NS_CYCLE_COLLECTION_CLASSNAME(nsXPCWrapp
     nsrefcnt refcnt = tmp->mRefCnt.get();
     if (cb.WantDebugInfo()) {
         char name[72];
         if (tmp->GetClass())
             JS_snprintf(name, sizeof(name), "nsXPCWrappedJS (%s)",
                         tmp->GetClass()->GetInterfaceName());
         else
             JS_snprintf(name, sizeof(name), "nsXPCWrappedJS");
-        cb.DescribeNode(RefCounted, refcnt, sizeof(nsXPCWrappedJS), name);
+        cb.DescribeRefCountedNode(refcnt, sizeof(nsXPCWrappedJS), name);
     } else {
-        cb.DescribeNode(RefCounted, refcnt, sizeof(nsXPCWrappedJS),
-                        "nsXPCWrappedJS");
+        NS_IMPL_CYCLE_COLLECTION_DESCRIBE(nsXPCWrappedJS, refcnt)
     }
 
     // nsXPCWrappedJS keeps its own refcount artificially at or above 1, see the
     // comment above nsXPCWrappedJS::AddRef.
     cb.NoteXPCOMChild(s);
 
     if(refcnt > 1)
         // nsXPCWrappedJS roots its mJSObj when its refcount is > 1, see
--- a/js/src/xpconnect/src/xpcwrappednative.cpp
+++ b/js/src/xpconnect/src/xpcwrappednative.cpp
@@ -110,21 +110,20 @@ NS_CYCLE_COLLECTION_CLASSNAME(XPCWrapped
         char name[72];
         XPCNativeScriptableInfo* si = tmp->GetScriptableInfo();
         if(si)
             JS_snprintf(name, sizeof(name), "XPCWrappedNative (%s)",
                         si->GetJSClass()->name);
         else
             JS_snprintf(name, sizeof(name), "XPCWrappedNative");
 
-        cb.DescribeNode(RefCounted, tmp->mRefCnt.get(),
-                        sizeof(XPCWrappedNative), name);
+        cb.DescribeRefCountedNode(tmp->mRefCnt.get(),
+                                  sizeof(XPCWrappedNative), name);
     } else {
-        cb.DescribeNode(RefCounted, tmp->mRefCnt.get(),
-                        sizeof(XPCWrappedNative), "XPCWrappedNative");
+        NS_IMPL_CYCLE_COLLECTION_DESCRIBE(XPCWrappedNative, tmp->mRefCnt.get())
     }
 
     if(tmp->mRefCnt.get() > 1) {
 
         // If our refcount is > 1, our reference to the flat JS object is
         // considered "strong", and we're going to traverse it. 
         //
         // If our refcount is <= 1, our reference to the flat JS object is
--- a/xpcom/base/nsCycleCollector.cpp
+++ b/xpcom/base/nsCycleCollector.cpp
@@ -1456,18 +1456,40 @@ public:
 #endif
     void Traverse(PtrInfo* aPtrInfo);
     void SetLastChild();
 
     // nsCycleCollectionTraversalCallback methods.
     NS_IMETHOD_(void) NoteXPCOMRoot(nsISupports *root);
 
 private:
-    NS_IMETHOD_(void) DescribeNode(CCNodeType type, nsrefcnt refCount,
-                                   size_t objSz, const char *objName);
+    void DescribeNode(PRUint32 refCount,
+                      size_t objSz,
+                      const char *objName)
+    {
+#ifdef DEBUG_CC
+        mCurrPi->mBytes = objSz;
+        mCurrPi->mName = PL_strdup(objName);
+#endif
+
+        if (mListener) {
+            mListener->NoteObject((PRUint64)mCurrPi->mPointer, objName);
+        }
+
+        mCurrPi->mRefCount = refCount;
+
+#ifdef DEBUG_CC
+        sCollector->mStats.mVisitedNode++;
+#endif
+    }
+
+    NS_IMETHOD_(void) DescribeRefCountedNode(nsrefcnt refCount, size_t objSz,
+                                             const char *objName);
+    NS_IMETHOD_(void) DescribeGCedNode(PRBool isMarked, size_t objSz,
+                                       const char *objName);
     NS_IMETHOD_(void) NoteRoot(PRUint32 langID, void *child,
                                nsCycleCollectionParticipant* participant);
     NS_IMETHOD_(void) NoteXPCOMChild(nsISupports *child);
     NS_IMETHOD_(void) NoteNativeChild(void *child,
                                      nsCycleCollectionParticipant *participant);
     NS_IMETHOD_(void) NoteScriptChild(PRUint32 langID, void *child);
     NS_IMETHOD_(void) NoteNextEdgeName(const char* name);
 };
@@ -1589,42 +1611,32 @@ GCGraphBuilder::NoteRoot(PRUint32 langID
         Fault("adding root for unregistered language", root);
         return;
     }
 
     AddNode(root, participant, langID);
 }
 
 NS_IMETHODIMP_(void)
-GCGraphBuilder::DescribeNode(CCNodeType type, nsrefcnt refCount,
-                             size_t objSz, const char *objName)
+GCGraphBuilder::DescribeRefCountedNode(nsrefcnt refCount, size_t objSz,
+                                       const char *objName)
 {
-#ifdef DEBUG_CC
-    mCurrPi->mBytes = objSz;
-    mCurrPi->mName = PL_strdup(objName);
-#endif
-
-    if (mListener) {
-        mListener->NoteObject((PRUint64)mCurrPi->mPointer, objName);
-    }
-
-    if (type == RefCounted) {
-        if (refCount == 0)
-            Fault("zero refcount", mCurrPi);
-        if (refCount == PR_UINT32_MAX)
-            Fault("overflowing refcount", mCurrPi);
-
-        mCurrPi->mRefCount = refCount;
-    }
-    else {
-        mCurrPi->mRefCount = type == GCMarked ? PR_UINT32_MAX : 0;
-    }
-#ifdef DEBUG_CC
-    sCollector->mStats.mVisitedNode++;
-#endif
+    if (refCount == 0)
+        Fault("zero refcount", mCurrPi);
+    if (refCount == PR_UINT32_MAX)
+        Fault("overflowing refcount", mCurrPi);
+    DescribeNode(refCount, objSz, objName);
+}
+
+NS_IMETHODIMP_(void)
+GCGraphBuilder::DescribeGCedNode(PRBool isMarked, size_t objSz,
+                                 const char *objName)
+{
+    PRUint32 refCount = isMarked ? PR_UINT32_MAX : 0;
+    DescribeNode(refCount, objSz, objName);
 }
 
 NS_IMETHODIMP_(void)
 GCGraphBuilder::NoteXPCOMChild(nsISupports *child) 
 {
     nsCString edgeName;
     if (WantDebugInfo()) {
         edgeName.Assign(mNextEdgeName);
@@ -2274,18 +2286,24 @@ public:
                 Fault("checking suppression on wrong type of pointer", s);
                 return PR_TRUE;
             }
             cp->Traverse(s, *this);
         }
         return mSuppressThisNode;
     }
 
-    NS_IMETHOD_(void) DescribeNode(CCNodeType type, nsrefcnt refCount,
-                                   size_t objSz, const char *objName)
+    NS_IMETHOD_(void) DescribeRefCountedNode(nsrefcnt refCount, size_t objSz,
+                                             const char *objName)
+    {
+        mSuppressThisNode = (PL_strstr(sSuppressionList, objName) != nsnull);
+    }
+
+    NS_IMETHOD_(void) DescribeGCedNode(PRBool isMarked, size_t objSz,
+                                       const char *objName)
     {
         mSuppressThisNode = (PL_strstr(sSuppressionList, objName) != nsnull);
     }
 
     NS_IMETHOD_(void) NoteXPCOMRoot(nsISupports *root) {};
     NS_IMETHOD_(void) NoteRoot(PRUint32 langID, void *root,
                                nsCycleCollectionParticipant* participant) {};
     NS_IMETHOD_(void) NoteXPCOMChild(nsISupports *child) {}
--- a/xpcom/glue/nsCycleCollectionParticipant.h
+++ b/xpcom/glue/nsCycleCollectionParticipant.h
@@ -76,30 +76,29 @@ public:
     NS_DECLARE_STATIC_IID_ACCESSOR(NS_CYCLECOLLECTIONISUPPORTS_IID)
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(nsCycleCollectionISupports, 
                               NS_CYCLECOLLECTIONISUPPORTS_IID)
 
 class nsCycleCollectionParticipant;
 
-enum CCNodeType { RefCounted, GCMarked, GCUnmarked };
-
 class NS_NO_VTABLE nsCycleCollectionTraversalCallback
 {
 public:
-    // If type is RefCounted you must call DescribeNode() with an accurate
+    // You must call DescribeRefCountedNode() with an accurate
     // refcount, otherwise cycle collection will fail, and probably crash.
-    // If type is not refcounted then the refcount will be ignored.
     // If the callback cares about objsz or objname, it should
     // put WANT_DEBUG_INFO in mFlags.
-    NS_IMETHOD_(void) DescribeNode(CCNodeType type,
-                                   nsrefcnt refcount,
-                                   size_t objsz,
-                                   const char *objname) = 0;
+    NS_IMETHOD_(void) DescribeRefCountedNode(nsrefcnt refcount,
+                                             size_t objsz,
+                                             const char *objname) = 0;
+    NS_IMETHOD_(void) DescribeGCedNode(PRBool ismarked,
+                                       size_t objsz,
+                                       const char *objname) = 0;
     NS_IMETHOD_(void) NoteXPCOMRoot(nsISupports *root) = 0;
     NS_IMETHOD_(void) NoteRoot(PRUint32 langID, void *root,
                                nsCycleCollectionParticipant* helper) = 0;
     NS_IMETHOD_(void) NoteScriptChild(PRUint32 langID, void *child) = 0;
     NS_IMETHOD_(void) NoteXPCOMChild(nsISupports *child) = 0;
     NS_IMETHOD_(void) NoteNativeChild(void *child,
                                       nsCycleCollectionParticipant *helper) = 0;
 
@@ -107,18 +106,19 @@ public:
     // NoteScriptChild, NoteXPCOMChild, or NoteNativeChild.
     // Callbacks who care about this should set WANT_DEBUG_INFO in the
     // flags.
     NS_IMETHOD_(void) NoteNextEdgeName(const char* name) = 0;
 
     enum {
         // Values for flags:
 
-        // Caller should pass useful objsz and objname to DescribeNode
-        // and should call NoteNextEdgeName.
+        // Caller should pass useful objsz and objname to
+        // DescribeRefCountedNode and DescribeGCedNode and should call
+        // NoteNextEdgeName.
         WANT_DEBUG_INFO = (1<<0),
 
         // Caller should not skip objects that we know will be
         // uncollectable.
         WANT_ALL_TRACES = (1<<1)
     };
     PRUint32 Flags() const { return mFlags; }
     PRBool WantDebugInfo() const { return (mFlags & WANT_DEBUG_INFO) != 0; }
@@ -302,17 +302,17 @@ public:
   }
 
 
 ///////////////////////////////////////////////////////////////////////////////
 // Helpers for implementing nsCycleCollectionParticipant::Traverse
 ///////////////////////////////////////////////////////////////////////////////
 
 #define NS_IMPL_CYCLE_COLLECTION_DESCRIBE(_class, _refcnt)                     \
-    cb.DescribeNode(RefCounted, _refcnt, sizeof(_class), #_class);
+    cb.DescribeRefCountedNode(_refcnt, sizeof(_class), #_class);
 
 #define NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INTERNAL(_class)               \
   NS_IMETHODIMP                                                                \
   NS_CYCLE_COLLECTION_CLASSNAME(_class)::Traverse                              \
                          (void *p,                                             \
                           nsCycleCollectionTraversalCallback &cb)              \
   {                                                                            \
     nsISupports *s = static_cast<nsISupports*>(p);                             \