Commit 1b405b14 authored by Michael Lippautz's avatar Michael Lippautz Committed by V8 LUCI CQ

[heap] Don't publish marking barrier in final marking step

The barrier is published in the atomic pause following the final step.

Bug: v8:12775
Change-Id: Ia77e1d213cc02a086d7a557999481b633e6b4df4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3582039Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79928}
parent d9268ee8
......@@ -3947,7 +3947,6 @@ void Heap::FinalizeIncrementalMarkingIncrementally(
ThreadKind::kMain);
IgnoreLocalGCRequests ignore_gc_requests(this);
SafepointScope safepoint(this);
InvokeIncrementalMarkingPrologueCallbacks();
incremental_marking()->FinalizeIncrementally();
InvokeIncrementalMarkingEpilogueCallbacks();
......
......@@ -423,8 +423,6 @@ void IncrementalMarking::FinalizeIncrementally() {
// so we can do it only once at the beginning of the finalization.
RetainMaps();
MarkingBarrier::PublishAll(heap());
finalize_marking_completed_ = true;
if (FLAG_trace_incremental_marking) {
......
......@@ -30,7 +30,7 @@ class MarkingBarrier {
static void ActivateAll(Heap* heap, bool is_compacting);
static void DeactivateAll(Heap* heap);
static void PublishAll(Heap* heap);
V8_EXPORT_PRIVATE static void PublishAll(Heap* heap);
void Write(HeapObject host, HeapObjectSlot, HeapObject value);
void Write(Code host, RelocInfo*, HeapObject value);
......
......@@ -10,6 +10,7 @@
#include "src/heap/heap-inl.h"
#include "src/heap/incremental-marking.h"
#include "src/heap/mark-compact.h"
#include "src/heap/marking-barrier.h"
#include "src/heap/memory-chunk.h"
#include "src/heap/safepoint.h"
#include "test/cctest/cctest.h"
......@@ -189,6 +190,7 @@ void SimulateIncrementalMarking(i::Heap* heap, bool force_completion) {
i::StepOrigin::kV8);
if (marking->IsReadyToOverApproximateWeakClosure()) {
SafepointScope scope(heap);
MarkingBarrier::PublishAll(heap);
marking->MarkRootsForTesting();
marking->FinalizeIncrementally();
}
......
......@@ -48,6 +48,7 @@
#include "src/heap/incremental-marking.h"
#include "src/heap/large-spaces.h"
#include "src/heap/mark-compact.h"
#include "src/heap/marking-barrier.h"
#include "src/heap/memory-chunk.h"
#include "src/heap/memory-reducer.h"
#include "src/heap/parked-scope.h"
......@@ -5654,6 +5655,7 @@ TEST(Regress598319) {
StepOrigin::kV8);
if (marking->IsReadyToOverApproximateWeakClosure()) {
SafepointScope safepoint_scope(heap);
MarkingBarrier::PublishAll(heap);
marking->FinalizeIncrementally();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment