mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-28 20:55:39 +00:00
Bug 1123237 - Part 3. Monitoring allocation and gc events in nursery and tenured heaps. r=terrence
Based on patch from Ting-Yuan Huang <laszio.bugzilla@gmail.com>
This commit is contained in:
parent
f62780fc85
commit
3b6ee3a50b
@ -571,6 +571,7 @@ class FreeList
|
||||
}
|
||||
head.checkSpan(thingSize);
|
||||
JS_EXTRA_POISON(reinterpret_cast<void*>(thing), JS_ALLOCATED_TENURED_PATTERN, thingSize);
|
||||
MemProfiler::SampleTenured(reinterpret_cast<void*>(thing), thingSize);
|
||||
return reinterpret_cast<TenuredCell*>(thing);
|
||||
}
|
||||
};
|
||||
|
@ -2020,7 +2020,6 @@ js::TenuringTracer::moveToTenured(JSObject* src)
|
||||
CrashAtUnhandlableOOM("Failed to allocate object while tenuring.");
|
||||
}
|
||||
JSObject* dst = reinterpret_cast<JSObject*>(t);
|
||||
|
||||
tenuredSize += moveObjectToTenured(dst, src, dstKind);
|
||||
|
||||
RelocationOverlay* overlay = RelocationOverlay::fromCell(src);
|
||||
@ -2032,6 +2031,7 @@ js::TenuringTracer::moveToTenured(JSObject* src)
|
||||
}
|
||||
|
||||
TracePromoteToTenured(src, dst);
|
||||
MemProfiler::MoveNurseryToTenured(src, dst);
|
||||
return dst;
|
||||
}
|
||||
|
||||
|
@ -235,6 +235,7 @@ js::Nursery::allocate(size_t size)
|
||||
position_ = position() + size;
|
||||
|
||||
JS_EXTRA_POISON(thing, JS_ALLOCATED_NURSERY_PATTERN, size);
|
||||
MemProfiler::SampleNursery(reinterpret_cast<void*>(thing), size);
|
||||
return thing;
|
||||
}
|
||||
|
||||
@ -675,6 +676,7 @@ js::Nursery::sweep()
|
||||
|
||||
/* Set current start position for isEmpty checks. */
|
||||
currentStart_ = position();
|
||||
MemProfiler::SweepNursery(runtime());
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -490,6 +490,14 @@ Arena::finalize(FreeOp* fop, AllocKind thingKind, size_t thingSize)
|
||||
FreeSpan* newListTail = &newListHead;
|
||||
size_t nmarked = 0;
|
||||
|
||||
if (MOZ_UNLIKELY(MemProfiler::enabled())) {
|
||||
for (ArenaCellIterUnderFinalize i(&aheader); !i.done(); i.next()) {
|
||||
T* t = i.get<T>();
|
||||
if (t->asTenured().isMarked())
|
||||
MemProfiler::MarkTenured(reinterpret_cast<void*>(t));
|
||||
}
|
||||
}
|
||||
|
||||
for (ArenaCellIterUnderFinalize i(&aheader); !i.done(); i.next()) {
|
||||
T* t = i.get<T>();
|
||||
if (t->asTenured().isMarked()) {
|
||||
@ -3882,6 +3890,7 @@ GCRuntime::beginMarkPhase(JS::gcreason::Reason reason)
|
||||
zone->arenas.purge();
|
||||
}
|
||||
|
||||
MemProfiler::MarkTenuredStart(rt);
|
||||
marker.start();
|
||||
GCMarker* gcmarker = ▮
|
||||
|
||||
@ -5538,6 +5547,7 @@ GCRuntime::finishCollection(JS::gcreason::Reason reason)
|
||||
MOZ_ASSERT(marker.isDrained());
|
||||
marker.stop();
|
||||
clearBufferedGrayRoots();
|
||||
MemProfiler::SweepTenured(rt);
|
||||
|
||||
uint64_t currentTime = PRMJ_Now();
|
||||
schedulingState.updateHighFrequencyMode(lastGCTime, currentTime, tunables);
|
||||
|
Loading…
Reference in New Issue
Block a user