mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 15:25:52 +00:00
Bug 1473213 (Part 1) - Track the number of tenured cells r=jonco
--HG-- extra : rebase_source : 96739a13fe0d44bcb00819cf7422ef97bc97f812 extra : intermediate-source : 8a10fc261acb99c7e8bb4fcb4ee0975c5166990d extra : source : 445b672aa024fdfca38a2e819f54bcbf28e922dd
This commit is contained in:
parent
d0196f98ff
commit
6e12af80d7
@ -3002,6 +3002,7 @@ js::TenuringTracer::moveToTenuredSlow(JSObject* src)
|
||||
}
|
||||
|
||||
tenuredSize += dstSize;
|
||||
tenuredCells++;
|
||||
|
||||
// Copy the Cell contents.
|
||||
MOZ_ASSERT(OffsetToChunkEnd(src) >= ptrdiff_t(srcSize));
|
||||
@ -3050,6 +3051,7 @@ js::TenuringTracer::movePlainObjectToTenured(PlainObject* src)
|
||||
|
||||
size_t srcSize = Arena::thingSize(dstKind);
|
||||
tenuredSize += srcSize;
|
||||
tenuredCells++;
|
||||
|
||||
// Copy the Cell contents.
|
||||
MOZ_ASSERT(OffsetToChunkEnd(src) >= ptrdiff_t(srcSize));
|
||||
@ -3166,6 +3168,7 @@ js::TenuringTracer::moveToTenured(JSString* src)
|
||||
|
||||
JSString* dst = allocTenured<JSString>(zone, dstKind);
|
||||
tenuredSize += moveStringToTenured(dst, src, dstKind);
|
||||
tenuredCells++;
|
||||
|
||||
RelocationOverlay* overlay = RelocationOverlay::fromCell(src);
|
||||
overlay->forwardTo(dst);
|
||||
|
@ -540,6 +540,7 @@ js::TenuringTracer::TenuringTracer(JSRuntime* rt, Nursery* nursery)
|
||||
: JSTracer(rt, JSTracer::TracerKindTag::Tenuring, TraceWeakMapKeysValues)
|
||||
, nursery_(*nursery)
|
||||
, tenuredSize(0)
|
||||
, tenuredCells(0)
|
||||
, objHead(nullptr)
|
||||
, objTail(&objHead)
|
||||
, stringHead(nullptr)
|
||||
@ -599,6 +600,7 @@ js::Nursery::renderProfileJSON(JSONPrinter& json) const
|
||||
|
||||
json.property("reason", JS::gcreason::ExplainReason(previousGC.reason));
|
||||
json.property("bytes_tenured", previousGC.tenuredBytes);
|
||||
json.property("cells_tenured", previousGC.tenuredCells);
|
||||
json.property("bytes_used", previousGC.nurseryUsedBytes);
|
||||
json.property("cur_capacity", previousGC.nurseryCapacity);
|
||||
const size_t newCapacity = spaceToEnd(maxChunkCount());
|
||||
@ -741,6 +743,7 @@ js::Nursery::collect(JS::gcreason::Reason reason)
|
||||
previousGC.nurseryCapacity = spaceToEnd(maxChunkCount());
|
||||
previousGC.nurseryLazyCapacity = spaceToEnd(allocatedChunkCount());
|
||||
previousGC.tenuredBytes = 0;
|
||||
previousGC.tenuredCells = 0;
|
||||
}
|
||||
|
||||
// Resize the nursery.
|
||||
@ -954,6 +957,7 @@ js::Nursery::doCollection(JS::gcreason::Reason reason, TenureCountCache& tenureC
|
||||
previousGC.nurseryLazyCapacity = spaceToEnd(allocatedChunkCount());
|
||||
previousGC.nurseryUsedBytes = initialNurseryUsedBytes;
|
||||
previousGC.tenuredBytes = mover.tenuredSize;
|
||||
previousGC.tenuredCells = mover.tenuredCells;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -76,6 +76,8 @@ class TenuringTracer : public JSTracer
|
||||
|
||||
// Amount of data moved to the tenured generation during collection.
|
||||
size_t tenuredSize;
|
||||
// Number of cells moved to the tenured generation.
|
||||
size_t tenuredCells;
|
||||
|
||||
// These lists are threaded through the Nursery using the space from
|
||||
// already moved things. The lists are used to fix up the moved things and
|
||||
@ -438,6 +440,7 @@ class Nursery
|
||||
size_t nurseryLazyCapacity = 0;
|
||||
size_t nurseryUsedBytes = 0;
|
||||
size_t tenuredBytes = 0;
|
||||
size_t tenuredCells = 0;
|
||||
} previousGC;
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user