mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 03:45:46 +00:00
Bug 712735 - Don't add JS holders with no gray children as XPConnect roots. r=smaug
This commit is contained in:
parent
49f0480bcd
commit
76cceac62b
@ -449,9 +449,15 @@ CheckParticipatesInCycleCollection(PRUint32 aLangID, void *aThing,
|
||||
{
|
||||
Closure *closure = static_cast<Closure*>(aClosure);
|
||||
|
||||
closure->cycleCollectionEnabled =
|
||||
aLangID == nsIProgrammingLanguage::JAVASCRIPT &&
|
||||
AddToCCKind(js_GetGCThingTraceKind(aThing));
|
||||
if (closure->cycleCollectionEnabled)
|
||||
return;
|
||||
|
||||
if (aLangID == nsIProgrammingLanguage::JAVASCRIPT &&
|
||||
AddToCCKind(js_GetGCThingTraceKind(aThing)) &&
|
||||
xpc_IsGrayGCThing(aThing))
|
||||
{
|
||||
closure->cycleCollectionEnabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
static JSDHashOperator
|
||||
@ -461,6 +467,7 @@ NoteJSHolder(JSDHashTable *table, JSDHashEntryHdr *hdr, uint32_t number,
|
||||
ObjectHolder* entry = reinterpret_cast<ObjectHolder*>(hdr);
|
||||
Closure *closure = static_cast<Closure*>(arg);
|
||||
|
||||
closure->cycleCollectionEnabled = false;
|
||||
entry->tracer->Trace(entry->holder, CheckParticipatesInCycleCollection,
|
||||
closure);
|
||||
if (!closure->cycleCollectionEnabled)
|
||||
|
Loading…
Reference in New Issue
Block a user