Commit db1d56ee authored by Anton Bikineev's avatar Anton Bikineev Committed by V8 LUCI CQ

cppgc: young-gen: Fix verifier for minor GC in cpp-heap.

Bug: chromium:1029379
Change-Id: I3970de943c58aa834bd12afd2d289c2034c65c1b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3439913
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Auto-Submit: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78946}
parent 29c26dfa
......@@ -514,7 +514,8 @@ void CppHeap::EnterFinalPause(cppgc::EmbedderStackState stack_state) {
stack_state);
}
void CppHeap::TraceEpilogue() {
void CppHeap::TraceEpilogue(
cppgc::internal::GarbageCollector::Config::CollectionType collection_type) {
CHECK(in_atomic_pause_);
CHECK(marking_done_);
{
......@@ -534,8 +535,7 @@ void CppHeap::TraceEpilogue() {
buffered_allocated_bytes_ = 0;
const size_t bytes_allocated_in_prefinalizers = ExecutePreFinalizers();
#if CPPGC_VERIFY_HEAP
UnifiedHeapMarkingVerifier verifier(
*this, cppgc::internal::Heap::Config::CollectionType::kMajor);
UnifiedHeapMarkingVerifier verifier(*this, collection_type);
verifier.Run(
stack_state_of_prev_gc(), stack_end_of_current_gc(),
stats_collector()->marked_bytes() + bytes_allocated_in_prefinalizers);
......@@ -629,7 +629,7 @@ void CppHeap::CollectGarbageForTesting(
}
EnterFinalPause(stack_state);
AdvanceTracing(std::numeric_limits<double>::infinity());
TraceEpilogue();
TraceEpilogue(collection_type);
}
}
......
......@@ -124,7 +124,7 @@ class V8_EXPORT_PRIVATE CppHeap final
void StartTracing();
bool AdvanceTracing(double max_duration);
bool IsTracingDone();
void TraceEpilogue();
void TraceEpilogue(cppgc::internal::GarbageCollector::Config::CollectionType);
void EnterFinalPause(cppgc::EmbedderStackState stack_state);
// StatsCollector::AllocationObserver interface.
......
......@@ -69,7 +69,8 @@ void LocalEmbedderHeapTracer::TraceEpilogue() {
EmbedderHeapTracer::EmbedderStackState::kMayContainHeapPointers;
if (cpp_heap_) {
cpp_heap()->TraceEpilogue();
cpp_heap()->TraceEpilogue(
cppgc::internal::GarbageCollector::Config::CollectionType::kMajor);
} else {
EmbedderHeapTracer::TraceSummary summary;
remote_tracer_->TraceEpilogue(&summary);
......
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