Bug 1199843 - Part 3: Strongly type JS::TraceChildren; r=jonco r=mccr8

This commit is contained in:
Terrence Cole 2015-09-02 11:34:36 -07:00
parent c50ed22fdf
commit e6825e10a2
4 changed files with 10 additions and 10 deletions

View File

@ -338,13 +338,13 @@ JS_CallHashSetObjectTracer(JSTracer* trc, HashSetEnum& e, JSObject* const& key,
extern JS_PUBLIC_API(void)
JS_CallTenuredObjectTracer(JSTracer* trc, JS::TenuredHeap<JSObject*>* objp, const char* name);
extern JS_PUBLIC_API(void)
JS_TraceChildren(JSTracer* trc, void* thing, JS::TraceKind kind);
extern JS_PUBLIC_API(void)
JS_TraceRuntime(JSTracer* trc);
namespace JS {
extern JS_PUBLIC_API(void)
TraceChildren(JSTracer* trc, GCCellPtr thing);
typedef js::HashSet<Zone*, js::DefaultHasher<Zone*>, js::SystemAllocPolicy> ZoneSet;
} // namespace JS

View File

@ -176,9 +176,9 @@ JS_CallTenuredObjectTracer(JSTracer* trc, JS::TenuredHeap<JSObject*>* objp, cons
}
JS_PUBLIC_API(void)
JS_TraceChildren(JSTracer* trc, void* thing, JS::TraceKind kind)
JS::TraceChildren(JSTracer* trc, GCCellPtr thing)
{
js::TraceChildren(trc, thing, kind);
js::TraceChildren(trc, thing.asCell(), thing.kind());
}
struct TraceChildrenFunctor {

View File

@ -372,7 +372,7 @@ CreateGlobalObject(JSContext* cx, const JSClass* clasp, nsIPrincipal* principal,
if (!((const js::Class*)clasp)->ext.isWrappedNative)
{
VerifyTraceProtoAndIfaceCacheCalledTracer trc(JS_GetRuntime(cx));
JS_TraceChildren(&trc, global, JS::TraceKind::Object);
TraceChildren(&trc, GCCellPtr(global.get()));
MOZ_ASSERT(trc.ok, "Trace hook on global needs to call TraceXPCGlobal for XPConnect compartments.");
}
#endif

View File

@ -148,7 +148,7 @@ NoteWeakMapChildrenTracer::onChild(const JS::GCCellPtr& aThing)
mCb.NoteWeakMapping(mMap, mKey, mKeyDelegate, aThing);
mTracedAny = true;
} else {
JS_TraceChildren(this, aThing.asCell(), aThing.kind());
JS::TraceChildren(this, aThing);
}
}
@ -203,7 +203,7 @@ NoteWeakMapsTracer::trace(JSObject* aMap, JS::GCCellPtr aKey,
mChildTracer.mKeyDelegate = kdelegate;
if (aValue.is<JSString>()) {
JS_TraceChildren(&mChildTracer, aValue.asCell(), aValue.kind());
JS::TraceChildren(&mChildTracer, aValue);
}
// The delegate could hold alive the key, so report something to the CC
@ -360,7 +360,7 @@ TraversalTracer::onChild(const JS::GCCellPtr& aThing)
// be traced.
JS_TraceObjectGroupCycleCollectorChildren(this, aThing);
} else if (!aThing.is<JSString>()) {
JS_TraceChildren(this, aThing.asCell(), aThing.kind());
JS::TraceChildren(this, aThing);
}
}
@ -542,7 +542,7 @@ CycleCollectedJSRuntime::NoteGCThingJSChildren(JS::GCCellPtr aThing,
{
MOZ_ASSERT(mJSRuntime);
TraversalTracer trc(mJSRuntime, aCb);
JS_TraceChildren(&trc, aThing.asCell(), aThing.kind());
JS::TraceChildren(&trc, aThing);
}
void