зеркало из https://github.com/mozilla/gecko-dev.git
Bug 994281. r=sfink
This commit is contained in:
Родитель
0a5ff4e2a2
Коммит
ffcd94e572
|
@ -356,19 +356,24 @@ IsAboutToBeFinalized(T **thingp)
|
|||
JS_ASSERT(thingp);
|
||||
JS_ASSERT(*thingp);
|
||||
|
||||
T *thing = *thingp;
|
||||
JSRuntime *rt = thing->runtimeFromAnyThread();
|
||||
|
||||
/* Permanent atoms are never finalized by non-owning runtimes. */
|
||||
if (ThingIsPermanentAtom(*thingp) &&
|
||||
!TlsPerThreadData.get()->associatedWith((*thingp)->runtimeFromAnyThread()))
|
||||
{
|
||||
if (ThingIsPermanentAtom(thing) && !TlsPerThreadData.get()->associatedWith(rt))
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef JSGC_GENERATIONAL
|
||||
Nursery &nursery = (*thingp)->runtimeFromMainThread()->gcNursery;
|
||||
if (nursery.isInside(*thingp))
|
||||
return !nursery.getForwardedPointer(thingp);
|
||||
Nursery &nursery = rt->gcNursery;
|
||||
JS_ASSERT_IF(!rt->isHeapMinorCollecting(), !nursery.isInside(thing));
|
||||
if (rt->isHeapMinorCollecting()) {
|
||||
if (nursery.isInside(thing))
|
||||
return !nursery.getForwardedPointer(thingp);
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
if (!(*thingp)->tenuredZone()->isGCSweeping())
|
||||
|
||||
if (!thing->tenuredZone()->isGCSweeping())
|
||||
return false;
|
||||
|
||||
/*
|
||||
|
@ -378,10 +383,9 @@ IsAboutToBeFinalized(T **thingp)
|
|||
* compartment group and during minor gc. Rather than do the extra check,
|
||||
* we just assert that it's not necessary.
|
||||
*/
|
||||
JS_ASSERT_IF(!(*thingp)->runtimeFromAnyThread()->isHeapMinorCollecting(),
|
||||
!(*thingp)->arenaHeader()->allocatedDuringIncremental);
|
||||
JS_ASSERT_IF(!rt->isHeapMinorCollecting(), !thing->arenaHeader()->allocatedDuringIncremental);
|
||||
|
||||
return !(*thingp)->isMarked();
|
||||
return !thing->isMarked();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
|
Загрузка…
Ссылка в новой задаче