Bug 1167452 - Set gcLastSweepGroupIndex earlier (debugging feature) r=jonco

Differential Revision: https://phabricator.services.mozilla.com/D31951

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Steve Fink 2019-05-30 20:32:22 +00:00
Родитель 1725af146a
Коммит 3cbd4b9112
3 изменённых файлов: 12 добавлений и 7 удалений

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

@ -5081,10 +5081,13 @@ void GCRuntime::groupZonesForSweeping(JS::GCReason reason) {
}
#ifdef DEBUG
unsigned idx = sweepGroupIndex;
for (Zone* head = currentSweepGroup; head; head = head->nextGroup()) {
for (Zone* zone = head; zone; zone = zone->nextNodeInGroup()) {
MOZ_ASSERT(zone->isGCMarking());
zone->gcSweepGroupIndex = idx;
}
idx++;
}
MOZ_ASSERT_IF(!isIncremental, !currentSweepGroup->nextGroup());
@ -5761,10 +5764,6 @@ IncrementalProgress GCRuntime::beginSweepingSweepGroup(FreeOp* fop,
if (zone->isAtomsZone()) {
sweepingAtoms = true;
}
#ifdef DEBUG
zone->gcLastSweepGroupIndex = sweepGroupIndex;
#endif
}
validateIncrementalMarking();
@ -7109,6 +7108,12 @@ void GCRuntime::incrementalSlice(SliceBudget& budget, JS::GCReason reason,
MOZ_ASSERT(!lastMarkSlice);
rootsRemoved = false;
#ifdef DEBUG
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
zone->gcSweepGroupIndex = 0;
}
#endif
incrementalState = State::MarkRoots;
MOZ_FALLTHROUGH;

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

@ -63,7 +63,7 @@ JS::Zone::Zone(JSRuntime* rt)
data(this, nullptr),
isSystem(this, false),
#ifdef DEBUG
gcLastSweepGroupIndex(0),
gcSweepGroupIndex(0),
#endif
jitZone_(this, nullptr),
gcScheduled_(false),

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

@ -301,7 +301,7 @@ class Zone : public JS::shadow::Zone,
// For testing purposes, return the index of the sweep group which this zone
// was swept in in the last GC.
unsigned lastSweepGroupIndex() { return gcLastSweepGroupIndex; }
unsigned lastSweepGroupIndex() { return gcSweepGroupIndex; }
#endif
void sweepBreakpoints(js::FreeOp* fop);
@ -625,7 +625,7 @@ class Zone : public JS::shadow::Zone,
js::ZoneData<bool> isSystem;
#ifdef DEBUG
js::MainThreadData<unsigned> gcLastSweepGroupIndex;
js::MainThreadData<unsigned> gcSweepGroupIndex;
#endif
static js::HashNumber UniqueIdToHash(uint64_t uid);