cppgc-js: Fix DCHECK around completing sweeping

We only complete sweeping when the young generation GC is enabled.

Change-Id: I915acce35d6ba16716c2c4ee4130f99af0744f83
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3900377
Reviewed-by: Anton Bikineev <bikineev@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83269}
This commit is contained in:
Michael Lippautz 2022-09-16 14:23:36 +02:00 committed by V8 LUCI CQ
parent 25c6d74ed7
commit 488b0ff1f5

View File

@ -773,8 +773,6 @@ void CppHeap::TraceEpilogue() {
}
void CppHeap::RunMinorGC(StackState stack_state) {
DCHECK(!sweeper_.IsSweepingInProgress());
if (!generational_gc_supported()) return;
if (in_no_gc_scope()) return;
// Minor GC does not support nesting in full GCs.
@ -782,6 +780,8 @@ void CppHeap::RunMinorGC(StackState stack_state) {
// Minor GCs with the stack are currently not supported.
if (stack_state == StackState::kMayContainHeapPointers) return;
DCHECK(!sweeper_.IsSweepingInProgress());
// Notify GC tracer that CppGC started young GC cycle.
isolate_->heap()->tracer()->NotifyYoungCppGCRunning();