Commit Graph
1140 Commits
Author SHA1 Message Date
avivkeller a0d1911bee deps: V8: backport 5177b10891e6
Original commit message:

    fix(inspector): hold on to promises

    Keep `m_evaluationResult` strong for evaluations
    until the promise settles or the request is cancelled.

    Bug: 536271637
    Change-Id: If21cc4aa0ba6bb2e2722d5ee73eb7744a0ead207
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8123081
    Commit-Queue: Simon Zünd <szuend@chromium.org>
    Reviewed-by: Simon Zünd <szuend@chromium.org>
    Reviewed-by: Kim-Anh Tran <kimanh@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#108874}

Refs: https://github.com/v8/v8/commit/5177b10891e65108c1a19dfc56bff4e58d79d216
Co-authored-by: avivkeller <me@aviv.sh>
PR-URL: https://github.com/nodejs/node/pull/64631
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-07-31 15:59:16 -07:00
Chengzhong Wu 6d173727e4 build: perfetto-sdk
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/64565
Refs: https://github.com/nodejs/diagnostics/issues/654
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ryuhei Shima <shimaryuhei@gmail.com>
2026-07-24 14:00:16 +00:00
liujiahuiandliujiahui 94e11b022d deps: V8: backport c4d06ba586f3
Original commit message:

    [loong64][compiler] Extend Word64Select instruction functionality

    Change-Id: Iba762777642d2d2d3aa904f9afc1e9005139992e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7801520
    Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
    Commit-Queue: Liu Yu <liuyu@loongson.cn>
    Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
    Auto-Submit: Liu Yu <liuyu@loongson.cn>
    Cr-Commit-Position: refs/heads/main@{#107619}

Refs: https://github.com/v8/v8/commit/c4d06ba586f33b8e5db81507b05e2cad9b7c07dc
Co-authored-by: liujiahui <liujiahui@loongson.cn>
PR-URL: https://github.com/nodejs/node/pull/63731
Fixes: https://github.com/nodejs/node/issues/63721
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2026-07-24 09:57:00 +00:00
René 7b2c63c0dd deps: V8: cherry-pick 1158ae719749
Original commit message:

    [wasm] Fix jump table slot overflow on x64 with CET enabled

    JumpTableAssembler::EmitJumpSlot for x64 was advancing the PC before
    checking if the target was reachable via a 32-bit displacement when CET
    was enabled. This caused a slot overflow when the far-jump fallback was
    triggered, as the second attempt to emit the slot would start at an
    incorrect offset.

    This CL ensures that the displacement check is performed before any
    instructions are emitted, making the function side-effect-free on
    failure. It also introduces kJumpTableSlotEntryMarkerSize to clarify
    the displacement calculation, following the pattern used on ARM64.

    Reported-by: Fabien Romano <fabienromano@gmail.com>

    TAG=agy
    R=jkummerow@chromium.org

    Fixed: 532112743
    Change-Id: Iaf6f15b51a66a45711e8556972ac0d353e6117c7
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8063803
    Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
    Commit-Queue: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#108556}

Refs: https://github.com/v8/v8/commit/1158ae71974987dc6492c7f407e8a7c005756ffc
PR-URL: https://github.com/nodejs/node/pull/64432
Fixes: https://github.com/nodejs/node/issues/64424
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
2026-07-14 12:07:16 +00:00
Filip Skokan db7cc5b400 crypto: split OpenSSL 3, BoringSSL, and legacy backends
This separates the native crypto backend paths for OpenSSL >= 3,
BoringSSL, and legacy OpenSSL. The OpenSSL >= 3 path now builds with
`OPENSSL_API_COMPAT=30000` and `OPENSSL_NO_DEPRECATED`, moving normal
crypto/TLS code away from APIs that OpenSSL 3.0.0 marks deprecated.
BoringSSL remains on its own branch, and OpenSSL < 3 remains the legacy
fallback.

The exception is ENGINE support. ENGINE APIs are isolated into a
dedicated compatibility target so they can remain available while the
JS-facing engine APIs are runtime-deprecated in 27.x. That gives us a
clear removal point for 28.x, without letting ENGINE usage leak back
into the strict OpenSSL 3 path.

The split also makes the eventual OpenSSL 1.1.1 removal easier to reason
about. Once support for OpenSSL < 3 is dropped, the legacy branch can be
removed in a focused follow-up, possibly targeting 27.x, instead of
untangling mixed version guards throughout the crypto implementation.

No public crypto or TLS API behavior is intentionally changed.

Assisted-by: Codex:gpt-5
Signed-off-by: Filip Skokan <panva.ip@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64211
Refs: https://github.com/nodejs/node/issues/56733
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2026-07-08 20:07:45 +00:00
Chengzhong Wu 39d9e8cba0 deps: V8: backport a05321ebd98e
Original commit message:

    [execution] Lookup interceptor for RestrictedGlobalProperty

    When the script context looks up if a global property is
    restricted, it should also query the global interceptor.

    To avoid calling the interceptor for every declaration
    unconditionally, an interceptor has to be defined with
    `PropertyHandlerFlags::kHasDontDeleteProperty`
    to intercept restricted global property queries.

    Refs: https://github.com/nodejs/node/issues/63715
    Refs: https://github.com/nodejs/node/issues/52634

    Change-Id: I623ff285c4e8773d8ee7f681cbad68ba24bd3f40
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7898818
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Reviewed-by: Igor Sheludko <ishell@chromium.org>
    Commit-Queue: Igor Sheludko <ishell@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#108280}

Refs: https://github.com/v8/v8/commit/a05321ebd98e3bff3c6bba3df02895a49d6ad2fb
Signed-off-by: Chengzhong Wu <cwu631@bloomberg.net>
PR-URL: https://github.com/nodejs/node/pull/64202
Fixes: https://github.com/nodejs/node/issues/63715
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2026-07-07 17:59:00 +00:00
Kevin Gibbons 74567b2115 deps: V8: backport da20a197a7f9
Original commit message:

    [builtins] Make Promise resolvers not keep resolved Promises alive

    Currently a Promise's resolve/reject functions unconditionally hold the
    Promise, plus a separate bit to track whether the Promise has been
    resolved. Instead, hold a single field with Promise|Undefined.

    This allows GC'ing a resolved Promise even if its resolvers are still
    alive.

    R=olivf@chromium.org

    Fixed: 42213031
    Change-Id: Ice645dbabb79e63dfcac8ae843cad95439d7a1f1
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7646250
    Reviewed-by: Darius Mercadier <dmercadier@chromium.org>
    Commit-Queue: Kevin Gibbons <bakkot@gmail.com>
    Reviewed-by: Olivier Flückiger <olivf@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#108183}

Refs: https://github.com/v8/v8/commit/da20a197a7f9c2045b1ee501a472072944a86332
Co-authored-by: Kevin Gibbons <bakkot@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/64101
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2026-06-25 22:06:06 +00:00
Kevin Gibbons 32ae06ef20 deps: V8: cherry-pick 0cc9eb22c0b0
Original commit message:

    [api] Remove PromiseResolveAfterResolved and PromiseRejectAfterResolved

    These were previously deprecated in https://crrev.com/c/7774767

    Bug: 42213031
    Change-Id: I07b802b743bf052611f30a61c1132231df22f0bd
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7897881
    Commit-Queue: Olivier Flückiger <olivf@chromium.org>
    Reviewed-by: Camillo Bruni <cbruni@chromium.org>
    Reviewed-by: Olivier Flückiger <olivf@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#108040}

Refs: https://github.com/v8/v8/commit/0cc9eb22c0b0d132344b83b906f8a0e5aaa7b61e
PR-URL: https://github.com/nodejs/node/pull/64101
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2026-06-25 22:06:05 +00:00
Kevin Gibbons 0bea193144 deps: V8: cherry-pick 1a391f98cc7a
Original commit message:

    [api] Deprecate kPromiseRejectAfterResolved and kPromiseResolveAfterResolved

    These events will be removed soon.

    Bug: 42213031
    Change-Id: Ie70474ff33c40c7d9cb0c2d0fbe6b75da3c53a22
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7774767
    Commit-Queue: Kevin Gibbons <bakkot@gmail.com>
    Reviewed-by: Olivier Flückiger <olivf@chromium.org>
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#107395}

Refs: https://github.com/v8/v8/commit/1a391f98cc7a9196369f2d6cab7df35ffbe92c08
PR-URL: https://github.com/nodejs/node/pull/64101
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
2026-06-25 22:06:04 +00:00
Ivan Trubach b087e922bd build: support setting an emulator from configure script
V8’s JIT infrastructure requires binaries such as mksnapshot to be run
during the build. However, these binaries must have the same bit-width
as the host platform (e.g. a x86_64 build platform targeting ARMv6 needs
to produce a 32-bit binary).

To work around this issue, allow building the binaries for the host
platform and running them on the build platform with an emulator.

Based on Buildroot’s nodejs-src 0001-add-qemu-wrapper-support.patch.
https://gitlab.com/buildroot.org/buildroot/-/blob/c1d5eada4d4db9eeaa1c44dd1dea95a67c8a70ca/package/nodejs/nodejs-src/0001-add-qemu-wrapper-support.patch

PR-URL: https://github.com/nodejs/node/pull/53899
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Aviv Keller <me@aviv.sh>
2026-06-25 10:56:23 +02:00
Robert Nagy d66c3a6c0f deps: V8: add CopyArrayBufferBytes API
Add v8::ArrayBuffer::CopyArrayBufferBytes and
v8::SharedArrayBuffer::CopyArrayBufferBytes, which copy a byte range
from one backing store to another. V8 clamps the byte range and handles
detached and immutable buffers: nothing is copied when the source is
detached or the target is detached or immutable, and the number of bytes
actually copied is returned. The SharedArrayBuffer overload uses a
relaxed-atomic memmove that honors the SharedArrayBuffer memory model.

Carried as a floating patch cherry-picked from:

    https://chromium-review.googlesource.com/c/v8/v8/+/7735151

That CL is authored by a Node.js collaborator (Ben Noordhuis) and is
expected to land upstream, so the floating patch should be easy to
maintain: it touches nothing but the public ArrayBuffer API and can be
dropped wholesale on the next V8 upgrade that includes it.
v8_embedder_string is bumped to -node.21 accordingly.

Refs: https://chromium-review.googlesource.com/c/v8/v8/+/7735151
Signed-off-by: Robert Nagy <ronagy@icloud.com>
PR-URL: https://github.com/nodejs/node/pull/63828
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
2026-06-12 23:26:18 +00:00
Stefan Stojanovic 614050b657 build,win: replace LTCG with Thin LTO for releases
Signed-off-by: StefanStojanovic <stefan.stojanovic@janeasystems.com>
PR-URL: https://github.com/nodejs/node/pull/63114
Refs: https://github.com/nodejs/node/issues/61964
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2026-05-20 23:25:49 +00:00
Matthias Liedtke 678b46a181 deps: V8: cherry-pick 435a2cdf664c
Original commit message:

    [wasm] Update WebAssembly.Exception JS API

    WebIDL specifies the existence of a
    `WebAssembly.Exception.prototype.stack` getter.
    WebIDL also expects the constructor to have 2 parameters (plus an
    optional one).

    https://webassembly.github.io/spec/js-api/#exceptions

    Bug: 336347912, 42204334
    Change-Id: I128e976a84f942dcf9b93a157534b15fad0f9215
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7697976
    Commit-Queue: Matthias Liedtke <mliedtke@chromium.org>
    Auto-Submit: Matthias Liedtke <mliedtke@chromium.org>
    Commit-Queue: Clemens Backes <clemensb@chromium.org>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#106215}

Refs: https://github.com/v8/v8/commit/435a2cdf664ce02e0c6ea9401fbae600663e47cb
PR-URL: https://github.com/nodejs/node/pull/63136
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Mattias Buelens <mattias@buelens.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-05-12 15:48:18 +00:00
ishabi 8385efc013 deps: V8: cherry-pick 0f024d4e66e0
Original commit message:

    [heap profiler] Add is_live field to AllocationProfile::Sample

    When using kSamplingIncludeObjectsCollectedByMajorGC/MinorGC flag, samples for collected objects are retained but callers had no way to distinguish live from dead objects.
    Add is_live to expose this information.

    Change-Id: I2e930644348ff942caa4b192a127c5baa05bbfef
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7603535
    Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
    Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
    Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#105698}

Refs: https://github.com/v8/v8/commit/0f024d4e66e0edcb4a1370e47e2ba44686a28ac4
Signed-off-by: ishabi <ilyasshabi94@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/62408
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2026-04-28 10:15:47 -04:00
Joyee Cheung fff9a8aa03 build,test: test array index hash collision
This enables v8_enable_seeded_array_index_hash and add a test for it.

deps: V8: backport 0a8b1cdcc8b2

Original commit message:

    implement rapidhash secret generation

    Bug: 409717082
    Change-Id: I471f33d66de32002f744aeba534c1d34f71e27d2
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6733490
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Commit-Queue: snek <snek@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#101499}

deps: V8: backport 185f0fe09b72

Original commit message:

    [numbers] Refactor HashSeed as a lightweight view over ByteArray

    Instead of copying the seed and secrets into a struct with value
    fields, HashSeed now stores a pointer pointing either into the
    read-only ByteArray, or the static default seed for off-heap
    HashSeed::Default() calls. The underlying storage is always
    8-byte aligned so we can cast it directly into a struct.

    Change-Id: I5896a7f2ae24296eb4c80b757a5d90ac70a34866
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7609720
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Cr-Commit-Position: refs/heads/main@{#105531}

deps: V8: backport 1361b2a49d02

Original commit message:

    [strings] improve array index hash distribution

    Previously, the hashes stored in a Name's raw_hash_field for decimal
    numeric strings (potential array indices) consist of the literal
    integer value along with the length of the string. This means
    consecutive numeric strings can have consecutive hash values, which
    can lead to O(n^2) probing for insertion in the worst case when e.g.
    a non-numeric string happen to land in the these buckets.

    This patch adds a build-time flag v8_enable_seeded_array_index_hash
    that scrambles the 24-bit array-index value stored in a Name's
    raw_hash_field to improve the distribution.

    x ^= x >> kShift; x = (x * m1) & kMask;    // round 1
    x ^= x >> kShift; x = (x * m2) & kMask;    // round 2
    x ^= x >> kShift;                          // finalize

    To decode, apply the same steps with the modular inverses of m1
    and m2 in reverse order.

    x ^= x >> kShift; x = (x * m2_inv) & kMask;    // round 1
    x ^= x >> kShift; x = (x * m1_inv) & kMask;    // round 2
    x ^= x >> kShift;                              // finalize

    where kShift = kArrayIndexValueBits / 2, kMask = kArrayIndexValueMask,
    m1, m2 (both odd) are the lower bits of the rapidhash secrets, m1_inv,
    m2_inv (modular inverses) are precomputed modular inverse of m1 and m2.
    The pre-computed values are appended to the hash_seed ByteArray in
    ReadOnlyRoots and accessed in generated code to reduce overhead.
    In call sites that don't already have access to the seeds, we read them
    from the current isolate group/isolate's read only roots.

    To consolidate the code that encode/decode these hashes, this patch
    adds MakeArrayIndexHash/DecodeArrayIndexFromHashField in C++ and CSA
    that perform seeding/unseeding if enabled, and updates places where
    encoding/decoding of array index is needed to use them.

    Bug: 477515021
    Change-Id: I350afe511951a54c4378396538152cc56565fd55
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7564330
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Cr-Commit-Position: refs/heads/main@{#105596}

deps: V8: cherry-pick aac14dd95e5b

Original commit message:

    [string] add 3rd round to seeded array index hash

    Since we already have 3 derived secrets, and arithmetics are
    relatively cheap, add a 3rd round to the xorshift-multiply
    seeding scheme. This brings the bias from ~3.4 to ~0.4.

    Bug: 477515021
    Change-Id: I1ef48954bcee8768d8c90db06ac8adb02f06cebf
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7655117
    Reviewed-by: Chengzhong Wu <cwu631@bloomberg.net>
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#105824}

PR-URL: https://github.com/nodejs-private/node-private/pull/834
CVE-ID: CVE-2026-21717

deps: V8: backport 185f0fe09b72

Original commit message:

    [numbers] Refactor HashSeed as a lightweight view over ByteArray

    Instead of copying the seed and secrets into a struct with value
    fields, HashSeed now stores a pointer pointing either into the
    read-only ByteArray, or the static default seed for off-heap
    HashSeed::Default() calls. The underlying storage is always
    8-byte aligned so we can cast it directly into a struct.

    Change-Id: I5896a7f2ae24296eb4c80b757a5d90ac70a34866
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7609720
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Cr-Commit-Position: refs/heads/main@{#105531}

deps: V8: backport 1361b2a49d02

Original commit message:

    [strings] improve array index hash distribution

    Previously, the hashes stored in a Name's raw_hash_field for decimal
    numeric strings (potential array indices) consist of the literal
    integer value along with the length of the string. This means
    consecutive numeric strings can have consecutive hash values, which
    can lead to O(n^2) probing for insertion in the worst case when e.g.
    a non-numeric string happen to land in the these buckets.

    This patch adds a build-time flag v8_enable_seeded_array_index_hash that
    scrambles the 24-bit array-index value stored in a Name's raw_hash_field
    to improve the distribution.

    x ^= x >> kShift; x = (x * m1) & kMask;    // round 1
    x ^= x >> kShift; x = (x * m2) & kMask;    // round 2
    x ^= x >> kShift;                          // finalize

    To decode, apply the same steps with the modular inverses of m1 and m2
    in reverse order.

    x ^= x >> kShift; x = (x * m2_inv) & kMask;    // round 1
    x ^= x >> kShift; x = (x * m1_inv) & kMask;    // round 2
    x ^= x >> kShift;                              // finalize

    where kShift = kArrayIndexValueBits / 2, kMask = kArrayIndexValueMask,
    m1, m2 (both odd) are the lower bits of the rapidhash secrets, m1_inv,
    m2_inv (modular inverses) are precomputed modular inverse of m1 and m2.
    The pre-computed values are appended to the hash_seed ByteArray in
    ReadOnlyRoots and accessed in generated code to reduce overhead.
    In call sites that don't already have access to the seeds, we read them
    from the current isolate group/isolate's read only roots.

    To consolidate the code that encode/decode these hashes, this patch
    adds MakeArrayIndexHash/DecodeArrayIndexFromHashField in C++ and CSA
    that perform seeding/unseeding if enabled, and updates places where
    encoding/decoding of array index is needed to use them.

    Bug: 477515021
    Change-Id: I350afe511951a54c4378396538152cc56565fd55
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7564330
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Cr-Commit-Position: refs/heads/main@{#105596}

deps: V8: cherry-pick aac14dd95e5b

Original commit message:

    [string] add 3rd round to seeded array index hash

    Since we already have 3 derived secrets, and arithmetics are
    relatively cheap, add a 3rd round to the xorshift-multiply
    seeding scheme. This brings the bias from ~3.4 to ~0.4.

    Bug: 477515021
    Change-Id: I1ef48954bcee8768d8c90db06ac8adb02f06cebf
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7655117
    Reviewed-by: Chengzhong Wu <cwu631@bloomberg.net>
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#105824}

Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com>
Refs: https://hackerone.com/reports/3511792
Refs: https://github.com/v8/v8/commit/aac14dd95e5be0d487eba6bcdaf9cef4f8bd806c
PR-URL: https://github.com/nodejs/node/pull/61898
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-04-24 18:01:34 +02:00
Abdirahim Musse b07bc44831 deps: fix V8 race condition for AIX
aix: simplify OS::DecommitPages implementation

Replace complex mmap/munmap retry logic with mprotect + madvise
approach.

This fixes a race condition that was causing test failures in Node.js.
Node.js stress test was run with this fix and testing shows
0 failures out of 1000 runs of wpt/test-wasm-jsapi with this
patch compared to 224 failures without it.

Refs: https://github.com/nodejs/node/issues/62647
Refs: https://chromium-review.googlesource.com/c/v8/v8/+/7780464
PR-URL: https://github.com/nodejs/node/pull/61898
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-04-24 18:01:33 +02:00
LuYahan 8405ee9fe4 deps: V8: cherry-pick cd2c216e7658
Original commit message:

    [riscv][jspi] Clear EPT entry on stack return

    Port commit 54cf5fa964f0734a8277ea2837aa2e4168e3240a
    Bug: 485784597

    Change-Id: I4a7e12d9047f7a4257be4711d9d6645d42f02a38
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7608971
    Commit-Queue: Ji Qiu <qiuji@iscas.ac.cn>
    Reviewed-by: Ji Qiu <qiuji@iscas.ac.cn>
    Cr-Commit-Position: refs/heads/main@{#105464}

Refs: https://github.com/v8/v8/commit/cd2c216e7658c19bc6501fc785ac2f4be1a3734f
PR-URL: https://github.com/nodejs/node/pull/61898
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-04-24 18:01:33 +02:00
Igor SheludkoandMichaël Zasso 4dafa6891a deps: V8: backport 088b7112e7ab
Original commit message:

    [runtime] Fix contextual stores to global with interceptor

    According to the spec, contextual store in strict mode must first
    check whether property exists and if not, the ReferenceError
    should be thrown instead of calling the interceptor setter. See
    https://tc39.es/ecma262/#sec-object-environment-records-setmutablebinding-n-v-s

    Drive-by:
     - introduce new Api v8::Object::GetPropertyAttributes(..) which is
       able to return "property does not exist" result, which wasn't
       possible with the existing GetPropertyAttributes(..) Api,
     - update GenericInterceptor* callbacks in test-api-interceptors.cc
       to better suite for implementing a proxy-like interceptor.

    Bug: 455600234
    Change-Id: I0986c18c406844f58c453e7aa7513c52a9097e04
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7718821
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Commit-Queue: Igor Sheludko <ishell@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#106322}

Refs: https://github.com/v8/v8/commit/088b7112e7ab9a38431ca15674890b7c00b7a38d
Co-authored-by: Michaël Zasso <targos@protonmail.com>
PR-URL: https://github.com/nodejs/node/pull/61898
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-04-24 18:01:33 +02:00
Joyee Cheung 2387042c11 deps: V8: cherry-pick 00f6e834029f
Original commit message:

    [runtime] always sort transition arrays during rehashing

    After rehashing, the arrays are no longer in hash-sorted order.
    In this case, we need to force a re-sort even for small arrays,
    so that subsequent linear searches can find the correct transition
    and avoid inserting duplicates.

    Refs: https://github.com/nodejs/node/pull/61898#issuecomment-4168690640
    Change-Id: Ia813d1fb9d23e08012811d672052d235c0e0bf4d
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7723678
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Reviewed-by: Igor Sheludko <ishell@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#106255}

Refs: https://github.com/v8/v8/commit/00f6e834029f472ac98514b16a61b5393eb591d9
PR-URL: https://github.com/nodejs/node/pull/61898
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-04-24 18:01:33 +02:00
Joyee CheungandJoyee Cheung 13fb819110 deps: V8: backport bef0d9c1bc90
Original commit message:

    [api] Add V8::GetWasmMemoryReservationSizeInBytes()

    When the system does not have enough virtual memory for the wasm
    cage, installing the trap handler would cause any code allocating
    wasm memory to throw. Therefore it's useful for the embedder to
    know when the system doesn't have enough virtual address space
    to allocate enough wasm cages and in that case, skip the
    trap handler installation so that wasm code can at least work
    (even not at the maximal performance).

    Node.js previously has a command line option
    --disable-wasm-trap-handler to fully disable trap-based bound checks,
    this new API would allow it to adapt automatically while keeping the
    optimization in the happy path, since it's not always possible for
    end users to opt-into disabling trap-based bound checks (for example,
    when a VS Code Server is loaded in a remote server for debugging).

    Refs: https://github.com/nodejs/node/pull/62132
    Refs: https://github.com/microsoft/vscode/issues/251777
    Change-Id: I345c076af2b2b47700e5716b49c3133fdf8a0981
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7638233
    Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
    Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#105702}

Refs: https://github.com/v8/v8/commit/bef0d9c1bc90357ef5e654b25fcb4ef9f74b591c
Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com>
Refs: https://github.com/microsoft/vscode/issues/251777
Refs: https://chromium-review.googlesource.com/c/v8/v8/+/7638233
PR-URL: https://github.com/nodejs/node/pull/61898
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-04-24 18:01:32 +02:00
Richard Lau cc5a331715 deps: V8: cherry-pick cf1bce40a5ef
Original commit message:

    [wasm] Fix S128Const on big endian

    Since http://crrev.com/c/2944437 globals are no longer little endian
    enforced.

    S128Const handling in the initializer needs to take this into account
    and byte reverse values which are hard coded in little endian order.

    This is currently causing failures on Node.js upstream:
    https://github.com/nodejs/node/pull/59034#issuecomment-4129144461

    Change-Id: Ifcc9ade93ee51565ab19b16e9dadf0ff5752f7a6
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7704213
    Commit-Queue: Milad Farazmand <mfarazma@ibm.com>
    Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#106082}

Refs: https://github.com/v8/v8/commit/cf1bce40a5ef4c7c1da351754f5bf526c0c96463
Refs: https://github.com/v8/v8/commit/cf1bce40a5ef4c7c1da351754f5bf526c0c96463
PR-URL: https://github.com/nodejs/node/pull/61898
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-04-24 18:01:32 +02:00
Milad Fa e6f9cd58a7 deps: V8: cherry-pick daf4656ba85e
Original commit message:

    Mark MemCopyAndSwitchEndianness src input as `const`

    Needed after this CL: http://crrev.com/c/7600437
    Currently getting the following error:
    ```
    candidate function not viable: no known conversion from 'const unsigned char *' to 'void *'
    ```

    Change-Id: I0c0f065b822e0f95ffd06207d280fc8b7bab4403
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7601332
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Commit-Queue: Milad Farazmand <mfarazma@ibm.com>
    Cr-Commit-Position: refs/heads/main@{#105413}

Refs: https://github.com/v8/v8/commit/daf4656ba85e7b9bf63ff5e95cb757406eec20fd
PR-URL: https://github.com/nodejs/node/pull/61898
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-04-24 18:01:32 +02:00
Joyee CheungandRené d40be95a2b deps: V8: cherry-pick d83f479604c8
Original commit message:

    Fix compilation for older version of libstdc++

    On older versions of libstdc++, cmath didn't expose std::powl.
    Use std::pow instead.

    Co-Authored-By: René <contact.9a5d6388@renegade334.me.uk>
    Refs: https://gcc.gnu.org/pipermail/libstdc++/2023-February/055493.html
    Refs: https://github.com/nodejs/node/pull/61898
    Change-Id: I4587e14525cae68a05eda03c36b0af40759d9b64
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7666244
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Reviewed-by: Jakob Linke <jgruber@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#105884}

Refs: https://github.com/v8/v8/commit/d83f479604c8cf0e74b7e73e795adbd6f86549f2
PR-URL: https://github.com/nodejs/node/pull/61898
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-04-24 18:01:32 +02:00
Joyee Cheung 38d98c3754 deps: V8: cherry-pick edeb0a4fa181
Original commit message:

    Zero-initialize proxy padding

    So that snapshots with proxies can be reproducible.

    Refs: https://github.com/nodejs/node/pull/61898
    Change-Id: I01fac5e18c73cd482a1ae63750dbadf42a12e08a
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7666243
    Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Cr-Commit-Position: refs/heads/main@{#105830}

Refs: https://github.com/v8/v8/commit/edeb0a4fa181d2eace3c3d2fa039584dc6ac2ea6
PR-URL: https://github.com/nodejs/node/pull/61898
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-04-24 18:01:32 +02:00
Richard Lau ec508ddf38 deps: V8: cherry-pick aa0b288f87cc
Original commit message:

    PPC/S390: [wasm] Fix jump table offset when patching

    ... need to make sure patching of target occurs at the correct spot
    based on what `EmitFarJumpSlot` emits. Also mask the branch offset in
    PPC64 EmitJumpSlot to match `Assembler::b()`.

    Change-Id: I5a8079d0079d8ad427034761d42c90b64d5746dd
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7642190
    Reviewed-by: John <junyan1@ibm.com>
    Commit-Queue: Milad Farazmand <mfarazma@ibm.com>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#105646}

Refs: https://github.com/v8/v8/commit/aa0b288f87ccfc2ad25f5d828af6627a7dccc9cb
PR-URL: https://github.com/nodejs/node/pull/61898
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-04-24 18:01:31 +02:00
StefanStojanovic 512c5aae35 deps: patch V8 to fix Windows build
PR-URL: https://github.com/nodejs/node/pull/61898
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-04-24 18:01:31 +02:00
Richard Lau 4ec8aa0422 deps: V8: cherry-pick highway@989a498fdf3
Original commit message:

    GCC 15 removed avx10.2-512 target

    PiperOrigin-RevId: 823560321

Refs: https://github.com/google/highway/commit/989a498fdf3e2b758c48998e87a2807a1a53e494
Fixes: https://github.com/nodejs/node/issues/60566
PR-URL: https://github.com/nodejs/node/pull/61898
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-04-24 18:01:31 +02:00
Dan McDonald 2bae6acd77 deps: support madvise(3C) across ALL illumos revisions
In illumos, madvise(3C) now takes `void *` for its first argument
post-illumos#14418, but uses `caddr_t` pre-illumos#14418. This fix will
detect if the illumos mman.h file in use is pre-or-post-illumos#14418 so
builds can work either way.

PR-URL: https://github.com/nodejs/node/pull/61898
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-04-24 18:01:31 +02:00
Dan McDonald 593bb51f92 deps: patch V8 for illumos
illumos pointers are VA48, can allocate from the top of the 64-bit range
as well.

PR-URL: https://github.com/nodejs/node/pull/61898
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-04-24 18:01:31 +02:00
Michaël Zasso 232fc89433 deps: remove problematic comment from v8-internal
GCC emits warnings because of the trailing backslashes.

PR-URL: https://github.com/nodejs/node/pull/61898
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-04-24 18:01:30 +02:00
Stefan Stojanovic add506a7a1 deps: define V8_PRESERVE_MOST as no-op on Windows
It's causing linker errors with node.lib in node-gyp and potentially
breaks other 3rd party tools

Refs: https://github.com/nodejs/node/pull/55784
PR-URL: https://github.com/nodejs/node/pull/61898
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-04-24 18:01:30 +02:00
Michaël Zasso b6a9674ffb deps: patch V8 to avoid duplicated zlib symbol
PR-URL: https://github.com/nodejs/node/pull/61898
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-04-24 18:01:30 +02:00
Michaël Zasso 72bc9b4c5f build: reset embedder string to "-node.0"
PR-URL: https://github.com/nodejs/node/pull/61898
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
2026-04-24 18:01:30 +02:00
Stefan Stojanovic 262dee503a build,win: enable x64 PGO
PR-URL: https://github.com/nodejs/node/pull/62761
Refs: https://github.com/nodejs/node/issues/61964
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2026-04-23 12:43:51 +00:00
Abdirahim Musse acb1bd7107 deps: V8: cherry-pick fcf8b990c73c
Original commit message:

    aix: add required changes to build with clang

    Change-Id: Icc78c58831306aa2f227843b0b4ec2321585fa64
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7107287
    Reviewed-by: Toon Verwaest <verwaest@chromium.org>
    Commit-Queue: Clemens Backes <clemensb@chromium.org>
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#104364}

Refs: https://github.com/v8/v8/commit/fcf8b990c73c4d22cf90d3cdcec448af79a90ae6
PR-URL: https://github.com/nodejs/node/pull/62894
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Abdirahim Musse <abdirahim.musse@ibm.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-04-22 23:52:19 +00:00
Richard Lau c028766723 Revert "deps: V8: cherry-pick 7107287"
This reverts commit 142b593485.

PR-URL: https://github.com/nodejs/node/pull/62894
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Abdirahim Musse <abdirahim.musse@ibm.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
2026-04-22 23:52:18 +00:00
Paolo Insogna 75606703e8 build: add --enable-all-experimentals build flag
Signed-off-by: Paolo Insogna <paolo@cowtech.it>
PR-URL: https://github.com/nodejs/node/pull/62755
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2026-04-20 09:21:27 +00:00
Abdirahim Musse 142b593485 deps: V8: cherry-pick 7107287
Original commit message:

    aix: add required changes to build with clang

    Change-Id: Icc78c58831306aa2f227843b0b4ec2321585fa64
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7107287
    Reviewed-by: Toon Verwaest <verwaest@chromium.org>
    Commit-Queue: Clemens Backes <clemensb@chromium.org>
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#104364}

PR-URL: https://github.com/nodejs/node/pull/62656
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2026-04-16 13:24:41 +00:00
Abdirahim Musse 48a442be08 build: aix add conditonal flags for clang builds
Some gcc flags dont work on clang:

-mfprnd
-mno-popcntb
-fno-extern-tls-init

So now we conditionally add them when clang is not enabled

Also for clang builds we need to pass some additonal flags:

-fno-integrated-as
-fno-xl-pragma-pack

These flags are discuessed in:
https://chromium-review.googlesource.com/c/chromium/src/+/7120638

PR-URL: https://github.com/nodejs/node/pull/62656
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2026-04-16 13:24:37 +00:00
Daniel Lando 91d83c3bfe build: remove redundant -fuse-linker-plugin from GCC LTO flags
The `-fuse-linker-plugin` flag has been automatically enabled by GCC
since version 5 when LTO is active, making the explicit flag
redundant. Since Node.js requires GCC >= 13.2, this flag serves no
purpose.

Removing it also improves portability with alternative linkers (mold,
lld) that may not support GCC's linker plugin interface, avoiding
build failures when these linkers are used with GCC LTO builds.

Refs: https://github.com/yao-pkg/pkg/issues/231
Signed-off-by: Daniel Lando <daniel.sorridi@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/62667
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2026-04-13 11:43:12 +00:00
Yagiz Nizipli 8ea96e6532 deps: V8: cherry-pick b25cd62c7ba2
Original commit message:

    Optimize utf8length for utf16 values

    Change-Id: I4d9546ab45264852f52361123e86fa3b38d79e45
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7142019
    Reviewed-by: Anton Bikineev <bikineev@chromium.org>
    Reviewed-by: Erik Corry <erikcorry@chromium.org>
    Commit-Queue: Erik Corry <erikcorry@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#103754}

Refs: https://github.com/v8/v8/commit/b25cd62c7ba2a9c1fa76906d135832ae09d0a674
PR-URL: https://github.com/nodejs/node/pull/62354
Refs: https://github.com/nodejs/node/pull/61601
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-03-28 14:43:51 +01:00
Joyee Cheung 0d7e4b1d4b build,test: test array index hash collision
This enables v8_enable_seeded_array_index_hash and add a test for it.

Fixes: https://hackerone.com/reports/3511792

deps: V8: backport 0a8b1cdcc8b2

Original commit message:

    implement rapidhash secret generation

    Bug: 409717082
    Change-Id: I471f33d66de32002f744aeba534c1d34f71e27d2
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6733490
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Commit-Queue: snek <snek@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#101499}

Refs: https://github.com/v8/v8/commit/0a8b1cdcc8b243c62cf045fa8beb50600e11758a
Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com>

deps: V8: backport 185f0fe09b72

Original commit message:

    [numbers] Refactor HashSeed as a lightweight view over ByteArray

    Instead of copying the seed and secrets into a struct with value
    fields, HashSeed now stores a pointer pointing either into the
    read-only ByteArray, or the static default seed for off-heap
    HashSeed::Default() calls. The underlying storage is always
    8-byte aligned so we can cast it directly into a struct.

    Change-Id: I5896a7f2ae24296eb4c80b757a5d90ac70a34866
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7609720
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Cr-Commit-Position: refs/heads/main@{#105531}

Refs: https://github.com/v8/v8/commit/185f0fe09b72fb869fdcf9a89f40ff2295436bca
Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com>

deps: V8: backport 1361b2a49d02

Original commit message:

    [strings] improve array index hash distribution

    Previously, the hashes stored in a Name's raw_hash_field for decimal
    numeric strings (potential array indices) consist of the literal
    integer value along with the length of the string. This means
    consecutive numeric strings can have consecutive hash values, which
    can lead to O(n^2) probing for insertion in the worst case when e.g.
    a non-numeric string happen to land in the these buckets.

    This patch adds a build-time flag v8_enable_seeded_array_index_hash that
    scrambles the 24-bit array-index value stored in a Name's raw_hash_field
    to improve the distribution.

    x ^= x >> kShift; x = (x * m1) & kMask;    // round 1
    x ^= x >> kShift; x = (x * m2) & kMask;    // round 2
    x ^= x >> kShift;                          // finalize

    To decode, apply the same steps with the modular inverses of m1 and m2
    in reverse order.

    x ^= x >> kShift; x = (x * m2_inv) & kMask;    // round 1
    x ^= x >> kShift; x = (x * m1_inv) & kMask;    // round 2
    x ^= x >> kShift;                              // finalize

    where kShift = kArrayIndexValueBits / 2, kMask = kArrayIndexValueMask,
    m1, m2 (both odd) are the lower bits of the rapidhash secrets, m1_inv,
    m2_inv (modular inverses) are precomputed modular inverse of m1 and m2.
    The pre-computed values are appended to the hash_seed ByteArray in
    ReadOnlyRoots and accessed in generated code to reduce overhead.
    In call sites that don't already have access to the seeds, we read them
    from the current isolate group/isolate's read only roots.

    To consolidate the code that encode/decode these hashes, this patch
    adds MakeArrayIndexHash/DecodeArrayIndexFromHashField in C++ and CSA
    that perform seeding/unseeding if enabled, and updates places where
    encoding/decoding of array index is needed to use them.

    Bug: 477515021
    Change-Id: I350afe511951a54c4378396538152cc56565fd55
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7564330
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Cr-Commit-Position: refs/heads/main@{#105596}

Refs: https://github.com/v8/v8/commit/1361b2a49d020a718dc5495713eae0fa67d697b9
Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com>

deps: V8: cherry-pick aac14dd95e5b

Original commit message:

    [string] add 3rd round to seeded array index hash

    Since we already have 3 derived secrets, and arithmetics are
    relatively cheap, add a 3rd round to the xorshift-multiply
    seeding scheme. This brings the bias from ~3.4 to ~0.4.

    Bug: 477515021
    Change-Id: I1ef48954bcee8768d8c90db06ac8adb02f06cebf
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7655117
    Reviewed-by: Chengzhong Wu <cwu631@bloomberg.net>
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#105824}

Refs: https://github.com/v8/v8/commit/aac14dd95e5be0d487eba6bcdaf9cef4f8bd806c
PR-URL: https://github.com/nodejs-private/node-private/pull/834
CVE-ID: CVE-2026-21717

deps: V8: backport 185f0fe09b72

Original commit message:

    [numbers] Refactor HashSeed as a lightweight view over ByteArray

    Instead of copying the seed and secrets into a struct with value
    fields, HashSeed now stores a pointer pointing either into the
    read-only ByteArray, or the static default seed for off-heap
    HashSeed::Default() calls. The underlying storage is always
    8-byte aligned so we can cast it directly into a struct.

    Change-Id: I5896a7f2ae24296eb4c80b757a5d90ac70a34866
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7609720
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Cr-Commit-Position: refs/heads/main@{#105531}

Refs: https://github.com/v8/v8/commit/185f0fe09b72fb869fdcf9a89f40ff2295436bca
Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com>

deps: V8: backport 1361b2a49d02

Original commit message:

    [strings] improve array index hash distribution

    Previously, the hashes stored in a Name's raw_hash_field for decimal
    numeric strings (potential array indices) consist of the literal
    integer value along with the length of the string. This means
    consecutive numeric strings can have consecutive hash values, which
    can lead to O(n^2) probing for insertion in the worst case when e.g.
    a non-numeric string happen to land in the these buckets.

    This patch adds a build-time flag v8_enable_seeded_array_index_hash that
    scrambles the 24-bit array-index value stored in a Name's raw_hash_field
    to improve the distribution.

    x ^= x >> kShift; x = (x * m1) & kMask;    // round 1
    x ^= x >> kShift; x = (x * m2) & kMask;    // round 2
    x ^= x >> kShift;                          // finalize

    To decode, apply the same steps with the modular inverses of m1 and m2
    in reverse order.

    x ^= x >> kShift; x = (x * m2_inv) & kMask;    // round 1
    x ^= x >> kShift; x = (x * m1_inv) & kMask;    // round 2
    x ^= x >> kShift;                              // finalize

    where kShift = kArrayIndexValueBits / 2, kMask = kArrayIndexValueMask,
    m1, m2 (both odd) are the lower bits of the rapidhash secrets, m1_inv,
    m2_inv (modular inverses) are precomputed modular inverse of m1 and m2.
    The pre-computed values are appended to the hash_seed ByteArray in
    ReadOnlyRoots and accessed in generated code to reduce overhead.
    In call sites that don't already have access to the seeds, we read them
    from the current isolate group/isolate's read only roots.

    To consolidate the code that encode/decode these hashes, this patch
    adds MakeArrayIndexHash/DecodeArrayIndexFromHashField in C++ and CSA
    that perform seeding/unseeding if enabled, and updates places where
    encoding/decoding of array index is needed to use them.

    Bug: 477515021
    Change-Id: I350afe511951a54c4378396538152cc56565fd55
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7564330
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Cr-Commit-Position: refs/heads/main@{#105596}

Refs: https://github.com/v8/v8/commit/1361b2a49d020a718dc5495713eae0fa67d697b9
Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com>

deps: V8: cherry-pick aac14dd95e5b

Original commit message:

    [string] add 3rd round to seeded array index hash

    Since we already have 3 derived secrets, and arithmetics are
    relatively cheap, add a 3rd round to the xorshift-multiply
    seeding scheme. This brings the bias from ~3.4 to ~0.4.

    Bug: 477515021
    Change-Id: I1ef48954bcee8768d8c90db06ac8adb02f06cebf
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7655117
    Reviewed-by: Chengzhong Wu <cwu631@bloomberg.net>
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#105824}

Refs: https://github.com/v8/v8/commit/aac14dd95e5be0d487eba6bcdaf9cef4f8bd806c
2026-03-24 19:50:03 -03:00
Richard Lau a0d8ea42e5 deps: V8: cherry-pick aa0b288f87cc
Original commit message:

    PPC/S390: [wasm] Fix jump table offset when patching

    ... need to make sure patching of target occurs at the correct spot
    based on what `EmitFarJumpSlot` emits. Also mask the branch offset in
    PPC64 EmitJumpSlot to match `Assembler::b()`.

    Change-Id: I5a8079d0079d8ad427034761d42c90b64d5746dd
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7642190
    Reviewed-by: John <junyan1@ibm.com>
    Commit-Queue: Milad Farazmand <mfarazma@ibm.com>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#105646}

Refs: https://github.com/v8/v8/commit/aa0b288f87ccfc2ad25f5d828af6627a7dccc9cb
PR-URL: https://github.com/nodejs/node/pull/62136
Reviewed-By: Aviv Keller <me@aviv.sh>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Gürgün Dayıoğlu <hey@gurgun.day>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2026-03-09 03:18:27 +00:00
Vivian Wangandkxxt b220fbe455 deps: V8: backport 6a0a25abaed3
Original commit message:

    [riscv] Fix sp handling in MacroAssembler::LeaveFrame

    Keep sp <= fp to ensure that data right above fp doesn't get clobbered
    by an inopportune signal and its handler.

    Such clobbering can happen in e.g. Node.js when JIT-compiled code is
    interrupted by a SIGCHLD handler.

    Bug: None
    Change-Id: Ief0836032ada7942e89f081f7605f61632c4d414
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7540554
    Reviewed-by: Ji Qiu <qiuji@iscas.ac.cn>
    Commit-Queue: Yahan Lu (LuYahan) <yahan@iscas.ac.cn>
    Reviewed-by: Rezvan Mahdavi Hezaveh <rezvan@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#105069}

Refs: https://github.com/v8/v8/commit/6a0a25abaed397f83eb0d92e4b33a5e18204f8bc
Co-authored-by: kxxt <rsworktech@outlook.com>
PR-URL: https://github.com/nodejs/node/pull/61666
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2026-02-08 14:23:33 +01:00
Chengzhong Wu 859332bf76 deps: V8: cherry-pick c5ff7c4d6cde
Original commit message:

    [builtins] disallow ArrayBuffer transfer with a detach key

    This allows embedder to disallow `ArrayBuffer.prototype.transfer()` on
    an arraybuffer that is not detachable. This also fix the check on
    `ArrayBufferCopyAndDetach` step 8 of `ArrayBuffer.prototype.transfer`.

    Refs: https://github.com/nodejs/node/issues/61362
    Refs: https://tc39.es/ecma262/#sec-arraybuffercopyanddetach
    Change-Id: I3c6e156a8fad007fd100218d8b16aed5c4e1db68
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7454288
    Commit-Queue: Chengzhong Wu <cwu631@bloomberg.net>
    Reviewed-by: Olivier Flückiger <olivf@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#104697}

Refs: https://github.com/v8/v8/commit/c5ff7c4d6cdea06d0319609875c41eaa77b70db0
PR-URL: https://github.com/nodejs/node/pull/61372
Fixes: https://github.com/nodejs/node/issues/61362
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
2026-01-28 16:32:54 +00:00
Stewart X Addison b0ae89c6c5 gyp: aix: change gcc version detection so CXX="ccache g++" works
Signed-off-by: Stewart X Addison <sxa@ibm.com>
PR-URL: https://github.com/nodejs/node/pull/61464
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2026-01-23 16:21:32 +00:00
Richard Lau da71ab6895 deps: V8: cherry-pick highway@989a498fdf3
Original commit message:

    GCC 15 removed avx10.2-512 target

    PiperOrigin-RevId: 823560321

Refs: https://github.com/google/highway/commit/989a498fdf3e2b758c48998e87a2807a1a53e494
PR-URL: https://github.com/nodejs/node/pull/60682
Fixes: https://github.com/nodejs/node/issues/60566
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Xuguang Mei <meixuguang@gmail.com>
2025-11-13 19:32:11 +00:00
Abdirahim MusseandMichaël Zasso bf5c6a8bd4 deps: V8: backport 151d0a44a1b2
Original commit message:

    Fix gcc build

    For json-parser.h:

    ```
    ../../src/json/json-parser.h:298:13: error: explicit specialization in
    non-namespace scope 'class v8::internal::JsonParser<Char>'
      298 |   template <>
          |             ^
    ../../src/json/json-parser.h:299:18: error: template-id
    'IsNextToken<v8::internal::JsonToken::EOS>' in declaration of primary template
      299 |   V8_INLINE bool IsNextToken<JsonToken::EOS>() {
          |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    ```

    For wasm-objects.cc:
    ```
    ../../src/wasm/wasm-objects.cc:2522:45: error: no matching function for call to
    'v8::internal::WasmDispatchTable::SetForNonWrapper<v8::internal::WasmDispatchTable>(
     v8::internal::WasmDispatchTable&, int&, v8::internal::Tagged<v8::internal::
     Union<v8::internal::Smi, v8::internal::WasmTrustedInstanceData> >&,
     v8::internal::WasmCodePointer&, v8::internal::wasm::CanonicalTypeIndex&,
     v8::internal::WasmDispatchTable::NewOrExistingEntry&)'
    ```

    ```
    error: no matching function for call to 'v8::internal::WasmDispatchTable::
    SetForWrapper<v8::internal::WasmDispatchTable>(v8::internal::WasmDispatchTable&,
    int&, v8::internal::Tagged<v8::internal::WasmImportData>&, std::shared_ptr<v8::
    internal::wasm::WasmImportWrapperHandle>&, v8::internal::wasm::
    CanonicalTypeIndex&, v8::internal::WasmDispatchTable::NewOrExistingEntry&)'
    ```

    For the fix fully qualify calls to SetForWrapper and SetForNonWrapper with
    ::v8::internal:: to avoid accidental lookup of class member names.
    This resolves template resolution errors caused by unqualified
    calls inside WasmDispatchTable and WasmDispatchTableForImports
    member functions.

    Change-Id: I687935a05dc754db686deaa0f93079d350aae07e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7107891
    Reviewed-by: Patrick Thier <pthier@chromium.org>
    Reviewed-by: Manos Koukoutos <manoskouk@chromium.org>
    Commit-Queue: Milad Farazmand <mfarazma@ibm.com>
    Cr-Commit-Position: refs/heads/main@{#103547}

Refs: https://github.com/v8/v8/commit/151d0a44a1b2fa5dcdc1282101f71916f303aae6
Co-authored-by: Michaël Zasso <targos@protonmail.com>
PR-URL: https://github.com/nodejs/node/pull/60488
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
2025-11-13 15:09:33 +01:00
Jakob Kummerow b59af772dc deps: V8: cherry-pick 47800791b35c
Original commit message:

    [wasm] Fix DCHECK in AtomicWait after memory growth

    With the changes in crrev.com/c/7003085, calling memory.grow()
    via the JS API didn't immediately update the memory's array buffer
    any more, which triggered a DCHECK in the runtime functions for
    atomic waits. This patch restores immediate updating of the buffer
    for the current isolate, which maintains the other CL's goal to
    not allocate on loop back edges.

    Fixed: 454991459
    Change-Id: Id633cebb9ac24606bc0d8a3df703c74531d3c8a0
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7100806
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Commit-Queue: Clemens Backes <clemensb@chromium.org>
    Auto-Submit: Jakob Kummerow <jkummerow@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#103431}

Refs: https://github.com/v8/v8/commit/47800791b35c528de165a082daf4c94744bc0c58
PR-URL: https://github.com/nodejs/node/pull/60488
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
2025-11-13 15:09:30 +01:00
Michaël Zasso 6494c7bcad deps: V8: backport 2e4c5cf9b112
Original commit message:

    remove ppc and s390 from the host_arch list

    We only support ppc64 and s390x.
    Same changes is applied to depot_tools:
    http://crrev.com/c/7100932

    Change-Id: I1e4b660a1e46d1c609189301e8fd977fb7434748
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7102361
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Commit-Queue: Milad Farazmand <mfarazma@ibm.com>
    Reviewed-by: Thibaud Michaud <thibaudm@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#103488}

Refs: https://github.com/v8/v8/commit/2e4c5cf9b1125a25c1b9107c9d81fec2d77b1135
Fixes: https://github.com/nodejs/build/issues/4184
Co-authored-by: Michaël Zasso <targos@protonmail.com>
PR-URL: https://github.com/nodejs/node/pull/60654
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Stewart X Addison <sxa@redhat.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2025-11-13 15:09:26 +01:00