cppgc: Fix live bytes recording during heap termination

ResetLinearAllocationBuffer() must be called as part of the marking
phase as it may free the current LAB which decreases live bytes which
previously could have caused an underflow.

Bug: chromium:1056170
Change-Id: I8a641fe340f5faf0dfad32cda84f796d0537134b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2917034
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Auto-Submit: Michael Lippautz <mlippautz@chromium.org>
Reviewed-by: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74752}
This commit is contained in:
Michael Lippautz 2021-05-25 15:54:54 +02:00 committed by V8 LUCI CQ
parent 990fb2fb93
commit dabd6c2322

View File

@ -127,8 +127,8 @@ void HeapBase::Terminate() {
stats_collector()->NotifyMarkingStarted(
GarbageCollector::Config::CollectionType::kMajor,
GarbageCollector::Config::IsForcedGC::kForced);
stats_collector()->NotifyMarkingCompleted(0);
object_allocator().ResetLinearAllocationBuffers();
stats_collector()->NotifyMarkingCompleted(0);
ExecutePreFinalizers();
sweeper().Start(
{Sweeper::SweepingConfig::SweepingType::kAtomic,