Bug 994413 - Make Gecko use the same value marking semantics as SpiderMonkey; r=jonco,mccr8

This commit is contained in:
Terrence Cole 2014-04-09 12:42:48 -07:00
Родитель fa9338fee5
Коммит 6f2d911fe4
4 изменённых файлов: 10 добавлений и 10 удалений

Просмотреть файл

@ -507,9 +507,7 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(Console)
}
for (uint32_t i = 0; i < data->mArguments.Length(); ++i) {
if (JSVAL_IS_TRACEABLE(data->mArguments[i])) {
aCallbacks.Trace(&data->mArguments[i], "data->mArguments[i]", aClosure);
}
aCallbacks.Trace(&data->mArguments[i], "data->mArguments[i]", aClosure);
}
}

Просмотреть файл

@ -2411,9 +2411,11 @@ public:
virtual void Trace(JS::Heap<JS::Value>* aValue, const char* aName,
void* aClosure) const
{
void* thing = JSVAL_TO_TRACEABLE(aValue->get());
if (thing && xpc_GCThingIsGrayCCThing(thing)) {
mCollector->GetJSPurpleBuffer()->mValues.AppendElement(*aValue);
if (aValue->isMarkable()) {
void* thing = aValue->toGCThing();
if (thing && xpc_GCThingIsGrayCCThing(thing)) {
mCollector->GetJSPurpleBuffer()->mValues.AppendElement(*aValue);
}
}
}

Просмотреть файл

@ -69,7 +69,9 @@ CycleCollectionNoteEdgeNameImpl(nsCycleCollectionTraversalCallback& aCallback,
void
TraceCallbackFunc::Trace(JS::Heap<JS::Value>* p, const char* name, void* closure) const
{
mCallback(JSVAL_TO_TRACEABLE(p->get()), name, closure);
if (p->isMarkable()) {
mCallback(p->toGCThing(), name, closure);
}
}
void

Просмотреть файл

@ -429,9 +429,7 @@ T* DowncastCCParticipant(void *p)
aCallbacks.Trace(&tmp->_field, #_field, aClosure);
#define NS_IMPL_CYCLE_COLLECTION_TRACE_JSVAL_MEMBER_CALLBACK(_field) \
if (JSVAL_IS_TRACEABLE(tmp->_field)) { \
aCallbacks.Trace(&tmp->_field, #_field, aClosure); \
}
aCallbacks.Trace(&tmp->_field, #_field, aClosure);
// NB: The (void)tmp; hack in the TRACE_END macro exists to support
// implementations that don't need to do anything in their Trace method.