diff --git a/content/base/src/nsContentUtils.cpp b/content/base/src/nsContentUtils.cpp index c6180205b0cd..f40051de9bfd 100644 --- a/content/base/src/nsContentUtils.cpp +++ b/content/base/src/nsContentUtils.cpp @@ -6086,10 +6086,9 @@ public: nsCycleCollectionParticipant* helper) { } - NS_IMETHOD_(void) NoteScriptChild(PRUint32 langID, void* child) + NS_IMETHOD_(void) NoteJSChild(void* child) { - if (langID == nsIProgrammingLanguage::JAVASCRIPT && - child == mWrapper) { + if (child == mWrapper) { mFound = true; } } @@ -6116,12 +6115,11 @@ private: }; static void -DebugWrapperTraceCallback(PRUint32 langID, void *p, const char *name, - void *closure) +DebugWrapperTraceCallback(void *p, const char *name, void *closure) { DebugWrapperTraversalCallback* callback = static_cast(closure); - callback->NoteScriptChild(langID, p); + callback->NoteJSChild(p); } // static @@ -6639,8 +6637,7 @@ nsContentUtils::TraceWrapper(nsWrapperCache* aCache, TraceCallback aCallback, if (aCache->PreservingWrapper()) { JSObject *wrapper = aCache->GetWrapperPreserveColor(); if (wrapper) { - aCallback(nsIProgrammingLanguage::JAVASCRIPT, wrapper, - "Preserved wrapper", aClosure); + aCallback(wrapper, "Preserved wrapper", aClosure); } } } diff --git a/content/xbl/src/nsXBLDocumentInfo.cpp b/content/xbl/src/nsXBLDocumentInfo.cpp index cfde3837cf37..28a8dfd3d668 100644 --- a/content/xbl/src/nsXBLDocumentInfo.cpp +++ b/content/xbl/src/nsXBLDocumentInfo.cpp @@ -494,11 +494,9 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsXBLDocumentInfo) NS_IMPL_CYCLE_COLLECTION_TRACE_END static void -UnmarkXBLJSObject(PRUint32 aLangID, void* aP, const char* aName, void* aClosure) +UnmarkXBLJSObject(void* aP, const char* aName, void* aClosure) { - if (aLangID == nsIProgrammingLanguage::JAVASCRIPT) { - xpc_UnmarkGrayObject(static_cast(aP)); - } + xpc_UnmarkGrayObject(static_cast(aP)); } static bool diff --git a/content/xbl/src/nsXBLProtoImplMethod.cpp b/content/xbl/src/nsXBLProtoImplMethod.cpp index 68e6b6d42534..10f276c7d940 100644 --- a/content/xbl/src/nsXBLProtoImplMethod.cpp +++ b/content/xbl/src/nsXBLProtoImplMethod.cpp @@ -263,7 +263,7 @@ void nsXBLProtoImplMethod::Trace(TraceCallback aCallback, void *aClosure) const { if (IsCompiled() && mJSMethodObject) { - aCallback(nsIProgrammingLanguage::JAVASCRIPT, mJSMethodObject, "mJSMethodObject", aClosure); + aCallback(mJSMethodObject, "mJSMethodObject", aClosure); } } diff --git a/content/xbl/src/nsXBLProtoImplProperty.cpp b/content/xbl/src/nsXBLProtoImplProperty.cpp index f45ecdd22cac..2037a6bd62de 100644 --- a/content/xbl/src/nsXBLProtoImplProperty.cpp +++ b/content/xbl/src/nsXBLProtoImplProperty.cpp @@ -344,13 +344,11 @@ void nsXBLProtoImplProperty::Trace(TraceCallback aCallback, void *aClosure) const { if (mJSAttributes & JSPROP_GETTER) { - aCallback(nsIProgrammingLanguage::JAVASCRIPT, mJSGetterObject, - "mJSGetterObject", aClosure); + aCallback(mJSGetterObject, "mJSGetterObject", aClosure); } if (mJSAttributes & JSPROP_SETTER) { - aCallback(nsIProgrammingLanguage::JAVASCRIPT, mJSSetterObject, - "mJSSetterObject", aClosure); + aCallback(mJSSetterObject, "mJSSetterObject", aClosure); } } diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index ba70a62b3df2..d866299f96ed 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -1353,8 +1353,7 @@ static PLDHashOperator TraceXBLHandlers(nsXBLPrototypeHandler* aKey, JSObject* aData, void* aClosure) { TraceData* data = static_cast(aClosure); - data->callback(nsIProgrammingLanguage::JAVASCRIPT, aData, - "Cached XBL prototype handler", data->closure); + data->callback(aData, "Cached XBL prototype handler", data->closure); return PL_DHASH_NEXT; } diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 89f30609d144..bed86d042802 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -3946,9 +3946,8 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsJSArgArray) jsval *end; for (end = argv + tmp->mArgc; argv < end; ++argv) { if (JSVAL_IS_GCTHING(*argv)) - NS_IMPL_CYCLE_COLLECTION_TRACE_CALLBACK(JAVASCRIPT, - JSVAL_TO_GCTHING(*argv), - "mArgv[i]") + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(JSVAL_TO_GCTHING(*argv), + "mArgv[i]") } } NS_IMPL_CYCLE_COLLECTION_TRACE_END diff --git a/dom/src/events/nsJSEventListener.cpp b/dom/src/events/nsJSEventListener.cpp index 769fae25dcba..b9047e141399 100644 --- a/dom/src/events/nsJSEventListener.cpp +++ b/dom/src/events/nsJSEventListener.cpp @@ -110,10 +110,8 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsJSEventListener) NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(nsJSEventListener) - NS_IMPL_CYCLE_COLLECTION_TRACE_MEMBER_CALLBACK(nsIProgrammingLanguage::JAVASCRIPT, - mScopeObject) - NS_IMPL_CYCLE_COLLECTION_TRACE_MEMBER_CALLBACK(nsIProgrammingLanguage::JAVASCRIPT, - mHandler) + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mScopeObject) + NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mHandler) NS_IMPL_CYCLE_COLLECTION_TRACE_END NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_BEGIN(nsJSEventListener) diff --git a/js/xpconnect/src/XPCJSRuntime.cpp b/js/xpconnect/src/XPCJSRuntime.cpp index d6c10b3182d6..725cd01c900b 100644 --- a/js/xpconnect/src/XPCJSRuntime.cpp +++ b/js/xpconnect/src/XPCJSRuntime.cpp @@ -363,13 +363,10 @@ void XPCJSRuntime::TraceGrayJS(JSTracer* trc, void* data) } static void -TraceJSObject(PRUint32 aLangID, void *aScriptThing, const char *name, - void *aClosure) +TraceJSObject(void *aScriptThing, const char *name, void *aClosure) { - if (aLangID == nsIProgrammingLanguage::JAVASCRIPT) { - JS_CALL_TRACER(static_cast(aClosure), aScriptThing, - js_GetGCThingTraceKind(aScriptThing), name); - } + JS_CALL_TRACER(static_cast(aClosure), aScriptThing, + js_GetGCThingTraceKind(aScriptThing), name); } static JSDHashOperator @@ -441,16 +438,14 @@ struct Closure }; static void -CheckParticipatesInCycleCollection(PRUint32 aLangID, void *aThing, - const char *name, void *aClosure) +CheckParticipatesInCycleCollection(void *aThing, const char *name, void *aClosure) { Closure *closure = static_cast(aClosure); if (closure->cycleCollectionEnabled) return; - if (aLangID == nsIProgrammingLanguage::JAVASCRIPT && - AddToCCKind(js_GetGCThingTraceKind(aThing)) && + if (AddToCCKind(js_GetGCThingTraceKind(aThing)) && xpc_IsGrayGCThing(aThing)) { closure->cycleCollectionEnabled = true; diff --git a/js/xpconnect/src/XPCVariant.cpp b/js/xpconnect/src/XPCVariant.cpp index bacd8429bcf7..c962cb38fbdc 100644 --- a/js/xpconnect/src/XPCVariant.cpp +++ b/js/xpconnect/src/XPCVariant.cpp @@ -120,8 +120,7 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(XPCVariant) jsval val = tmp->GetJSValPreserveColor(); if (JSVAL_IS_OBJECT(val)) { NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mJSVal"); - cb.NoteScriptChild(nsIProgrammingLanguage::JAVASCRIPT, - JSVAL_TO_OBJECT(val)); + cb.NoteJSChild(JSVAL_TO_OBJECT(val)); } nsVariant::Traverse(tmp->mData, cb); diff --git a/js/xpconnect/src/XPCWrappedJS.cpp b/js/xpconnect/src/XPCWrappedJS.cpp index 1cc58a9f7fa4..9a03a5dd662e 100644 --- a/js/xpconnect/src/XPCWrappedJS.cpp +++ b/js/xpconnect/src/XPCWrappedJS.cpp @@ -82,8 +82,7 @@ NS_CYCLE_COLLECTION_CLASSNAME(nsXPCWrappedJS)::Traverse // nsXPCWrappedJS roots its mJSObj when its refcount is > 1, see // the comment above nsXPCWrappedJS::AddRef. NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mJSObj"); - cb.NoteScriptChild(nsIProgrammingLanguage::JAVASCRIPT, - tmp->GetJSObjectPreserveColor()); + cb.NoteJSChild(tmp->GetJSObjectPreserveColor()); } nsXPCWrappedJS* root = tmp->GetRootWrapper(); diff --git a/js/xpconnect/src/XPCWrappedNative.cpp b/js/xpconnect/src/XPCWrappedNative.cpp index 88e315936197..36e419aa04de 100644 --- a/js/xpconnect/src/XPCWrappedNative.cpp +++ b/js/xpconnect/src/XPCWrappedNative.cpp @@ -119,7 +119,7 @@ NS_CYCLE_COLLECTION_CLASSNAME(XPCWrappedNative)::Traverse(void *p, JSObject *obj = tmp->GetFlatJSObjectPreserveColor(); NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "mFlatJSObject"); - cb.NoteScriptChild(nsIProgrammingLanguage::JAVASCRIPT, obj); + cb.NoteJSChild(obj); } if (tmp->MightHaveExpandoObject()) { @@ -129,8 +129,7 @@ NS_CYCLE_COLLECTION_CLASSNAME(XPCWrappedNative)::Traverse(void *p, xpc::CompartmentPrivate *priv = (xpc::CompartmentPrivate *) JS_GetCompartmentPrivate(r.front()); NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "XPCWrappedNative expando object"); - cb.NoteScriptChild(nsIProgrammingLanguage::JAVASCRIPT, - priv->LookupExpandoObjectPreserveColor(tmp)); + cb.NoteJSChild(priv->LookupExpandoObjectPreserveColor(tmp)); } } diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp index 4cf980c6d386..844463065293 100644 --- a/js/xpconnect/src/nsXPConnect.cpp +++ b/js/xpconnect/src/nsXPConnect.cpp @@ -581,8 +581,12 @@ nsXPConnect::FinishTraverse() nsCycleCollectionParticipant * nsXPConnect::ToParticipant(void *p) { - if (!AddToCCKind(js_GetGCThingTraceKind(p))) - return NULL; + return this; +} + +nsCycleCollectionParticipant * +nsXPConnect::GetParticipant() +{ return this; } @@ -746,7 +750,7 @@ NoteJSChild(JSTracer *trc, void **thingp, JSGCTraceKind kind) } } #endif - tracer->cb.NoteScriptChild(nsIProgrammingLanguage::JAVASCRIPT, thing); + tracer->cb.NoteJSChild(thing); } else if (kind == JSTRACE_SHAPE) { JS_TraceShapeCycleCollectorChildren(trc, thing); } else if (kind != JSTRACE_STRING) { @@ -962,7 +966,7 @@ public: cb.DescribeRefCountedNode(refCount, js::SizeOfJSContext(), "JSContext"); if (JSObject *global = JS_GetGlobalObject(cx)) { NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(cb, "[global object]"); - cb.NoteScriptChild(nsIProgrammingLanguage::JAVASCRIPT, global); + cb.NoteJSChild(global); } return NS_OK; diff --git a/js/xpconnect/src/xpcprivate.h b/js/xpconnect/src/xpcprivate.h index 6b6337a2ac85..fb249af20e7a 100644 --- a/js/xpconnect/src/xpcprivate.h +++ b/js/xpconnect/src/xpcprivate.h @@ -478,6 +478,7 @@ public: virtual nsresult BeginCycleCollection(nsCycleCollectionTraversalCallback &cb); virtual nsresult FinishTraverse(); virtual nsCycleCollectionParticipant *ToParticipant(void *p); + virtual nsCycleCollectionParticipant *GetParticipant(); virtual bool NeedCollect(); virtual void Collect(PRUint32 reason, PRUint32 kind); diff --git a/xpcom/base/nsCycleCollector.cpp b/xpcom/base/nsCycleCollector.cpp index 7de0617ed901..4dabc73423ad 100644 --- a/xpcom/base/nsCycleCollector.cpp +++ b/xpcom/base/nsCycleCollector.cpp @@ -538,6 +538,7 @@ public: mLangID(aLangID) #endif { + MOZ_ASSERT(aParticipant); } #ifdef DEBUG_CC @@ -1671,12 +1672,14 @@ private: PLDHashTable mPtrToNodeMap; PtrInfo *mCurrPi; nsCycleCollectionLanguageRuntime **mRuntimes; // weak, from nsCycleCollector + nsCycleCollectionParticipant *mJSParticipant; nsCString mNextEdgeName; nsICycleCollectorListener *mListener; public: GCGraphBuilder(GCGraph &aGraph, nsCycleCollectionLanguageRuntime **aRuntimes, + nsCycleCollectionJSRuntime *aJSRuntime, nsICycleCollectorListener *aListener); ~GCGraphBuilder(); bool Initialized(); @@ -1720,10 +1723,12 @@ private: const char *objName); NS_IMETHOD_(void) NoteRoot(PRUint32 langID, void *child, nsCycleCollectionParticipant* participant); + NS_IMETHOD_(void) NoteXPCOMChild(nsISupports *child); + NS_IMETHOD_(void) NoteJSChild(void *child); NS_IMETHOD_(void) NoteNativeChild(void *child, nsCycleCollectionParticipant *participant); - NS_IMETHOD_(void) NoteScriptChild(PRUint32 langID, void *child); + NS_IMETHOD_(void) NoteNextEdgeName(const char* name); NS_IMETHOD_(void) NoteWeakMapping(void *map, void *key, void *val); private: @@ -1743,17 +1748,23 @@ private: GCGraphBuilder::GCGraphBuilder(GCGraph &aGraph, nsCycleCollectionLanguageRuntime **aRuntimes, + nsCycleCollectionJSRuntime *aJSRuntime, nsICycleCollectorListener *aListener) : mNodeBuilder(aGraph.mNodes), mEdgeBuilder(aGraph.mEdges), mWeakMaps(aGraph.mWeakMaps), mRuntimes(aRuntimes), + mJSParticipant(nsnull), mListener(aListener) { if (!PL_DHashTableInit(&mPtrToNodeMap, &PtrNodeOps, nsnull, sizeof(PtrToNodeEntry), 32768)) mPtrToNodeMap.ops = nsnull; + if (aJSRuntime) { + mJSParticipant = aJSRuntime->GetParticipant(); + } + PRUint32 flags = 0; #ifdef DEBUG_CC flags = nsCycleCollectionTraversalCallback::WANT_DEBUG_INFO | @@ -1945,36 +1956,22 @@ GCGraphBuilder::NoteNativeChild(void *child, } NS_IMETHODIMP_(void) -GCGraphBuilder::NoteScriptChild(PRUint32 langID, void *child) +GCGraphBuilder::NoteJSChild(void *child) { + if (!child) { + return; + } + nsCString edgeName; - if (WantDebugInfo()) { + if (NS_UNLIKELY(WantDebugInfo())) { edgeName.Assign(mNextEdgeName); mNextEdgeName.Truncate(); } - if (!child) - return; - if (langID > nsIProgrammingLanguage::MAX) { - Fault("traversing pointer for unknown language", child); - return; + if (xpc_GCThingIsGrayCCThing(child) || NS_UNLIKELY(WantAllTraces())) { + NoteChild(child, mJSParticipant, nsIProgrammingLanguage::JAVASCRIPT, + edgeName); } - - if (!mRuntimes[langID]) { - NS_WARNING("Not collecting cycles involving objects for scripting " - "languages that don't participate in cycle collection."); - return; - } - - // skip over non-grey JS children - if (langID == nsIProgrammingLanguage::JAVASCRIPT && - !xpc_GCThingIsGrayCCThing(child) && !WantAllTraces()) { - return; - } - - nsCycleCollectionParticipant *cp = mRuntimes[langID]->ToParticipant(child); - if (cp) - NoteChild(child, cp, langID, edgeName); } NS_IMETHODIMP_(void) @@ -1988,15 +1985,12 @@ GCGraphBuilder::NoteNextEdgeName(const char* name) PtrInfo* GCGraphBuilder::AddWeakMapNode(void *node) { - nsCycleCollectionParticipant *cp; NS_ASSERTION(node, "Weak map node should be non-null."); if (!xpc_GCThingIsGrayCCThing(node) && !WantAllTraces()) return nsnull; - cp = mRuntimes[nsIProgrammingLanguage::JAVASCRIPT]->ToParticipant(node); - NS_ASSERTION(cp, "Javascript runtime participant should be non-null."); - return AddNode(node, cp, nsIProgrammingLanguage::JAVASCRIPT); + return AddNode(node, mJSParticipant, nsIProgrammingLanguage::JAVASCRIPT); } NS_IMETHODIMP_(void) @@ -2025,7 +2019,7 @@ public: NS_IMETHOD_(void) NoteXPCOMChild(nsISupports *child); NS_IMETHOD_(void) NoteNativeChild(void *child, nsCycleCollectionParticipant *helper); - NS_IMETHOD_(void) NoteScriptChild(PRUint32 langID, void *child); + NS_IMETHOD_(void) NoteJSChild(void *child); NS_IMETHOD_(void) DescribeRefCountedNode(nsrefcnt refcount, size_t objsz, @@ -2065,15 +2059,11 @@ ChildFinder::NoteNativeChild(void *child, }; NS_IMETHODIMP_(void) -ChildFinder::NoteScriptChild(PRUint32 langID, void *child) +ChildFinder::NoteJSChild(void *child) { - if (!child) - return; - if (langID == nsIProgrammingLanguage::JAVASCRIPT && - !xpc_GCThingIsGrayCCThing(child)) { - return; + if (child && xpc_GCThingIsGrayCCThing(child)) { + mMayHaveChild = true; } - mMayHaveChild = true; }; static bool @@ -2726,7 +2716,7 @@ public: NS_IMETHOD_(void) NoteRoot(PRUint32 langID, void *root, nsCycleCollectionParticipant* participant) {}; NS_IMETHOD_(void) NoteXPCOMChild(nsISupports *child) {} - NS_IMETHOD_(void) NoteScriptChild(PRUint32 langID, void *child) {} + NS_IMETHOD_(void) NoteJSChild(void *child) {} NS_IMETHOD_(void) NoteNativeChild(void *child, nsCycleCollectionParticipant *participant) {} NS_IMETHOD_(void) NoteNextEdgeName(const char* name) {} @@ -3096,7 +3086,7 @@ nsCycleCollector::BeginCollection(nsICycleCollectorListener *aListener) if (mParams.mDoNothing) return false; - GCGraphBuilder builder(mGraph, mRuntimes, aListener); + GCGraphBuilder builder(mGraph, mRuntimes, mJSRuntime, aListener); if (!builder.Initialized()) return false; @@ -3254,7 +3244,7 @@ nsCycleCollector::Shutdown() Collect(nsnull, SHUTDOWN_COLLECTIONS(mParams), listener); #ifdef DEBUG_CC - GCGraphBuilder builder(mGraph, mRuntimes, nsnull); + GCGraphBuilder builder(mGraph, mRuntimes, mJSRuntime, nsnull); mScanInProgress = true; SelectPurple(builder); mScanInProgress = false; diff --git a/xpcom/base/nsCycleCollector.h b/xpcom/base/nsCycleCollector.h index e9982b396b2a..148c700d7c53 100644 --- a/xpcom/base/nsCycleCollector.h +++ b/xpcom/base/nsCycleCollector.h @@ -117,6 +117,11 @@ struct nsCycleCollectionJSRuntime : public nsCycleCollectionLanguageRuntime * |kind| is a nsGCType from nsIXPConnect.idl. */ virtual void Collect(PRUint32 reason, PRUint32 kind) = 0; + + /** + * Get the JS cycle collection participant. + */ + virtual nsCycleCollectionParticipant *GetParticipant() = 0; }; #ifdef DEBUG diff --git a/xpcom/glue/nsCycleCollectionParticipant.cpp b/xpcom/glue/nsCycleCollectionParticipant.cpp index f0be4042a63d..757ca6ca1519 100644 --- a/xpcom/glue/nsCycleCollectionParticipant.cpp +++ b/xpcom/glue/nsCycleCollectionParticipant.cpp @@ -39,13 +39,12 @@ #include "nsCOMPtr.h" static void -NoteChild(PRUint32 aLangID, void *aScriptThing, const char *name, - void *aClosure) +NoteChild(void *aScriptThing, const char *name, void *aClosure) { nsCycleCollectionTraversalCallback *cb = static_cast(aClosure); NS_CYCLE_COLLECTION_NOTE_EDGE_NAME(*cb, name); - cb->NoteScriptChild(aLangID, aScriptThing); + cb->NoteJSChild(aScriptThing); } void diff --git a/xpcom/glue/nsCycleCollectionParticipant.h b/xpcom/glue/nsCycleCollectionParticipant.h index bd56f7e9d285..5b1bdc446454 100644 --- a/xpcom/glue/nsCycleCollectionParticipant.h +++ b/xpcom/glue/nsCycleCollectionParticipant.h @@ -93,13 +93,14 @@ public: 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) NoteJSChild(void *child) = 0; NS_IMETHOD_(void) NoteNativeChild(void *child, nsCycleCollectionParticipant *helper) = 0; // Give a name to the edge associated with the next call to - // NoteScriptChild, NoteXPCOMChild, or NoteNativeChild. + // NoteXPCOMChild, NoteJSChild, or NoteNativeChild. // Callbacks who care about this should set WANT_DEBUG_INFO in the // flags. NS_IMETHOD_(void) NoteNextEdgeName(const char* name) = 0; @@ -192,7 +193,7 @@ NS_DEFINE_STATIC_IID_ACCESSOR(nsCycleCollectionParticipant, #define IMETHOD_VISIBILITY NS_COM_GLUE typedef void -(* TraceCallback)(PRUint32 langID, void *p, const char *name, void *closure); +(* TraceCallback)(void *p, const char *name, void *closure); class NS_NO_VTABLE nsScriptObjectTracer : public nsCycleCollectionParticipant { @@ -557,16 +558,9 @@ public: { \ _class *tmp = static_cast<_class*>(p); -#define NS_IMPL_CYCLE_COLLECTION_TRACE_CALLBACK(_langID, _object, _name) \ - if (_object) \ - aCallback(_langID, _object, _name, aClosure); - -#define NS_IMPL_CYCLE_COLLECTION_TRACE_MEMBER_CALLBACK(_langID, _field) \ - NS_IMPL_CYCLE_COLLECTION_TRACE_CALLBACK(_langID, tmp->_field, #_field) - #define NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(_object, _name) \ - NS_IMPL_CYCLE_COLLECTION_TRACE_CALLBACK(nsIProgrammingLanguage::JAVASCRIPT, \ - _object, _name) + if (_object) \ + aCallback(_object, _name, aClosure); #define NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(_field) \ NS_IMPL_CYCLE_COLLECTION_TRACE_JS_CALLBACK(tmp->_field, #_field)