mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-27 12:15:33 +00:00
Bug 1405980 - Dump debugging information if zones are not scheduled as expected r=sfink
This commit is contained in:
parent
30598ec65d
commit
3d3f30bbe6
@ -6975,6 +6975,31 @@ gc::IsIncrementalGCUnsafe(JSRuntime* rt)
|
||||
return gc::AbortReason::None;
|
||||
}
|
||||
|
||||
static inline void
|
||||
CheckZoneIsScheduled(Zone* zone, JS::gcreason::Reason reason, const char* trigger)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
if (zone->isGCScheduled())
|
||||
return;
|
||||
|
||||
fprintf(stderr,
|
||||
"CheckZoneIsScheduled: Zone %p not scheduled as expected in %s GC for %s trigger\n",
|
||||
zone,
|
||||
JS::gcreason::ExplainReason(reason),
|
||||
trigger);
|
||||
JSRuntime* rt = zone->runtimeFromActiveCooperatingThread();
|
||||
for (ZonesIter zone(rt, WithAtoms); !zone.done(); zone.next()) {
|
||||
fprintf(stderr,
|
||||
" Zone %p:%s%s\n",
|
||||
zone.get(),
|
||||
zone->isAtomsZone() ? " atoms" : "",
|
||||
zone->isGCScheduled() ? " scheduled" : "");
|
||||
}
|
||||
fflush(stderr);
|
||||
MOZ_CRASH("Zone not scheduled");
|
||||
#endif
|
||||
}
|
||||
|
||||
GCRuntime::IncrementalResult
|
||||
GCRuntime::budgetIncrementalGC(bool nonincrementalByAPI, JS::gcreason::Reason reason,
|
||||
SliceBudget& budget, AutoLockForExclusiveAccess& lock)
|
||||
@ -7024,13 +7049,13 @@ GCRuntime::budgetIncrementalGC(bool nonincrementalByAPI, JS::gcreason::Reason re
|
||||
continue;
|
||||
|
||||
if (zone->usage.gcBytes() >= zone->threshold.gcTriggerBytes()) {
|
||||
MOZ_ASSERT(zone->isGCScheduled());
|
||||
CheckZoneIsScheduled(zone, reason, "GC bytes");
|
||||
budget.makeUnlimited();
|
||||
stats().nonincremental(AbortReason::GCBytesTrigger);
|
||||
}
|
||||
|
||||
if (zone->isTooMuchMalloc()) {
|
||||
MOZ_ASSERT(zone->isGCScheduled());
|
||||
CheckZoneIsScheduled(zone, reason, "malloc bytes");
|
||||
budget.makeUnlimited();
|
||||
stats().nonincremental(AbortReason::MallocBytesTrigger);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user