summaryrefslogtreecommitdiffstats
path: root/js/src/gc/Marking.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /js/src/gc/Marking.cpp
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-40a355a42d4a9444dc753c04c6608dade2f06a23.tar.xz
firefox-40a355a42d4a9444dc753c04c6608dade2f06a23.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/gc/Marking.cpp')
-rw-r--r--js/src/gc/Marking.cpp32
1 files changed, 9 insertions, 23 deletions
diff --git a/js/src/gc/Marking.cpp b/js/src/gc/Marking.cpp
index 78fcc3dedc..6b8742c980 100644
--- a/js/src/gc/Marking.cpp
+++ b/js/src/gc/Marking.cpp
@@ -1006,7 +1006,6 @@ void js::gc::PerformIncrementalPreWriteBarrier(TenuredCell* cell) {
// runtime for cells in atoms zone.
Zone* zone = cell->zoneFromAnyThread();
- MOZ_ASSERT(zone->needsIncrementalBarrier());
MOZ_ASSERT(cell);
if (cell->isMarkedBlack()) {
@@ -1023,6 +1022,7 @@ void js::gc::PerformIncrementalPreWriteBarrier(TenuredCell* cell) {
return;
}
+ MOZ_ASSERT(zone->needsIncrementalBarrier());
MOZ_ASSERT(CurrentThreadIsMainThread());
MOZ_ASSERT(!JS::RuntimeHeapIsMajorCollecting());
@@ -1809,29 +1809,15 @@ MarkStack::MarkStack() { MOZ_ASSERT(isEmpty()); }
MarkStack::~MarkStack() { MOZ_ASSERT(isEmpty()); }
-MarkStack::MarkStack(const MarkStack& other) {
- MOZ_CRASH("Compiler requires this but doesn't call it");
-}
-
-MarkStack& MarkStack::operator=(const MarkStack& other) {
- new (this) MarkStack(other);
- return *this;
-}
-
-MarkStack::MarkStack(MarkStack&& other) noexcept
- : stack_(std::move(other.stack_.ref())),
- topIndex_(other.topIndex_.ref())
+void MarkStack::swap(MarkStack& other) {
+ std::swap(stack_, other.stack_);
+ std::swap(topIndex_, other.topIndex_);
#ifdef JS_GC_ZEAL
- ,
- maxCapacity_(other.maxCapacity_)
+ std::swap(maxCapacity_, other.maxCapacity_);
+#endif
+#ifdef DEBUG
+ std::swap(elementsRangesAreValid, other.elementsRangesAreValid);
#endif
-{
- other.topIndex_ = 0;
-}
-
-MarkStack& MarkStack::operator=(MarkStack&& other) noexcept {
- new (this) MarkStack(std::move(other));
- return *this;
}
bool MarkStack::init() { return resetStackCapacity(); }
@@ -2186,7 +2172,7 @@ void GCMarker::setMarkColor(gc::MarkColor newColor) {
// Switch stacks. We only need to do this if there are any stack entries (as
// empty stacks are interchangeable) or to swtich back to the original stack.
if (!isDrained() || haveSwappedStacks) {
- std::swap(stack, otherStack);
+ stack.swap(otherStack);
haveSwappedStacks = !haveSwappedStacks;
}
}