зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 818e0d0ecbcc (bug 1254108) for performance regression on splay
This commit is contained in:
Родитель
f4a281c4a0
Коммит
6f6aece93c
|
@ -947,7 +947,6 @@ class GCRuntime
|
|||
IncrementalProgress sweepPhase(SliceBudget& sliceBudget);
|
||||
void endSweepPhase(bool lastGC);
|
||||
void sweepZones(FreeOp* fop, bool lastGC);
|
||||
void endFinalizePhase(bool destroyingRuntime);
|
||||
void decommitAllWithoutUnlocking(const AutoLockGC& lock);
|
||||
void decommitArenas(AutoLockGC& lock);
|
||||
void expireChunksAndArenas(bool shouldShrink, AutoLockGC& lock);
|
||||
|
|
|
@ -35,7 +35,7 @@ class ZoneHeapThreshold
|
|||
double gcHeapGrowthFactor_;
|
||||
|
||||
// GC trigger threshold for allocations on the GC heap.
|
||||
size_t gcTriggerBytes_;
|
||||
mozilla::Atomic<size_t, mozilla::Relaxed> gcTriggerBytes_;
|
||||
|
||||
public:
|
||||
ZoneHeapThreshold()
|
||||
|
@ -50,6 +50,7 @@ class ZoneHeapThreshold
|
|||
void updateAfterGC(size_t lastBytes, JSGCInvocationKind gckind,
|
||||
const GCSchedulingTunables& tunables, const GCSchedulingState& state,
|
||||
const AutoLockGC& lock);
|
||||
void updateForRemovedArena(const GCSchedulingTunables& tunables);
|
||||
|
||||
private:
|
||||
static double computeZoneHeapGrowthFactorForHeapSize(size_t lastBytes,
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
function testChangeParam(key) {
|
||||
gcparam(key, 0x22222222);
|
||||
}
|
||||
testChangeParam("lowFrequencyHeapGrowth");
|
|
@ -1097,6 +1097,8 @@ void
|
|||
GCRuntime::releaseArena(Arena* arena, const AutoLockGC& lock)
|
||||
{
|
||||
arena->zone->usage.removeGCArena();
|
||||
if (isBackgroundSweeping())
|
||||
arena->zone->threshold.updateForRemovedArena(tunables);
|
||||
return arena->chunk()->releaseArena(rt, arena, lock);
|
||||
}
|
||||
|
||||
|
@ -1913,6 +1915,20 @@ ZoneHeapThreshold::updateAfterGC(size_t lastBytes, JSGCInvocationKind gckind,
|
|||
lock);
|
||||
}
|
||||
|
||||
void
|
||||
ZoneHeapThreshold::updateForRemovedArena(const GCSchedulingTunables& tunables)
|
||||
{
|
||||
size_t amount = ArenaSize * gcHeapGrowthFactor_;
|
||||
|
||||
MOZ_ASSERT(amount > 0);
|
||||
MOZ_ASSERT(gcTriggerBytes_ >= amount);
|
||||
|
||||
if (gcTriggerBytes_ - amount < tunables.gcZoneAllocThresholdBase() * gcHeapGrowthFactor_)
|
||||
return;
|
||||
|
||||
gcTriggerBytes_ -= amount;
|
||||
}
|
||||
|
||||
void
|
||||
GCMarker::delayMarkingArena(Arena* arena)
|
||||
{
|
||||
|
@ -5628,26 +5644,6 @@ GCRuntime::endSweepPhase(bool destroyingRuntime)
|
|||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
GCRuntime::endFinalizePhase(bool destroyingRuntime)
|
||||
{
|
||||
// Now that background finalization is finished, sweep the zones list to
|
||||
// remove and free dead zones.
|
||||
gcstats::AutoPhase ap1(stats, gcstats::PHASE_SWEEP);
|
||||
gcstats::AutoPhase ap2(stats, gcstats::PHASE_DESTROY);
|
||||
AutoSetThreadIsSweeping threadIsSweeping;
|
||||
FreeOp fop(rt);
|
||||
sweepZones(&fop, destroyingRuntime);
|
||||
|
||||
// Then update GC trigger thresholds a second time.
|
||||
AutoLockGC lock(rt);
|
||||
for (GCZoneGroupIter zone(rt); !zone.done(); zone.next()) {
|
||||
MOZ_ASSERT(zone->isGCFinished());
|
||||
zone->threshold.updateAfterGC(zone->usage.gcBytes(), invocationKind, tunables,
|
||||
schedulingState, lock);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
GCRuntime::beginCompactPhase()
|
||||
{
|
||||
|
@ -6128,7 +6124,15 @@ GCRuntime::incrementalCollectSlice(SliceBudget& budget, JS::gcreason::Reason rea
|
|||
}
|
||||
}
|
||||
|
||||
endFinalizePhase(destroyingRuntime);
|
||||
{
|
||||
// Re-sweep the zones list, now that background finalization is
|
||||
// finished to actually remove and free dead zones.
|
||||
gcstats::AutoPhase ap1(stats, gcstats::PHASE_SWEEP);
|
||||
gcstats::AutoPhase ap2(stats, gcstats::PHASE_DESTROY);
|
||||
AutoSetThreadIsSweeping threadIsSweeping;
|
||||
FreeOp fop(rt);
|
||||
sweepZones(&fop, destroyingRuntime);
|
||||
}
|
||||
|
||||
MOZ_ASSERT(!startedCompacting);
|
||||
incrementalState = COMPACT;
|
||||
|
|
Загрузка…
Ссылка в новой задаче