Skip to content

Commit 497c2e6

Browse files
Dominik Inführv8-scoped@luci-project-accounts.iam.gserviceaccount.com
authored andcommitted
[heap] Always decrement age in RetainMaps()
When the prototype and constructor were already marked we did not age the map because of the assumption that this would only keep the transition tree alive. However, this does not hold because of the JSFunctions inside an AccessorPair in DescriptorArray. This can result in retaining maps indefinitely when not triggering memory reducing GCs. This CL therefore simplifies the code to always age maps instead. This is neutral on Speedometer and Jetstream. Bug: 571157135 Change-Id: I8fb633a0ec0c1d66e4596390ca48e1c7006c9cc2 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8557820 Commit-Queue: Dominik Inführ <[email protected]> Reviewed-by: Michael Lippautz <[email protected]> Cr-Commit-Position: refs/heads/main@{#110622}
1 parent 592627b commit 497c2e6

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

‎src/heap/mark-compact.cc‎

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2539,17 +2539,7 @@ void MarkCompactCollector::RetainMaps() {
25392539
MarkingHelper::WorklistTarget::kRegular, map);
25402540
}
25412541
}
2542-
Tagged<Object> prototype = map->prototype();
2543-
if (age > 0 && IsHeapObject(prototype) &&
2544-
MarkingHelper::IsUnmarkedAndNotAlwaysLive(
2545-
heap_, marking_state_, Cast<HeapObject>(prototype))) {
2546-
// The prototype is not marked, age the map.
2547-
new_age = age - 1;
2548-
} else {
2549-
// The prototype and the constructor are marked, this map keeps only
2550-
// transition tree alive, not JSObjects. Do not age the map.
2551-
new_age = age;
2552-
}
2542+
new_age = age > 0 ? age - 1 : 0;
25532543
} else {
25542544
new_age = v8_flags.retain_maps_for_n_gc;
25552545
}

0 commit comments

Comments
 (0)