Backout Bug 1235598 Part 2 because of merge bustage on a CLOSED TREE

This commit is contained in:
Terrence Cole 2015-12-30 15:05:24 -08:00
parent 90dc49a329
commit e2ccf2b5df
13 changed files with 41 additions and 26 deletions

View File

@ -258,7 +258,7 @@ protected:
void TraceWrapper(JSTracer* aTrc, const char* name)
{
if (mWrapper) {
js::UnsafeTraceManuallyBarrieredEdge(aTrc, &mWrapper, name);
JS_CallUnbarrieredObjectTracer(aTrc, &mWrapper, name);
}
}

View File

@ -334,7 +334,9 @@ class ProtoAndIfaceCache
void Trace(JSTracer* aTracer) {
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];
if (p) {
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();
JS_CallUnbarrieredObjectTracer(trc, &key.mJSObj, "sJSObjWrappers key object");
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()) {
e.rekeyFront(key);
}
@ -2258,16 +2260,21 @@ NPObjectMember_Trace(JSTracer *trc, JSObject *obj)
if (!memberPrivate)
return;
// Our NPIdentifier is not always interned, so we must trace it.
JS::TraceEdge(trc, &memberPrivate->methodName, "NPObjectMemberPrivate.methodName");
// Our NPIdentifier is not always interned, so we must root it explicitly.
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
// NPObject, so make sure to mark the NPObject wrapper to keep the
// 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");
}
}
static bool

View File

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

View File

@ -249,7 +249,9 @@ public:
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)

View File

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

View File

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

View File

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

View File

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

View File

@ -2360,5 +2360,5 @@ XPCJSObjectHolder::~XPCJSObjectHolder()
void
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
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.
for (XPCWrappedNativeScope* cur = gScopes; cur; cur = cur->mNext) {
for (auto i = cur->mWrappedNativeMap->Iter(); !i.Done(); i.Next()) {
@ -479,7 +479,7 @@ XPCWrappedNativeScope::TraceWrappedNativesInAllScopes(JSTracer* trc, XPCJSRuntim
if (cur->mDOMExpandoSet) {
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,
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,
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,
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,
void* aClosure) const override
@ -806,17 +806,17 @@ struct JsGcTracer : public TraceCallbacks
virtual void Trace(JS::Heap<JSString*>* aPtr, const char* aName,
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,
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,
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);
for (unsigned i = 0; i < array->Length(); ++i)
JS::TraceEdge(trc, &array->ElementAt(i), "array-element");
JS_CallObjectTracer(trc, &array->ElementAt(i), "array-element");
}
/*