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}

Refs: https://github.com/v8/v8/commit/497c2e6a2434af02b44417b55b1576702922f5e9
PR-URL: https://github.com/nodejs/node/pull/66728
Reviewed-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
Dominik Inführ authored and Antoine du Hamel committed 2026-11-14 17:01:52 +01:00
1 parent 66785ecfdf
commit a4787636cb
2 files changed
+2 -12

No files matched your search

+1 -1
View File
@@ -50,7 +50,7 @@
# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.11',
'v8_embedder_string': '-node.12',
##### V8 defaults for Node.js #####
+1 -11
View File
@@ -2539,17 +2539,7 @@ void MarkCompactCollector::RetainMaps() {
MarkingHelper::WorklistTarget::kRegular, map);
}
}
Tagged<Object> prototype = map->prototype();
if (age > 0 && IsHeapObject(prototype) &&
MarkingHelper::IsUnmarkedAndNotAlwaysLive(
heap_, marking_state_, Cast<HeapObject>(prototype))) {
// The prototype is not marked, age the map.
new_age = age - 1;
} else {
// The prototype and the constructor are marked, this map keeps only
// transition tree alive, not JSObjects. Do not age the map.
new_age = age;
}
new_age = age > 0 ? age - 1 : 0;
} else {
new_age = v8_flags.retain_maps_for_n_gc;
}