Skip to content

Commit 9b5180c

Browse files
committed
deps: V8: cherry-pick 497c2e6a2434
Original commit message: [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 <dinfuehr@chromium.org> Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Cr-Commit-Position: refs/heads/main@{#110622} Fixes: #66490 Refs: v8/v8@497c2e6 Assisted-by: Codex Signed-off-by: inoway46 <inoueyuya416@gmail.com>
1 parent f88c2f8 commit 9b5180c

2 files changed

Lines changed: 2 additions & 12 deletions

File tree

‎common.gypi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
# Reset this number to 0 on major V8 upgrades.
4646
# Increment by one for each non-official patch applied to deps/v8.
47-
'v8_embedder_string': '-node.39',
47+
'v8_embedder_string': '-node.40',
4848

4949
##### V8 defaults for Node.js #####
5050

‎deps/v8/src/heap/mark-compact.cc‎

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

0 commit comments

Comments
 (0)