Bug 1417315 - Calculate lazy_capacity perf value before resizing the nursery r=sfink

This commit is contained in:
Paul Bone 2017-11-15 17:08:39 +11:00
Родитель 2ac7248a65
Коммит 492e6f2e52
2 изменённых файлов: 5 добавлений и 3 удалений

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

@ -554,9 +554,8 @@ js::Nursery::renderProfileJSON(JSONPrinter& json) const
const size_t newCapacity = spaceToEnd(maxChunkCount());
if (newCapacity != previousGC.nurseryCapacity)
json.property("new_capacity", newCapacity);
const size_t lazyCapacity = spaceToEnd(allocatedChunkCount());
if (lazyCapacity != previousGC.nurseryCapacity)
json.property("lazy_capacity", lazyCapacity);
if (previousGC.nurseryLazyCapacity != previousGC.nurseryCapacity)
json.property("lazy_capacity", previousGC.nurseryLazyCapacity);
if (!timeInChunkAlloc_.IsZero())
json.property("chunk_alloc_us", timeInChunkAlloc_, json.MICROSECONDS);
@ -680,6 +679,7 @@ js::Nursery::collect(JS::gcreason::Reason reason)
} else {
previousGC.nurseryUsedBytes = 0;
previousGC.nurseryCapacity = spaceToEnd(maxChunkCount());
previousGC.nurseryLazyCapacity = spaceToEnd(allocatedChunkCount());
previousGC.tenuredBytes = 0;
}
@ -867,6 +867,7 @@ js::Nursery::doCollection(JS::gcreason::Reason reason,
previousGC.reason = reason;
previousGC.nurseryCapacity = initialNurseryCapacity;
previousGC.nurseryLazyCapacity = spaceToEnd(allocatedChunkCount());
previousGC.nurseryUsedBytes = initialNurseryUsedBytes;
previousGC.tenuredBytes = mover.tenuredSize;
}

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

@ -380,6 +380,7 @@ class Nursery
struct {
JS::gcreason::Reason reason;
size_t nurseryCapacity;
size_t nurseryLazyCapacity;
size_t nurseryUsedBytes;
size_t tenuredBytes;
} previousGC;