Backed out 2 changesets (bug 1235598) for linux reftest bustage

Backed out changeset 3bcd3c276785 (bug 1235598)
Backed out changeset 80cd10a8b3d7 (bug 1235598)
This commit is contained in:
Wes Kocher 2015-12-31 15:51:13 -08:00
parent 7e19d432dd
commit ebd4da1151
19 changed files with 123 additions and 80 deletions

View File

@ -334,7 +334,9 @@ class ProtoAndIfaceCache
void Trace(JSTracer* aTracer) { void Trace(JSTracer* aTracer) {
for (size_t i = 0; i < ArrayLength(*this); ++i) { for (size_t i = 0; i < ArrayLength(*this); ++i) {
JS::TraceNullableEdge(aTracer, &(*this)[i], "protoAndIfaceCache[i]"); if ((*this)[i]) {
JS_CallObjectTracer(aTracer, &(*this)[i], "protoAndIfaceCache[i]");
}
} }
} }
@ -393,7 +395,9 @@ class ProtoAndIfaceCache
Page* p = mPages[i]; Page* p = mPages[i];
if (p) { if (p) {
for (size_t j = 0; j < ArrayLength(*p); ++j) { for (size_t j = 0; j < ArrayLength(*p); ++j) {
JS::TraceNullableEdge(trc, &(*p)[j], "protoAndIfaceCache[i]"); if ((*p)[j]) {
JS_CallObjectTracer(trc, &(*p)[j], "protoAndIfaceCache[i]");
}
} }
} }
} }

View File

@ -288,7 +288,9 @@ TraceJSObjWrappers(JSTracer *trc, void *data)
nsJSObjWrapperKey key = e.front().key(); nsJSObjWrapperKey key = e.front().key();
JS_CallUnbarrieredObjectTracer(trc, &key.mJSObj, "sJSObjWrappers key object"); JS_CallUnbarrieredObjectTracer(trc, &key.mJSObj, "sJSObjWrappers key object");
nsJSObjWrapper *wrapper = e.front().value(); nsJSObjWrapper *wrapper = e.front().value();
JS::TraceNullableEdge(trc, &wrapper->mJSObj, "sJSObjWrappers wrapper object"); if (wrapper->mJSObj) {
JS_CallObjectTracer(trc, &wrapper->mJSObj, "sJSObjWrappers wrapper object");
}
if (key != e.front().key()) { if (key != e.front().key()) {
e.rekeyFront(key); e.rekeyFront(key);
} }
@ -2258,16 +2260,21 @@ NPObjectMember_Trace(JSTracer *trc, JSObject *obj)
if (!memberPrivate) if (!memberPrivate)
return; return;
// Our NPIdentifier is not always interned, so we must trace it. // Our NPIdentifier is not always interned, so we must root it explicitly.
JS::TraceEdge(trc, &memberPrivate->methodName, "NPObjectMemberPrivate.methodName"); JS_CallIdTracer(trc, &memberPrivate->methodName, "NPObjectMemberPrivate.methodName");
JS::TraceEdge(trc, &memberPrivate->fieldValue, "NPObject Member => fieldValue"); if (!memberPrivate->fieldValue.isPrimitive()) {
JS_CallValueTracer(trc, &memberPrivate->fieldValue,
"NPObject Member => fieldValue");
}
// There's no strong reference from our private data to the // There's no strong reference from our private data to the
// NPObject, so make sure to mark the NPObject wrapper to keep the // NPObject, so make sure to mark the NPObject wrapper to keep the
// NPObject alive as long as this NPObjectMember is alive. // NPObject alive as long as this NPObjectMember is alive.
JS::TraceNullableEdge(trc, &memberPrivate->npobjWrapper, if (memberPrivate->npobjWrapper) {
JS_CallObjectTracer(trc, &memberPrivate->npobjWrapper,
"NPObject Member => npobjWrapper"); "NPObject Member => npobjWrapper");
}
} }
static bool static bool

View File

@ -559,8 +559,8 @@ public:
private: private:
virtual void trace(JSTracer* aTrc) virtual void trace(JSTracer* aTrc)
{ {
JS::TraceEdge(aTrc, &mStateData->mResponse, JS_CallValueTracer(aTrc, &mStateData->mResponse,
"XMLHttpRequest::StateData::mResponse"); "XMLHttpRequest::StateData::mResponse");
} }
}; };

View File

@ -249,7 +249,9 @@ public:
void TraceScriptObject(JSTracer* aTrc) void TraceScriptObject(JSTracer* aTrc)
{ {
JS::TraceNullableEdge(aTrc, &mScriptObject, "active window XUL prototype script"); if (mScriptObject) {
JS_CallScriptTracer(aTrc, &mScriptObject, "active window XUL prototype script");
}
} }
void Trace(const TraceCallbacks& aCallbacks, void* aClosure) void Trace(const TraceCallbacks& aCallbacks, void* aClosure)

View File

@ -630,7 +630,7 @@ static PLDHashOperator
MarkScriptsInGC(nsIURI* aKey, JS::Heap<JSScript*>& aScript, void* aClosure) MarkScriptsInGC(nsIURI* aKey, JS::Heap<JSScript*>& aScript, void* aClosure)
{ {
JSTracer* trc = static_cast<JSTracer*>(aClosure); JSTracer* trc = static_cast<JSTracer*>(aClosure);
JS::TraceEdge(trc, &aScript, "nsXULPrototypeCache script"); JS_CallScriptTracer(trc, &aScript, "nsXULPrototypeCache script");
return PL_DHASH_NEXT; return PL_DHASH_NEXT;
} }

View File

@ -35,8 +35,10 @@ IdToObjectMap::init()
void void
IdToObjectMap::trace(JSTracer* trc) IdToObjectMap::trace(JSTracer* trc)
{ {
for (Table::Range r(table_.all()); !r.empty(); r.popFront()) for (Table::Range r(table_.all()); !r.empty(); r.popFront()) {
JS::TraceEdge(trc, &r.front().value(), "ipc-object"); DebugOnly<JSObject*> prior = r.front().value().get();
JS_CallObjectTracer(trc, &r.front().value(), "ipc-object");
}
} }
void void

View File

@ -281,29 +281,40 @@ JSTracer::asCallbackTracer()
return static_cast<JS::CallbackTracer*>(this); return static_cast<JS::CallbackTracer*>(this);
} }
namespace JS { // The JS_Call*Tracer family of functions traces the given GC thing reference.
// This performs the tracing action configured on the given JSTracer:
// The JS::TraceEdge family of functions traces the given GC thing reference. // typically calling the JSTracer::callback or marking the thing as live.
// This performs the tracing action configured on the given JSTracer: typically
// calling the JSTracer::callback or marking the thing as live.
// //
// The argument to JS::TraceEdge is an in-out param: when the function returns, // The argument to JS_Call*Tracer is an in-out param: when the function
// the garbage collector might have moved the GC thing. In this case, the // returns, the garbage collector might have moved the GC thing. In this case,
// reference passed to JS::TraceEdge will be updated to the thing's new // the reference passed to JS_Call*Tracer will be updated to the object's new
// location. Callers of this method are responsible for updating any state that // location. Callers of this method are responsible for updating any state
// is dependent on the object's address. For example, if the object's address // that is dependent on the object's address. For example, if the object's
// is used as a key in a hashtable, then the object must be removed and // address is used as a key in a hashtable, then the object must be removed
// re-inserted with the correct hash. // and re-inserted with the correct hash.
//
extern JS_PUBLIC_API(void)
JS_CallValueTracer(JSTracer* trc, JS::Heap<JS::Value>* valuep, const char* name);
extern JS_PUBLIC_API(void)
JS_CallIdTracer(JSTracer* trc, JS::Heap<jsid>* idp, const char* name);
extern JS_PUBLIC_API(void)
JS_CallObjectTracer(JSTracer* trc, JS::Heap<JSObject*>* objp, const char* name);
extern JS_PUBLIC_API(void)
JS_CallStringTracer(JSTracer* trc, JS::Heap<JSString*>* strp, const char* name);
extern JS_PUBLIC_API(void)
JS_CallScriptTracer(JSTracer* trc, JS::Heap<JSScript*>* scriptp, const char* name);
extern JS_PUBLIC_API(void)
JS_CallFunctionTracer(JSTracer* trc, JS::Heap<JSFunction*>* funp, const char* name);
namespace JS {
template <typename T> template <typename T>
extern JS_PUBLIC_API(void) extern JS_PUBLIC_API(void)
TraceEdge(JSTracer* trc, JS::Heap<T>* edgep, const char* name); TraceEdge(JSTracer* trc, JS::Heap<T>* edgep, const char* name);
// As with JS::TraceEdge, but checks if *edgep is a nullptr before proceeding.
// Note that edgep itself must always be non-null.
template <typename T>
extern JS_PUBLIC_API(void)
TraceNullableEdge(JSTracer* trc, JS::Heap<T>* edgep, const char* name);
} // namespace JS } // namespace JS
// The following JS_CallUnbarriered*Tracer functions should only be called where // The following JS_CallUnbarriered*Tracer functions should only be called where

View File

@ -4106,10 +4106,10 @@ CType::Trace(JSTracer* trc, JSObject* obj)
MOZ_ASSERT(fninfo); MOZ_ASSERT(fninfo);
// Identify our objects to the tracer. // Identify our objects to the tracer.
JS::TraceEdge(trc, &fninfo->mABI, "abi"); JS_CallObjectTracer(trc, &fninfo->mABI, "abi");
JS::TraceEdge(trc, &fninfo->mReturnType, "returnType"); JS_CallObjectTracer(trc, &fninfo->mReturnType, "returnType");
for (size_t i = 0; i < fninfo->mArgTypes.length(); ++i) for (size_t i = 0; i < fninfo->mArgTypes.length(); ++i)
JS::TraceEdge(trc, &fninfo->mArgTypes[i], "argType"); JS_CallObjectTracer(trc, &fninfo->mArgTypes[i], "argType");
break; break;
} }
@ -6904,10 +6904,10 @@ CClosure::Trace(JSTracer* trc, JSObject* obj)
// Identify our objects to the tracer. (There's no need to identify // Identify our objects to the tracer. (There's no need to identify
// 'closureObj', since that's us.) // 'closureObj', since that's us.)
JS::TraceEdge(trc, &cinfo->typeObj, "typeObj"); JS_CallObjectTracer(trc, &cinfo->typeObj, "typeObj");
JS::TraceEdge(trc, &cinfo->jsfnObj, "jsfnObj"); JS_CallObjectTracer(trc, &cinfo->jsfnObj, "jsfnObj");
if (cinfo->thisObj) if (cinfo->thisObj)
JS::TraceEdge(trc, &cinfo->thisObj, "thisObj"); JS_CallObjectTracer(trc, &cinfo->thisObj, "thisObj");
} }
void void

View File

@ -231,7 +231,7 @@ struct FieldInfo
size_t mOffset; // offset of the field in the struct, in bytes size_t mOffset; // offset of the field in the struct, in bytes
void trace(JSTracer* trc) { void trace(JSTracer* trc) {
JS::TraceEdge(trc, &mType, "fieldType"); JS_CallObjectTracer(trc, &mType, "fieldType");
} }
}; };

View File

@ -405,15 +405,6 @@ JS::TraceEdge(JSTracer* trc, JS::Heap<T>* thingp, const char* name)
DispatchToTracer(trc, ConvertToBase(thingp->unsafeGet()), name); DispatchToTracer(trc, ConvertToBase(thingp->unsafeGet()), name);
} }
template <typename T>
JS_PUBLIC_API(void)
JS::TraceNullableEdge(JSTracer* trc, JS::Heap<T>* thingp, const char* name)
{
MOZ_ASSERT(thingp);
if (InternalGCMethods<T>::isMarkable(thingp->get()))
DispatchToTracer(trc, ConvertToBase(thingp->unsafeGet()), name);
}
template <typename T> template <typename T>
void void
js::TraceManuallyBarrieredEdge(JSTracer* trc, T* thingp, const char* name) js::TraceManuallyBarrieredEdge(JSTracer* trc, T* thingp, const char* name)
@ -492,6 +483,7 @@ js::TraceRootRange(JSTracer* trc, size_t len, T* vec, const char* name)
// Instantiate a copy of the Tracing templates for each derived type. // Instantiate a copy of the Tracing templates for each derived type.
#define INSTANTIATE_ALL_VALID_TRACE_FUNCTIONS(type) \ #define INSTANTIATE_ALL_VALID_TRACE_FUNCTIONS(type) \
template void js::TraceEdge<type>(JSTracer*, WriteBarrieredBase<type>*, const char*); \ template void js::TraceEdge<type>(JSTracer*, WriteBarrieredBase<type>*, const char*); \
template JS_PUBLIC_API(void) JS::TraceEdge<type>(JSTracer*, JS::Heap<type>*, const char*); \
template void js::TraceManuallyBarrieredEdge<type>(JSTracer*, type*, const char*); \ template void js::TraceManuallyBarrieredEdge<type>(JSTracer*, type*, const char*); \
template void js::TraceWeakEdge<type>(JSTracer*, WeakRef<type>*, const char*); \ template void js::TraceWeakEdge<type>(JSTracer*, WeakRef<type>*, const char*); \
template void js::TraceRoot<type>(JSTracer*, type*, const char*); \ template void js::TraceRoot<type>(JSTracer*, type*, const char*); \
@ -503,13 +495,6 @@ js::TraceRootRange(JSTracer* trc, size_t len, T* vec, const char* name)
FOR_EACH_GC_POINTER_TYPE(INSTANTIATE_ALL_VALID_TRACE_FUNCTIONS) FOR_EACH_GC_POINTER_TYPE(INSTANTIATE_ALL_VALID_TRACE_FUNCTIONS)
#undef INSTANTIATE_ALL_VALID_TRACE_FUNCTIONS #undef INSTANTIATE_ALL_VALID_TRACE_FUNCTIONS
#define INSTANTIATE_PUBLIC_TRACE_FUNCTIONS(type) \
template JS_PUBLIC_API(void) JS::TraceEdge<type>(JSTracer*, JS::Heap<type>*, const char*); \
template JS_PUBLIC_API(void) JS::TraceNullableEdge<type>(JSTracer*, JS::Heap<type>*, \
const char*);
FOR_EACH_PUBLIC_GC_POINTER_TYPE(INSTANTIATE_PUBLIC_TRACE_FUNCTIONS)
#undef INSTANTIATE_PUBLIC_TRACE_FUNCTIONS
template <typename T> template <typename T>
void void
js::TraceManuallyBarrieredCrossCompartmentEdge(JSTracer* trc, JSObject* src, T* dst, js::TraceManuallyBarrieredCrossCompartmentEdge(JSTracer* trc, JSObject* src, T* dst,

View File

@ -135,6 +135,42 @@ JS_CallUnbarrieredScriptTracer(JSTracer* trc, JSScript** scriptp, const char* na
TraceManuallyBarrieredEdge(trc, scriptp, name); TraceManuallyBarrieredEdge(trc, scriptp, name);
} }
JS_PUBLIC_API(void)
JS_CallValueTracer(JSTracer* trc, JS::Heap<JS::Value>* valuep, const char* name)
{
TraceManuallyBarrieredEdge(trc, valuep->unsafeGet(), name);
}
JS_PUBLIC_API(void)
JS_CallIdTracer(JSTracer* trc, JS::Heap<jsid>* idp, const char* name)
{
TraceManuallyBarrieredEdge(trc, idp->unsafeGet(), name);
}
JS_PUBLIC_API(void)
JS_CallObjectTracer(JSTracer* trc, JS::Heap<JSObject*>* objp, const char* name)
{
TraceManuallyBarrieredEdge(trc, objp->unsafeGet(), name);
}
JS_PUBLIC_API(void)
JS_CallStringTracer(JSTracer* trc, JS::Heap<JSString*>* strp, const char* name)
{
TraceManuallyBarrieredEdge(trc, strp->unsafeGet(), name);
}
JS_PUBLIC_API(void)
JS_CallScriptTracer(JSTracer* trc, JS::Heap<JSScript*>* scriptp, const char* name)
{
TraceManuallyBarrieredEdge(trc, scriptp->unsafeGet(), name);
}
JS_PUBLIC_API(void)
JS_CallFunctionTracer(JSTracer* trc, JS::Heap<JSFunction*>* funp, const char* name)
{
TraceManuallyBarrieredEdge(trc, funp->unsafeGet(), name);
}
JS_PUBLIC_API(void) JS_PUBLIC_API(void)
JS_CallTenuredObjectTracer(JSTracer* trc, JS::TenuredHeap<JSObject*>* objp, const char* name) JS_CallTenuredObjectTracer(JSTracer* trc, JS::TenuredHeap<JSObject*>* objp, const char* name)
{ {

View File

@ -1072,7 +1072,7 @@ JS::ObjectPtr::updateWeakPointerAfterGC()
void void
JS::ObjectPtr::trace(JSTracer* trc, const char* name) JS::ObjectPtr::trace(JSTracer* trc, const char* name)
{ {
JS::TraceEdge(trc, &value, name); JS_CallObjectTracer(trc, &value, name);
} }
JS_FRIEND_API(JSObject*) JS_FRIEND_API(JSObject*)

View File

@ -51,20 +51,8 @@ enum State {
COMPACT COMPACT
}; };
// Expand the given macro D for each publicly exposed GC reference type.
#define FOR_EACH_PUBLIC_GC_POINTER_TYPE(D) \
D(JS::Symbol*) \
D(JSAtom*) \
D(JSFunction*) \
D(JSObject*) \
D(JSScript*) \
D(JSString*) \
D(JS::Value) \
D(jsid)
// Expand the given macro D for each valid GC reference type. // Expand the given macro D for each valid GC reference type.
#define FOR_EACH_GC_POINTER_TYPE(D) \ #define FOR_EACH_GC_POINTER_TYPE(D) \
FOR_EACH_PUBLIC_GC_POINTER_TYPE(D) \
D(AccessorShape*) \ D(AccessorShape*) \
D(BaseShape*) \ D(BaseShape*) \
D(UnownedBaseShape*) \ D(UnownedBaseShape*) \
@ -77,6 +65,8 @@ enum State {
D(ArrayBufferViewObject*) \ D(ArrayBufferViewObject*) \
D(DebugScopeObject*) \ D(DebugScopeObject*) \
D(GlobalObject*) \ D(GlobalObject*) \
D(JSObject*) \
D(JSFunction*) \
D(ModuleObject*) \ D(ModuleObject*) \
D(ModuleEnvironmentObject*) \ D(ModuleEnvironmentObject*) \
D(ModuleNamespaceObject*) \ D(ModuleNamespaceObject*) \
@ -88,12 +78,18 @@ enum State {
D(SharedArrayBufferObject*) \ D(SharedArrayBufferObject*) \
D(ImportEntryObject*) \ D(ImportEntryObject*) \
D(ExportEntryObject*) \ D(ExportEntryObject*) \
D(JSScript*) \
D(LazyScript*) \ D(LazyScript*) \
D(Shape*) \ D(Shape*) \
D(JSAtom*) \
D(JSString*) \
D(JSFlatString*) \ D(JSFlatString*) \
D(JSLinearString*) \ D(JSLinearString*) \
D(PropertyName*) \ D(PropertyName*) \
D(JS::Symbol*) \
D(js::ObjectGroup*) \ D(js::ObjectGroup*) \
D(Value) \
D(jsid) \
D(TaggedProto) D(TaggedProto)
/* Map from C++ type to alloc kind. JSObject does not have a 1:1 mapping, so must use Arena::thingSize. */ /* Map from C++ type to alloc kind. JSObject does not have a 1:1 mapping, so must use Arena::thingSize. */

View File

@ -66,7 +66,7 @@ XPCTraceableVariant::~XPCTraceableVariant()
void XPCTraceableVariant::TraceJS(JSTracer* trc) void XPCTraceableVariant::TraceJS(JSTracer* trc)
{ {
MOZ_ASSERT(mJSVal.isMarkable()); MOZ_ASSERT(mJSVal.isMarkable());
JS::TraceEdge(trc, &mJSVal, "XPCTraceableVariant::mJSVal"); JS_CallValueTracer(trc, &mJSVal, "XPCTraceableVariant::mJSVal");
} }
NS_IMPL_CYCLE_COLLECTION_CLASS(XPCVariant) NS_IMPL_CYCLE_COLLECTION_CLASS(XPCVariant)

View File

@ -291,7 +291,7 @@ void
nsXPCWrappedJS::TraceJS(JSTracer* trc) nsXPCWrappedJS::TraceJS(JSTracer* trc)
{ {
MOZ_ASSERT(mRefCnt >= 2 && IsValid(), "must be strongly referenced"); MOZ_ASSERT(mRefCnt >= 2 && IsValid(), "must be strongly referenced");
JS::TraceEdge(trc, &mJSObj, "nsXPCWrappedJS::mJSObj"); JS_CallObjectTracer(trc, &mJSObj, "nsXPCWrappedJS::mJSObj");
} }
NS_IMETHODIMP NS_IMETHODIMP

View File

@ -2360,5 +2360,5 @@ XPCJSObjectHolder::~XPCJSObjectHolder()
void void
XPCJSObjectHolder::TraceJS(JSTracer* trc) XPCJSObjectHolder::TraceJS(JSTracer* trc)
{ {
JS::TraceEdge(trc, &mJSObj, "XPCJSObjectHolder::mJSObj"); JS_CallObjectTracer(trc, &mJSObj, "XPCJSObjectHolder::mJSObj");
} }

View File

@ -467,7 +467,7 @@ XPCWrappedNativeScope::~XPCWrappedNativeScope()
void void
XPCWrappedNativeScope::TraceWrappedNativesInAllScopes(JSTracer* trc, XPCJSRuntime* rt) XPCWrappedNativeScope::TraceWrappedNativesInAllScopes(JSTracer* trc, XPCJSRuntime* rt)
{ {
// Do JS::TraceEdge for all wrapped natives with external references, as // Do JS_CallTracer for all wrapped natives with external references, as
// well as any DOM expando objects. // well as any DOM expando objects.
for (XPCWrappedNativeScope* cur = gScopes; cur; cur = cur->mNext) { for (XPCWrappedNativeScope* cur = gScopes; cur; cur = cur->mNext) {
for (auto i = cur->mWrappedNativeMap->Iter(); !i.Done(); i.Next()) { for (auto i = cur->mWrappedNativeMap->Iter(); !i.Done(); i.Next()) {
@ -479,7 +479,7 @@ XPCWrappedNativeScope::TraceWrappedNativesInAllScopes(JSTracer* trc, XPCJSRuntim
if (cur->mDOMExpandoSet) { if (cur->mDOMExpandoSet) {
for (DOMExpandoSet::Enum e(*cur->mDOMExpandoSet); !e.empty(); e.popFront()) for (DOMExpandoSet::Enum e(*cur->mDOMExpandoSet); !e.empty(); e.popFront())
JS::TraceEdge(trc, &e.mutableFront(), "DOM expando object"); JS_CallObjectTracer(trc, &e.mutableFront(), "DOM expando object");
} }
} }
} }

View File

@ -781,17 +781,17 @@ struct JsGcTracer : public TraceCallbacks
virtual void Trace(JS::Heap<JS::Value>* aPtr, const char* aName, virtual void Trace(JS::Heap<JS::Value>* aPtr, const char* aName,
void* aClosure) const override void* aClosure) const override
{ {
JS::TraceEdge(static_cast<JSTracer*>(aClosure), aPtr, aName); JS_CallValueTracer(static_cast<JSTracer*>(aClosure), aPtr, aName);
} }
virtual void Trace(JS::Heap<jsid>* aPtr, const char* aName, virtual void Trace(JS::Heap<jsid>* aPtr, const char* aName,
void* aClosure) const override void* aClosure) const override
{ {
JS::TraceEdge(static_cast<JSTracer*>(aClosure), aPtr, aName); JS_CallIdTracer(static_cast<JSTracer*>(aClosure), aPtr, aName);
} }
virtual void Trace(JS::Heap<JSObject*>* aPtr, const char* aName, virtual void Trace(JS::Heap<JSObject*>* aPtr, const char* aName,
void* aClosure) const override void* aClosure) const override
{ {
JS::TraceEdge(static_cast<JSTracer*>(aClosure), aPtr, aName); JS_CallObjectTracer(static_cast<JSTracer*>(aClosure), aPtr, aName);
} }
virtual void Trace(JSObject** aPtr, const char* aName, virtual void Trace(JSObject** aPtr, const char* aName,
void* aClosure) const override void* aClosure) const override
@ -806,17 +806,17 @@ struct JsGcTracer : public TraceCallbacks
virtual void Trace(JS::Heap<JSString*>* aPtr, const char* aName, virtual void Trace(JS::Heap<JSString*>* aPtr, const char* aName,
void* aClosure) const override void* aClosure) const override
{ {
JS::TraceEdge(static_cast<JSTracer*>(aClosure), aPtr, aName); JS_CallStringTracer(static_cast<JSTracer*>(aClosure), aPtr, aName);
} }
virtual void Trace(JS::Heap<JSScript*>* aPtr, const char* aName, virtual void Trace(JS::Heap<JSScript*>* aPtr, const char* aName,
void* aClosure) const override void* aClosure) const override
{ {
JS::TraceEdge(static_cast<JSTracer*>(aClosure), aPtr, aName); JS_CallScriptTracer(static_cast<JSTracer*>(aClosure), aPtr, aName);
} }
virtual void Trace(JS::Heap<JSFunction*>* aPtr, const char* aName, virtual void Trace(JS::Heap<JSFunction*>* aPtr, const char* aName,
void* aClosure) const override void* aClosure) const override
{ {
JS::TraceEdge(static_cast<JSTracer*>(aClosure), aPtr, aName); JS_CallFunctionTracer(static_cast<JSTracer*>(aClosure), aPtr, aName);
} }
}; };

View File

@ -28,7 +28,7 @@ TraceArray(JSTracer* trc, void* data)
{ {
ArrayT* array = static_cast<ArrayT *>(data); ArrayT* array = static_cast<ArrayT *>(data);
for (unsigned i = 0; i < array->Length(); ++i) for (unsigned i = 0; i < array->Length(); ++i)
JS::TraceEdge(trc, &array->ElementAt(i), "array-element"); JS_CallObjectTracer(trc, &array->ElementAt(i), "array-element");
} }
/* /*