From 747b9fa72984788695487e9de9a150012bdd1d01 Mon Sep 17 00:00:00 2001 From: "dbaron@dbaron.org" Date: Wed, 6 Jun 2007 15:04:26 -0700 Subject: [PATCH] Make DEBUG_CC compile again. b=383234 r+sr=peter --- xpcom/base/nsCycleCollector.cpp | 52 ++++++++++++++++----------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp index a093ed7025d..efc514def1a 100644 --- a/xpcom/base/nsCycleCollector.cpp +++ b/xpcom/base/nsCycleCollector.cpp @@ -218,7 +218,6 @@ struct nsCycleCollectorStats PRUint32 mSuccessfulQI; PRUint32 mVisitedNode; - PRUint32 mVisitedJSNode; PRUint32 mWalkedGraph; PRUint32 mCollectedBytes; PRUint32 mFreeCalls; @@ -253,7 +252,6 @@ struct nsCycleCollectorStats DUMP(mSuccessfulQI); DUMP(mVisitedNode); - DUMP(mVisitedJSNode); DUMP(mWalkedGraph); DUMP(mCollectedBytes); DUMP(mFreeCalls); @@ -279,23 +277,6 @@ struct nsCycleCollectorStats }; #endif -static inline void -ToParticipant(nsISupports *s, nsXPCOMCycleCollectionParticipant **cp) -{ - // We use QI to move from an nsISupports to an - // nsXPCOMCycleCollectionParticipant, which is a per-class singleton helper - // object that implements traversal and unlinking logic for the nsISupports - // in question. - CallQueryInterface(s, cp); -#ifdef DEBUG_CC - if (cp) - ++sCollector->mStats.mSuccessfulQI; - else - ++sCollector->mStats.mFailedQI; -#endif -} - - #ifdef DEBUG_CC static PRBool nsCycleCollector_shouldSuppress(nsISupports *s); @@ -795,12 +776,7 @@ struct nsCycleCollectionXPCOMRuntime : return NS_OK; } - nsCycleCollectionParticipant *ToParticipant(void *p) - { - nsXPCOMCycleCollectionParticipant *cp; - ::ToParticipant(NS_STATIC_CAST(nsISupports*, p), &cp); - return cp; - } + inline nsCycleCollectionParticipant *ToParticipant(void *p); }; struct nsCycleCollector @@ -926,6 +902,30 @@ canonicalize(nsISupports *in) return child.get(); } +static inline void +ToParticipant(nsISupports *s, nsXPCOMCycleCollectionParticipant **cp) +{ + // We use QI to move from an nsISupports to an + // nsXPCOMCycleCollectionParticipant, which is a per-class singleton helper + // object that implements traversal and unlinking logic for the nsISupports + // in question. + CallQueryInterface(s, cp); +#ifdef DEBUG_CC + if (cp) + ++sCollector->mStats.mSuccessfulQI; + else + ++sCollector->mStats.mFailedQI; +#endif +} + +nsCycleCollectionParticipant * +nsCycleCollectionXPCOMRuntime::ToParticipant(void *p) +{ + nsXPCOMCycleCollectionParticipant *cp; + ::ToParticipant(NS_STATIC_CAST(nsISupports*, p), &cp); + return cp; +} + void GraphWalker::Walk(PtrInfo *s0) @@ -1111,8 +1111,6 @@ GCGraphBuilder::DescribeNode(size_t refCount) mCurrPi->mRefCount = refCount; #ifdef DEBUG_CC sCollector->mStats.mVisitedNode++; - if (mCurrPi->mParticipant == mRuntimes[nsIProgrammingLanguage::JAVASCRIPT]) - sCollector->mStats.mVisitedJSNode++; #endif }