From 492e6f2e52d4a622548ea0e7689fbeb5ea6f0660 Mon Sep 17 00:00:00 2001 From: Paul Bone Date: Wed, 15 Nov 2017 17:08:39 +1100 Subject: [PATCH] Bug 1417315 - Calculate lazy_capacity perf value before resizing the nursery r=sfink --- js/src/gc/Nursery.cpp | 7 ++++--- js/src/gc/Nursery.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/js/src/gc/Nursery.cpp b/js/src/gc/Nursery.cpp index 1ff3e038b5c4..7954d590c9a6 100644 --- a/js/src/gc/Nursery.cpp +++ b/js/src/gc/Nursery.cpp @@ -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; } diff --git a/js/src/gc/Nursery.h b/js/src/gc/Nursery.h index 06158799dc0e..2f368dc6a80e 100644 --- a/js/src/gc/Nursery.h +++ b/js/src/gc/Nursery.h @@ -380,6 +380,7 @@ class Nursery struct { JS::gcreason::Reason reason; size_t nurseryCapacity; + size_t nurseryLazyCapacity; size_t nurseryUsedBytes; size_t tenuredBytes; } previousGC;