Bug 989035 - Track malloced slots attached to the nursery. r=njn

This commit is contained in:
Terrence Cole 2014-03-27 22:52:02 -04:00
parent d5677815aa
commit d2700b6596
4 changed files with 20 additions and 2 deletions

View File

@ -183,6 +183,7 @@ struct GCSizes
macro(_, _, marker) \
macro(_, _, nurseryCommitted) \
macro(_, _, nurseryDecommitted) \
macro(_, _, nurseryHugeSlots) \
macro(_, _, storeBufferVals) \
macro(_, _, storeBufferCells) \
macro(_, _, storeBufferSlots) \

View File

@ -125,8 +125,19 @@ class Nursery
/* Forward a slots/elements pointer stored in an Ion frame. */
void forwardBufferPointer(HeapSlot **pSlotsElems);
size_t sizeOfHeapCommitted() { return numActiveChunks_ * gc::ChunkSize; }
size_t sizeOfHeapDecommitted() { return (NumNurseryChunks - numActiveChunks_) * gc::ChunkSize; }
size_t sizeOfHeapCommitted() const {
return numActiveChunks_ * gc::ChunkSize;
}
size_t sizeOfHeapDecommitted() const {
return (NumNurseryChunks - numActiveChunks_) * gc::ChunkSize;
}
size_t sizeOfHugeSlots(mozilla::MallocSizeOf mallocSizeOf) const {
size_t total = 0;
for (HugeSlotsSet::Range r = hugeSlots.all(); !r.empty(); r.popFront())
total += mallocSizeOf(r.front());
total += hugeSlots.sizeOfExcludingThis(mallocSizeOf);
return total;
}
private:
/*

View File

@ -629,6 +629,7 @@ JSRuntime::addSizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf, JS::Runtim
#ifdef JSGC_GENERATIONAL
rtSizes->gc.nurseryCommitted += gcNursery.sizeOfHeapCommitted();
rtSizes->gc.nurseryDecommitted += gcNursery.sizeOfHeapDecommitted();
rtSizes->gc.nurseryHugeSlots += gcNursery.sizeOfHugeSlots(mallocSizeOf);
gcStoreBuffer.addSizeOfExcludingThis(mallocSizeOf, &rtSizes->gc);
#endif
}

View File

@ -2355,6 +2355,11 @@ ReportJSRuntimeExplicitTreeStats(const JS::RuntimeStats &rtStats,
KIND_NONHEAP, rtStats.runtime.gc.nurseryCommitted,
"Memory being used by the GC's nursery.");
RREPORT_BYTES(rtPath + NS_LITERAL_CSTRING("runtime/gc/nursery-huge-slots"),
KIND_NONHEAP, rtStats.runtime.gc.nurseryHugeSlots,
"Out-of-line slots and elements belonging to objects in the "
"nursery.");
RREPORT_BYTES(rtPath + NS_LITERAL_CSTRING("runtime/gc/store-buffer/vals"),
KIND_HEAP, rtStats.runtime.gc.storeBufferVals,
"Values in the store buffer.");