summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorJon Coppeard <jcoppeard@mozilla.com>2019-03-22 13:17:31 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-03-22 13:17:31 +0100
commitc53602c802cfaeaede20cb0bb2180194389eeb05 (patch)
treebceef6e735c321566a0b64cd5dfd909022e46715 /js
parent8549c7cc31352e7d0cf89606d109f7c827ebab82 (diff)
downloadUXP-c53602c802cfaeaede20cb0bb2180194389eeb05.tar
UXP-c53602c802cfaeaede20cb0bb2180194389eeb05.tar.gz
UXP-c53602c802cfaeaede20cb0bb2180194389eeb05.tar.lz
UXP-c53602c802cfaeaede20cb0bb2180194389eeb05.tar.xz
UXP-c53602c802cfaeaede20cb0bb2180194389eeb05.zip
Reset nursery position when it's disabled.
Diffstat (limited to 'js')
-rw-r--r--js/src/gc/Nursery.cpp1
-rw-r--r--js/src/gc/Nursery.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/js/src/gc/Nursery.cpp b/js/src/gc/Nursery.cpp
index ea4350fb8..93a0eb6a8 100644
--- a/js/src/gc/Nursery.cpp
+++ b/js/src/gc/Nursery.cpp
@@ -210,6 +210,7 @@ js::Nursery::disable()
return;
updateNumChunks(0);
currentEnd_ = 0;
+ position_ = 0;
runtime()->gc.storeBuffer.disable();
}
diff --git a/js/src/gc/Nursery.h b/js/src/gc/Nursery.h
index 0d215d997..a839a4979 100644
--- a/js/src/gc/Nursery.h
+++ b/js/src/gc/Nursery.h
@@ -245,6 +245,7 @@ class Nursery
// Free space remaining, not counting chunk trailers.
MOZ_ALWAYS_INLINE size_t freeSpace() const {
+ MOZ_ASSERT(isEnabled());
MOZ_ASSERT(currentEnd_ - position_ <= NurseryChunkUsableSize);
return (currentEnd_ - position_) +
(numChunks() - currentChunk_ - 1) * NurseryChunkUsableSize;