From 34ef5d5f016475ac8033ba1b87eaeb8ccea4a3a3 Mon Sep 17 00:00:00 2001 From: Jon Coppeard Date: Fri, 6 Oct 2023 08:36:54 +0000 Subject: [PATCH] Bug 1857218 - Part 3: Rename Nursery::setStartPosition() r=sfink Reading this code I found I did not know what the position the start was being set to. The patch renames this to make it clear that it's being set to the current position. Differential Revision: https://phabricator.services.mozilla.com/D190191 --- js/src/gc/Nursery.cpp | 8 ++++---- js/src/gc/Nursery.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/js/src/gc/Nursery.cpp b/js/src/gc/Nursery.cpp index 07a5812931de..fe3a6df6d5f8 100644 --- a/js/src/gc/Nursery.cpp +++ b/js/src/gc/Nursery.cpp @@ -351,7 +351,7 @@ bool js::Nursery::initFirstChunk(AutoLockGCBgAlloc& lock) { } setCurrentChunk(0); - setStartPosition(); + setStartToCurrentPosition(); poisonAndInitCurrentChunk(); // Clear any information about previous collections. @@ -515,7 +515,7 @@ void js::Nursery::leaveZealMode() { MOZ_ASSERT(isEmpty()); setCurrentChunk(0); - setStartPosition(); + setStartToCurrentPosition(); poisonAndInitCurrentChunk(); } #endif // JS_GC_ZEAL @@ -1711,7 +1711,7 @@ void js::Nursery::clear() { } // Set current start position for isEmpty checks. - setStartPosition(); + setStartToCurrentPosition(); } MOZ_ALWAYS_INLINE void js::Nursery::setCurrentChunk(unsigned chunkno) { @@ -1769,7 +1769,7 @@ bool js::Nursery::allocateNextChunk(const unsigned chunkno, return true; } -MOZ_ALWAYS_INLINE void js::Nursery::setStartPosition() { +MOZ_ALWAYS_INLINE void js::Nursery::setStartToCurrentPosition() { startChunk_ = currentChunk_; startPosition_ = position(); } diff --git a/js/src/gc/Nursery.h b/js/src/gc/Nursery.h index 2e125df17e0d..1d5de123dd6d 100644 --- a/js/src/gc/Nursery.h +++ b/js/src/gc/Nursery.h @@ -581,7 +581,7 @@ class Nursery { void poisonAndInitCurrentChunk(size_t extent = gc::ChunkSize); void setCurrentEnd(); - void setStartPosition(); + void setStartToCurrentPosition(); // Allocate the next chunk, or the first chunk for initialization. // Callers will probably want to call setCurrentChunk(0) next. -- 2.11.4.GIT