Skip to content

Commit 226b159

Browse files
mlippautzV8 LUCI CQ
authored andcommitted
[heap] Fix incremental marking without unified schedule
The unified schedule landed in https://crrev.com/c/6281665. The CL added a switch for the schedule but didn't adjust the initial scheduled bytes computation as well as the bailouts properly: - Fix GetScheduledBytes() which now ignores CppHeap bytes when the mode is off. - Fix the actual step to ignore CppHeap marked bytes when the mode is off. Bug: 391118563, 391118563 Change-Id: I06b485d49852f3c8628c378978d27d2f0f0c4c88 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6310485 Reviewed-by: Dominik Inführ <[email protected]> Commit-Queue: Michael Lippautz <[email protected]> Cr-Commit-Position: refs/heads/main@{#99025}
1 parent 473728d commit 226b159

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/heap/incremental-marking.cc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -812,8 +812,10 @@ size_t IncrementalMarking::GetScheduledBytes(StepOrigin step_origin) {
812812
// TODO(v8:14140): Consider the size including young generation here as well
813813
// as the full marker marks both the young and old generations.
814814
size_t estimated_live_bytes = OldGenerationSizeOfObjects();
815-
if (auto* cpp_heap = CppHeap::From(heap_->cpp_heap())) {
816-
estimated_live_bytes += cpp_heap->used_size();
815+
if (v8_flags.incremental_marking_unified_schedule) {
816+
if (auto* cpp_heap = CppHeap::From(heap_->cpp_heap())) {
817+
estimated_live_bytes += cpp_heap->used_size();
818+
}
817819
}
818820
const size_t marked_bytes_limit =
819821
schedule_->GetNextIncrementalStepDuration(estimated_live_bytes);
@@ -984,7 +986,8 @@ void IncrementalMarking::Step(v8::base::TimeDelta max_duration,
984986
size_t v8_marked_bytes = 0;
985987
v8::base::TimeDelta v8_time;
986988
if (cpp_heap_duration < max_duration &&
987-
cpp_heap_marked_bytes < marked_bytes_limit) {
989+
(!v8_flags.incremental_marking_unified_schedule ||
990+
(cpp_heap_marked_bytes < marked_bytes_limit))) {
988991
const auto v8_start = v8::base::TimeTicks::Now();
989992
std::tie(v8_marked_bytes, std::ignore) =
990993
major_collector_->ProcessMarkingWorklist(

0 commit comments

Comments
 (0)