cppgc: Fix Heap destruction finishing a GC

We should not assume that the embedder can run with concurrent marking
even though we just finalize the GC at this point.

Bug: chromium:1271371
Change-Id: I3d3a45e4283dcae9c6fdd1a467158254914868c3
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3289169
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77982}
This commit is contained in:
Michael Lippautz 2021-11-18 17:16:48 +01:00 committed by V8 LUCI CQ
parent 5ab4b89e12
commit 6fcbc0d2de

View File

@ -97,8 +97,7 @@ Heap::~Heap() {
FinalizeIncrementalGarbageCollectionIfRunning(
{Config::CollectionType::kMajor,
Config::StackState::kMayContainHeapPointers,
Config::MarkingType::kIncrementalAndConcurrent,
Config::SweepingType::kIncrementalAndConcurrent});
Config::MarkingType::kAtomic, Config::SweepingType::kAtomic});
{
subtle::NoGarbageCollectionScope no_gc(*this);
sweeper_.FinishIfRunning();