cppgc: Fix object start bitmap lookup in heap termination

The lookup is safe during executing pre-finalizers which requires that
the GC is put in the atomic pause.

Bug: chromium:1307471
Change-Id: I4e61573f5cadf2585daab24d73ad798004d54188
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3545173
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79572}
This commit is contained in:
Michael Lippautz 2022-03-23 12:56:37 +01:00 committed by V8 LUCI CQ
parent 9c3d4b3556
commit d0b49f6606

View File

@ -164,6 +164,7 @@ void HeapBase::Terminate() {
weak_cross_thread_persistent_region_.ClearAllUsedNodes();
}
in_atomic_pause_ = true;
stats_collector()->NotifyMarkingStarted(
GarbageCollector::Config::CollectionType::kMajor,
GarbageCollector::Config::IsForcedGC::kForced);
@ -173,6 +174,8 @@ void HeapBase::Terminate() {
sweeper().Start(
{Sweeper::SweepingConfig::SweepingType::kAtomic,
Sweeper::SweepingConfig::CompactableSpaceHandling::kSweep});
in_atomic_pause_ = false;
sweeper().NotifyDoneIfNeeded();
more_termination_gcs_needed =
strong_persistent_region_.NodesInUse() ||