зеркало из https://github.com/mozilla/gecko-dev.git
Bug 986843 - Don't sweep empty zones if they contain marked compartments r=terrence
This commit is contained in:
Родитель
eedc9da1f1
Коммит
975a94a89e
|
@ -258,4 +258,12 @@ js::ZoneOfObjectFromAnyThread(const JSObject &obj)
|
|||
return obj.zoneFromAnyThread();
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
Zone::hasMarkedCompartments()
|
||||
{
|
||||
for (CompartmentsInZoneIter comp(this); !comp.done(); comp.next()) {
|
||||
if (comp->marked)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -317,6 +317,8 @@ struct Zone : public JS::shadow::Zone,
|
|||
|
||||
void sweep(js::FreeOp *fop, bool releaseTypes);
|
||||
|
||||
bool hasMarkedCompartments();
|
||||
|
||||
private:
|
||||
void sweepBreakpoints(js::FreeOp *fop);
|
||||
|
||||
|
|
|
@ -2864,7 +2864,9 @@ SweepZones(FreeOp *fop, bool lastGC)
|
|||
Zone *zone = *read++;
|
||||
|
||||
if (zone->wasGCStarted()) {
|
||||
if (zone->allocator.arenas.arenaListsAreEmpty() || lastGC) {
|
||||
if ((zone->allocator.arenas.arenaListsAreEmpty() && !zone->hasMarkedCompartments()) ||
|
||||
lastGC)
|
||||
{
|
||||
zone->allocator.arenas.checkEmptyFreeLists();
|
||||
if (callback)
|
||||
callback(zone);
|
||||
|
|
Загрузка…
Ссылка в новой задаче