summaryrefslogtreecommitdiffstats
path: root/js/src/gc/Marking.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:14:29 +0000
commitfbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 (patch)
tree4c1ccaf5486d4f2009f9a338a98a83e886e29c97 /js/src/gc/Marking.cpp
parentReleasing progress-linux version 124.0.1-1~progress7.99u1. (diff)
downloadfirefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.tar.xz
firefox-fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8.zip
Merging upstream version 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;
}
}