0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-30 15:30:56 +01:00
Commit Graph

865 Commits

Author SHA1 Message Date
Joyee Cheung
399dd8e6c4 deps: V8: cherry-pick c1a54d5ffcd1
Original commit message:

    Skip regress-1320641 when the system does not have enough memory

    Change-Id: I23a5232f6437c4bc77390796ee2986f1600cb1bf
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4689686
    Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
    Commit-Queue: Joyee Cheung <joyee@igalia.com>
    Cr-Commit-Position: refs/heads/main@{#88973}

Refs: c1a54d5ffc
PR-URL: https://github.com/nodejs/node/pull/48830
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
2023-07-20 19:50:20 +00:00
Ivan Trubach
78e42e46ec
build: do not pass target toolchain flags to host toolchain
Fixes target toolchain arguments being passed to the host toolchain when
cross-compiling. For example, -m64 is not available on aarch64.

PR-URL: https://github.com/nodejs/node/pull/48597
Reviewed-By: Richard Lau <rlau@redhat.com>
2023-07-12 14:57:05 +00:00
Chengzhong Wu
38dee8a1c0
src: distinguish HTML transferable and cloneable
The HTML structured serialize algorithm treats transferable and
serializable as two different bits. A web platform interface can be
both transferable and serializable.

Splits BaseObject::TransferMode to be able to compose the two bits
and distinguishes the transferable and cloneable.

PR-URL: https://github.com/nodejs/node/pull/47956
Refs: cf13b9b465
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
2023-07-07 17:00:00 +00:00
Keyhan Vakil
ce4102e8a5 deps: V8: cherry-pick 1a782f6543ae
Original commit message:

    [base] add build flag to use MADV_DONTFORK

    Embedders like Node.js and Electron expose fork(2)/execve(2) to their
    users. Unfortunately when the V8 heap is very large, these APIs become
    rather slow on Linux, due to the kernel needing to do all the
    bookkeeping for the forked process (in clone's dup_mmap and execve's
    exec_mmap). Of course, this is useless because the forked child thread
    will never actually need to access the V8 heap.

    Add a new build flag v8_enable_private_mapping_fork_optimization which
    marks all pages allocated by OS::Allocate as MADV_DONTFORK. This
    improves the performance of Node.js's fork/execve combination by 10x on
    a 600 MB heap.

    Fixed: v8:7381
    Change-Id: Ib649f774d4a932b41886313ce89acc369923699d
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4602858
    Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
    Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#88447}

Refs: 1a782f6543
PR-URL: https://github.com/nodejs/node/pull/48523
Fixes: https://github.com/nodejs/node/issues/25382
Fixes: https://github.com/nodejs/node/issues/14917
Refs: https://github.com/nodejs/performance/issues/93
Refs: https://github.com/nodejs/performance/issues/89
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
2023-06-24 17:34:44 +00:00
Michaël Zasso
38d261ae66
deps: V8: cherry-pick 5f025d1ca2ca
Original commit message:

    [wasm] Fix deadlock in async wrapper compilation

    If compilation is cancelled while wrapper compilation is running, the
    tasks spawned for the {AsyncCompileJSToWasmWrapperJob} will return
    immediately, but {GetMaxConcurrency} will still return a positive
    value. Hence {Join()} will spawn another task, resulting in a
    livelock.

    We could fix this by checking for cancellation in {GetMaxConcurrency},
    but that requires taking the compilation state lock.
    So this CL fixes the issue by dropping the number of outstanding
    compilation units by to (basically) zero. We can't unconditionally drop
    to zero because another thread might concurrently execute a wrapper
    compilation and still call {CompleteUnit} afterwards. Hence only drop
    outstanding units by the amount of not-yet-started units.

    R=jkummerow@chromium.org

    Bug: v8:13858
    Change-Id: I5398ef370da2e7f212ca772fd1f87f659929dd6d
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4437531
    Commit-Queue: Clemens Backes <clemensb@chromium.org>
    Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#87143}

Refs: 5f025d1ca2
PR-URL: https://github.com/nodejs/node/pull/47610
Refs: https://github.com/nodejs/node/issues/47297
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-05-10 14:36:42 +02:00
Michaël Zasso
4b4a0c4d54
deps: V8: cherry-pick a8a11a87cb72
Original commit message:

    [wasm] Simplify CompileJSToWasmWrapperJob

    This CL merges some of AsyncCompileJSToWasmWrapperJob and
    CompileJSToWasmWrapperJob into a common base class. Both jobs now
    loop on a vector with an atomic index.

    Bug: chromium:1423615
    Change-Id: I7bb9cb2a57d8b659766c01e20e38d1b859d3a987
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4347597
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#86675}

Refs: a8a11a87cb
PR-URL: https://github.com/nodejs/node/pull/47610
Refs: https://github.com/nodejs/node/issues/47297
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-05-10 14:36:40 +02:00
Lu Yahan
4040a904de
deps: V8: cherry-pick 1b471b796022
Original commit message:

    [riscv] Using s8 as backtrack_stackpointer reg and optimize BranchShortHelper

    1. Fix incorrect backtrack_stackpointer reg.
    2. Optimize BranchShortHelper when comparing zero immediate.
    3. This is a workaround CL fix v8:13836

    Bug: v8:13836

    Change-Id: I4cfc9df92fcd38ecd448a41ee87d1e251efd4ad9
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4394942
    Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
    Reviewed-by: Ji Qiu <qiuji@iscas.ac.cn>
    Commit-Queue: Ji Qiu <qiuji@iscas.ac.cn>
    Cr-Commit-Position: refs/heads/main@{#86889}

Refs: 1b471b7960
PR-URL: https://github.com/nodejs/node/pull/47399
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-05-07 11:46:02 +00:00
Michaël Zasso
2a165505b7
deps: disable V8 concurrent sparkplug compilation
It introduces process hangs on some platforms because Node.js doesn't
tear down V8 correctly.
Disable it while we work on a solution.

Refs: https://github.com/nodejs/node/issues/47297
Refs: https://bugs.chromium.org/p/v8/issues/detail?id=13902
PR-URL: https://github.com/nodejs/node/pull/47450
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-05-01 12:40:30 +02:00
Richard Lau
212821afdd
deps: V8: cherry-pick c5ab3e4f0c5a
Original commit message:

    libstdc++: fix incomplete type in v8::internal::is_subtype<T, U>

    Using std::convertible with incomplete types is UB. However, till
    GCC 12 it was accepted and std::convertible returned false.
    This fails now for e.g. v8::internal::WasmArray. Use
    std::disjunction and std::conjunction instead which are short-
    circuiting, because std::is_base_of<T, T> is already true.

    Bug: chromium:957519
    Change-Id: Ia26643dbdf0fb00d5586c71ae6b18e8d0f3cf96e
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4394663
    Commit-Queue: Stephan Hartmann <stha09@googlemail.com>
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#86904}

Refs: c5ab3e4f0c
PR-URL: https://github.com/nodejs/node/pull/47736
Fixes: https://github.com/nodejs/node/issues/47623
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2023-04-28 19:58:09 +00:00
Jiawen Geng
4bcb42c16c
deps: V8: cherry-pick 8e10685ff918
Original commit message:

    [build]: fix wrong name

    Change-Id: I504e836da1e36d7b9e504dbdbff8803363f08ccd
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4392064
    Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
    Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#86919}

Refs: 8e10685ff9
PR-URL: https://github.com/nodejs/node/pull/47440
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2023-04-11 19:19:17 +00:00
Michaël Zasso
7eb0ac3cb6 deps: patch V8 to support compilation on win-arm64
PR-URL: https://github.com/nodejs/node/pull/47251
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2023-03-31 14:15:29 +00:00
Michaël Zasso
a7c129f286 deps: silence irrelevant V8 warning
PR-URL: https://github.com/nodejs/node/pull/45579
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/47251
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2023-03-31 14:15:28 +00:00
Michaël Zasso
6f5655a18e deps: always define V8_EXPORT_PRIVATE as no-op
dllexport introduces issues when compiling with MSVC.

PR-URL: https://github.com/nodejs/node/pull/47251
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2023-03-31 14:15:28 +00:00
Michaël Zasso
ab1614d280 build: reset embedder string to "-node.0"
PR-URL: https://github.com/nodejs/node/pull/47251
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2023-03-31 14:15:25 +00:00
Richard Lau
ca5c6029fb
deps: V8: cherry-pick 3e4952cb2a59
Original commit message:

    [test] fix uninitialized error

    In op1a.Equals(&op3) call, that->parameter() is undefined.
    which triggers uninitialized error from gcc.

    Change-Id: I87f1fcba3e57adbb5a1e745a3d787c62a87fd1d3
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4307714
    Commit-Queue: Toon Verwaest <verwaest@chromium.org>
    Reviewed-by: Toon Verwaest <verwaest@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#86267}

Refs: 3e4952cb2a
PR-URL: https://github.com/nodejs/node/pull/47236
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2023-03-28 10:47:10 -04:00
Debadree Chatterjee
8e203f1b03
deps: V8: cherry-pick 975ff4dbfd1b
Original commit message:

    fix GetPropertyNames for proxys with ownKeys trap

    Added checks to FilterProxyKeys function for when skip_indices is
    enabled.

    Bug: v8:13728
    Change-Id: Id096e32ef8e6c2344be9682e8222aea8790bd66d
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4333698
    Reviewed-by: Camillo Bruni <cbruni@chromium.org>
    Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#86548}

Refs: 975ff4dbfd
PR-URL: https://github.com/nodejs/node/pull/47209
Fixes: https://github.com/nodejs/node/issues/41714
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Erick Wendel <erick.workspace@gmail.com>
2023-03-24 07:20:31 +00:00
Xu Meng
a3211e18b4
build,test: add proper support for IBM i
Python 3.9 on IBM i now properly returns "os400" for sys.platform
instead of claiming to be AIX as it did previously. While the IBM i PASE
environment is compatible with AIX, it is a subset and has numerous
differences which makes it beneficial to distinguish, however this means
that it now needs explicit support here.

PR-URL: https://github.com/nodejs/node/pull/46739
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2023-02-22 04:18:56 +00:00
Michaël Zasso
1d5058d4bb
deps: V8: cherry-pick 90be99fab31c
Original commit message:

    [intl] Revert date formatting behavior change from ICU 72

    Replace U+202F with U+0020 after formatting date. This lets websites
    continue to work without any changes.

    This matches Firefox behavior, according to
    https://bugzilla.mozilla.org/show_bug.cgi?id=1806042#c17.

    Bug: chromium:1414292, chromium:1401829, chromium:1392814
    Change-Id: I7c2b58414d0890f8705e737f903403dc54e5fe57
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4237675
    Commit-Queue: Adam Klein <adamk@chromium.org>
    Reviewed-by: Shu-yu Guo <syg@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#85757}

Refs: 90be99fab3
PR-URL: https://github.com/nodejs/node/pull/46646
Refs: https://github.com/nodejs/node/issues/46123
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2023-02-20 12:10:28 +00:00
Lu Yahan
94199c8ab6
deps: V8: cherry-pick e39af94dd18e
Original commit message:

    [riscv64] Fix failed: vector[] index out of

    GenPCRelativeJumpAndLink doesn't use BlockTrampolinePoolScope.
    It inserts a BlockTrampolinePool which causes this error.

    And also alter debug info format.

    Change-Id: I160f13f4261fdcf1f7978bfce9b5169d363e6a10
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4032016
    Commit-Queue: Yahan Lu <yahan@iscas.ac.cn>
    Reviewed-by: ji qiu <qiuji@iscas.ac.cn>
    Commit-Queue: ji qiu <qiuji@iscas.ac.cn>
    Auto-Submit: Yahan Lu <yahan@iscas.ac.cn>
    Cr-Commit-Position: refs/heads/main@{#84316}

Refs: e39af94dd1
PR-URL: https://github.com/nodejs/node/pull/46142
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-01-19 08:59:13 +00:00
Aaron Friel
71b9f79223
deps: V8: cherry-pick 30861a39323d
Original commit message:

    [debug] Re-enable internal [[Scopes]] property

    We received feedback that the [[Scopes]] property has some legitimate
    use-cases not covered by the Scopes View during pause.

    We re-enable the feature for now and will remove the flag in a
    follow-up.

    R=bmeurer@chromium.org

    Bug: chromium:1365858
    Change-Id: Ibf279ae6c4f5ae492d03e9b4ee7316f6500508d9
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4099385
    Auto-Submit: Simon Zünd <szuend@chromium.org>
    Commit-Queue: Benedikt Meurer <bmeurer@chromium.org>
    Commit-Queue: Simon Zünd <szuend@chromium.org>
    Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#84800}

Refs: 30861a3932
PR-URL: https://github.com/nodejs/node/pull/45851
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2023-01-01 10:54:22 +00:00
Anna Henningsen
b66ae39c1e
deps: V8: backport 8ca9f77d0f7c
This fixes a crash when loading snapshots that contain empty
ArrayBuffer instances:

```js
const X = [];
X.push(new ArrayBuffer());
v8.startupSnapshot.setDeserializeMainFunction(() => {
  for (let i = 0; i < 1000000; i++) { // trigger GC
    X.push(new ArrayBuffer());
  }
})
```

Original commit message:

    [sandbox] Sandboxify JSArrayBuffer::extension external pointer

    Bug: chromium:1335043
    Change-Id: Id8e6883fc652b144f6380ff09b1c18e777e041c2
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3706626
    Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
    Reviewed-by: Igor Sheludko <ishell@chromium.org>
    Commit-Queue: Samuel Groß <saelo@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#84544}

Refs: 8ca9f77d0f
PR-URL: https://github.com/nodejs/node/pull/45871
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-12-21 12:00:47 +00:00
Yagiz Nizipli
894aff75be
deps: V8: cherry-pick bc831f8ba33b
Original commit message:

    [fastcall] Implement support for onebyte string arguments

    This CL adds one byte string specialization support for fast API call arguments.
    It introduces a kOneByteString variant to CTypeInfo.

    We see a ~6x improvement in Deno's TextEncoder#encode microbenchmark.
    Rendered results: https://divy-v8-patches.deno.dev/

    Bug: chromium:1052746
    Change-Id: I47c3a9e101cd18ddc6ad58f627db3a34231b60f7
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4036884
    Reviewed-by: Toon Verwaest <verwaest@chromium.org>
    Reviewed-by: Maya Lekova <mslekova@chromium.org>
    Commit-Queue: Maya Lekova <mslekova@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#84552}

Refs: bc831f8ba3
PR-URL: https://github.com/nodejs/node/pull/45788
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
2022-12-10 14:23:50 +00:00
Michaël Zasso
d6dae7420e deps: V8: cherry-pick f1c888e7093e
Original commit message:

    [base] Fix SmartOS build

    That platform doesn't have `malloc_usable_size`.

    Refs: https://github.com/nodejs/node-v8/issues/239
    Change-Id: I011dd8449d02b27219a32cba00132cd068069f50
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4026402
    Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
    Commit-Queue: Michaël Zasso <mic.besace@gmail.com>
    Cr-Commit-Position: refs/heads/main@{#84256}

Refs: f1c888e709
PR-URL: https://github.com/nodejs/node/pull/45230
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>

# Conflicts:
#	common.gypi
PR-URL: https://github.com/nodejs/node/pull/45579
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-11-27 17:27:22 +00:00
Michaël Zasso
56c436533e deps: fix V8 build on Windows with MSVC
PR-URL: https://github.com/nodejs/node/pull/45579
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-11-27 17:27:19 +00:00
Michaël Zasso
51ab98c71b deps: silence irrelevant V8 warning
PR-URL: https://github.com/nodejs/node/pull/45579
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-11-27 17:27:18 +00:00
Jiawen Geng
9f84d3eea8 deps: V8: fix v8-cppgc.h for MSVC
Refs: https://bugs.chromium.org/p/v8/issues/detail?id=12661
Refs: https://github.com/nodejs/node/issues/42375

PR-URL: https://github.com/nodejs/node/pull/42657
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/45579
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-11-27 17:27:17 +00:00
Jiawen Geng
f2318cd4b5 deps: fix V8 build issue with inline methods
PR-URL: https://github.com/nodejs/node/pull/35415
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>

deps: patch for v8 on windows

PR-URL: https://github.com/nodejs/node/pull/40010
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

deps: patch v8 for vs2019 in std17

PR-URL: https://github.com/nodejs/node/pull/40060
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>

deps: workaround debug link error on Windows

PR-URL: https://github.com/nodejs/node/pull/38807
Refs: https://github.com/nodejs/node/pull/38788
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ash Cripps <acripps@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/45579
2022-11-27 17:27:16 +00:00
Yagiz Nizipli
649f68fc1e build: reset embedder string to "-node.0"
PR-URL: https://github.com/nodejs/node/pull/45579
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-11-27 17:27:14 +00:00
Michaël Zasso
a97214497a
deps: V8: cherry-pick 2ada52cffbff
Original commit message:

    [intl] Enhance Date parser to take Unicode SPACE

    This is needed to prepare for the landing of ICU72.
    Allow U+202F in the Date String, which the toLocaleString("en-US")
    will generate w/ ICU72.

    Bug: v8:13494
    Change-Id: I41b83c4094ce3d0737a72dcd6310b52c68fdcdca
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4027341
    Reviewed-by: Yang Guo <yangguo@chromium.org>
    Reviewed-by: Jungshik Shin <jshin@chromium.org>
    Commit-Queue: Frank Tang <ftang@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#84308}

Refs: 2ada52cffb
Fixes: https://github.com/nodejs/node/issues/45171
PR-URL: https://github.com/nodejs/node/pull/45573
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2022-11-24 10:41:02 +00:00
Yagiz Nizipli
7e7c0ded64 deps: V8: cherry-pick 9df5ef70ff18
Original commit message:

    Add an `v8::ArrayBuffer::WasDetached` method to the C++ API

    V8's C++ API does not give a way to tell whether an ArrayBuffer has
    been detached from the `v8::ArrayBuffer` class. In fact, as far as can
    be told from the C++ API without running JS code, detached
    ArrayBuffers behave the same as zero-sized ArrayBuffers and there is
    no way to observe the difference. However, this difference can be
    observed in JS because constructing a TypedArray from a detached
    ArrayBuffer will throw.

    This change adds a `WasDetached` method to the `v8::ArrayBuffer` class
    to give embedders access to this information without having to run JS
    code.

    Bug: v8:13159
    Change-Id: I2bb1e380cee1cecd31f6d48ec3d9f28c03a8a673
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3810345
    Commit-Queue: Toon Verwaest <verwaest@chromium.org>
    Reviewed-by: Toon Verwaest <verwaest@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#83963}

Refs: 9df5ef70ff
PR-URL: https://github.com/nodejs/node/pull/45474
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/45230
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2022-11-19 09:11:40 +00:00
Michaël Zasso
3b39e386a1 deps: V8: cherry-pick f1c888e7093e
Original commit message:

    [base] Fix SmartOS build

    That platform doesn't have `malloc_usable_size`.

    Refs: https://github.com/nodejs/node-v8/issues/239
    Change-Id: I011dd8449d02b27219a32cba00132cd068069f50
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4026402
    Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
    Commit-Queue: Michaël Zasso <mic.besace@gmail.com>
    Cr-Commit-Position: refs/heads/main@{#84256}

Refs: f1c888e709
PR-URL: https://github.com/nodejs/node/pull/45230
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2022-11-19 09:11:39 +00:00
Michaël Zasso
219bc4bb86 deps: V8: cherry-pick 92a7385171bb
Original commit message:

    [heap] Fix 32bit msvc builds

    Size of ActiveSystemPages is 8 bytes even on 32bit builds, thus
    forcing 8 bytes alignment for MemoryChunk.

    Change-Id: I5ca1e18329d6e68a8b6811c3c27cb224c765cb63
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3966953
    Commit-Queue: Omer Katz <omerkatz@chromium.org>
    Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#83845}

Refs: 92a7385171
PR-URL: https://github.com/nodejs/node/pull/45230
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2022-11-19 09:11:38 +00:00
Michaël Zasso
4db47f28f0 deps: fix V8 build on Windows with MSVC
PR-URL: https://github.com/nodejs/node/pull/44741
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/45230
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2022-11-19 09:11:38 +00:00
Michaël Zasso
1cf4ad7ebe deps: silence irrelevant V8 warning
PR-URL: https://github.com/nodejs/node/pull/44741
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/45230
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2022-11-19 09:11:37 +00:00
Jiawen Geng
cecad3b56c deps: V8: fix v8-cppgc.h for MSVC
Refs: https://bugs.chromium.org/p/v8/issues/detail?id=12661
Refs: https://github.com/nodejs/node/issues/42375

PR-URL: https://github.com/nodejs/node/pull/42657
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/45230
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2022-11-19 09:11:36 +00:00
Jiawen Geng
49217b58ea deps: fix V8 build issue with inline methods
PR-URL: https://github.com/nodejs/node/pull/35415
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>

deps: patch for v8 on windows

PR-URL: https://github.com/nodejs/node/pull/40010
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>

deps: patch v8 for vs2019 in std17

PR-URL: https://github.com/nodejs/node/pull/40060
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>

deps: workaround debug link error on Windows

PR-URL: https://github.com/nodejs/node/pull/38807
Refs: https://github.com/nodejs/node/pull/38788
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ash Cripps <acripps@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/45230
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2022-11-19 09:11:35 +00:00
Michaël Zasso
4eb2f21a1c build: reset embedder string to "-node.0"
PR-URL: https://github.com/nodejs/node/pull/45230
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
2022-11-19 09:11:34 +00:00
Stefan Stojanovic
1f63c953e6
Revert "build: remove precompiled header and debug information for host builds"
This reverts commit 818284b687.

Reverted commit is a no longer needed patch for ARM64 cross-compiling.
It was increasing cross-compile time drastically (~3 times longer).

PR-URL: https://github.com/nodejs/node/pull/45432
Refs: https://github.com/nodejs/node/pull/42538
Refs: https://github.com/nodejs/node/issues/42375
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Stewart X Addison <sxa@redhat.com>
2022-11-18 19:41:01 +00:00
Yagiz Nizipli
5b8b92176e
deps: V8: cherry-pick 9df5ef70ff18
Original commit message:

    Add an `v8::ArrayBuffer::WasDetached` method to the C++ API

    V8's C++ API does not give a way to tell whether an ArrayBuffer has
    been detached from the `v8::ArrayBuffer` class. In fact, as far as can
    be told from the C++ API without running JS code, detached
    ArrayBuffers behave the same as zero-sized ArrayBuffers and there is
    no way to observe the difference. However, this difference can be
    observed in JS because constructing a TypedArray from a detached
    ArrayBuffer will throw.

    This change adds a `WasDetached` method to the `v8::ArrayBuffer` class
    to give embedders access to this information without having to run JS
    code.

    Bug: v8:13159
    Change-Id: I2bb1e380cee1cecd31f6d48ec3d9f28c03a8a673
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3810345
    Commit-Queue: Toon Verwaest <verwaest@chromium.org>
    Reviewed-by: Toon Verwaest <verwaest@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#83963}

Refs: 9df5ef70ff
PR-URL: https://github.com/nodejs/node/pull/45474
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-11-18 09:46:49 +00:00
Shi Pujin
8a465a2e3c
deps: V8: cherry-pick 56816d76c121
Original commit message:

    [loong64] Supplement a LoongArch support in include/v8config.h

    Change-Id: I658c1b781163bcd3ca39bfceb74aef9d255247b8
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3894795
    Reviewed-by: Toon Verwaest <verwaest@chromium.org>
    Commit-Queue: Liu Yu <liuyu@loongson.cn>
    Cr-Commit-Position: refs/heads/main@{#83374}

PR-URL: https://github.com/nodejs/node/pull/45353
Refs: 56816d76c1
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2022-11-08 14:26:48 +00:00
Michaël Zasso
466d36ebac
Revert "deps: make V8 compilable with older glibc"
This reverts commit 84d455e08e.

PR-URL: https://github.com/nodejs/node/pull/45162
Refs: https://github.com/nodejs/node/issues/45118
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Beth Griggs <bethanyngriggs@gmail.com>
Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-10-27 09:34:32 +00:00
Michaël Zasso
c6c18a9a24
Revert "deps: V8: forward declaration of Rtl*FunctionTable"
This reverts commit 01bc8e6fd8.

PR-URL: https://github.com/nodejs/node/pull/45119
Refs: https://github.com/nodejs/node/issues/45118
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2022-10-25 05:58:35 +00:00
Jiawen Geng
0be1c57281
deps: V8: cherry-pick c2792e58035f
Original commit message:

    [base] Fix build with gcc-13

    See https://gcc.gnu.org/gcc-13/porting_to.html#header-dep-changes.

    Also see Gentoo Linux bug report: https://bugs.gentoo.org/865981

    Change-Id: I421f396b02ba37e12ee70048ee33e034f8113566
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3934140
    Reviewed-by: Clemens Backes <clemensb@chromium.org>
    Reviewed-by: Simon Zünd <szuend@chromium.org>
    Commit-Queue: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#83587}

Refs: c2792e5803
PR-URL: https://github.com/nodejs/node/pull/44961
Fixes: https://github.com/nodejs/node/issues/43642
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2022-10-14 01:54:33 +00:00
Michaël Zasso
488474618c deps: V8: cherry-pick c3dffe6e2bda
Original commit message:

    [api] Expose parsed module source map urls

    Source map urls can be parsed from the magic comments. Expose them with
    public apis on the UnboundModuleScript, similar to the UnboundScript.

    Change-Id: Ia5dfdc8ff25f825c9fa7d241d0d79ba20028586b
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3917379
    Reviewed-by: Camillo Bruni <cbruni@chromium.org>
    Commit-Queue: Chengzhong Wu (legendecas) <legendecas@gmail.com>
    Cr-Commit-Position: refs/heads/main@{#83527}

Refs: c3dffe6e2b
PR-URL: https://github.com/nodejs/node/pull/44958
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Beth Griggs <bethanyngriggs@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2022-10-13 06:49:36 +00:00
Michaël Zasso
34ba631a0b deps: V8: cherry-pick e7f0f26f5ef3
Original commit message:

    Don't run sampling-heap-profiler-flags with stress-incremental-marking

    This test observes GC behavior and needs the garbage collector to work
    in a somewhat predictable way.

    Bug: v8:13286
    Change-Id: I24e6a4f33a644b5f1845cd34558da03fc196f7e5
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3898721
    Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
    Reviewed-by: Simon Zünd <szuend@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#83218}

Refs: e7f0f26f5e
PR-URL: https://github.com/nodejs/node/pull/44958
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Beth Griggs <bethanyngriggs@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2022-10-13 06:49:35 +00:00
Michaël Zasso
690a837f4f deps: V8: cherry-pick 3d59a3c2c164
Original commit message:

    Add option to report discarded allocations in sampling heap profiler

    A couple of customers have asked about using devtools to get information
    about temporary allocations, with the goal of reducing GC time and/or
    peak memory usage. Currently, the sampling heap profiler reports only
    objects which are still alive at the end of the profiling session. In
    this change, I propose adding configuration options when starting the
    sampling heap profiler so that it can optionally include information
    about objects which were discarded by the GC before the end of the
    profiling session. A user could run the sampling heap profiler in
    several different modes depending on their goals:

    1. To find memory leaks or determine which functions contribute most to
       steady-state memory consumption, the current default mode is best.
    2. To find functions which cause large temporary memory spikes or large
       GC pauses, the user can request data about both live objects and
       those collected by major GC.
    3. To tune for minimal GC activity in latency-sensitive applications
       like real-time audio processing, the user can request data about
       every allocation, including objects collected by major or minor GC.
    4. I'm not sure why anybody would want data about objects collected by
       minor GC and not objects collected by major GC, but it's also a valid
       flags combination.

    Change-Id: If55d5965a1de04fed3ae640a02ca369723f64fdf
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3868522
    Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
    Reviewed-by: Camillo Bruni <cbruni@chromium.org>
    Reviewed-by: Simon Zünd <szuend@chromium.org>
    Commit-Queue: Seth Brenith <seth.brenith@microsoft.com>
    Cr-Commit-Position: refs/heads/main@{#83202}

Refs: 3d59a3c2c1
PR-URL: https://github.com/nodejs/node/pull/44958
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Beth Griggs <bethanyngriggs@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2022-10-13 06:49:33 +00:00
Michaël Zasso
bab8b3aad6 deps: V8: cherry-pick 8b8703953616
Original commit message:

    [API] Remove second OnCriticalMemoryPressure

    Remove the deprecated OnCriticalMemoryPressure method with receives an
    informative parameter.

    R=mlippautz@chromium.org

    Bug: chromium:634547
    Change-Id: I932c3b5030291294dd340362f0b20d374e3067c0
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3780533
    Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
    Commit-Queue: Clemens Backes <clemensb@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#83254}

Refs: 8b87039536
PR-URL: https://github.com/nodejs/node/pull/44958
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Beth Griggs <bethanyngriggs@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2022-10-13 06:49:32 +00:00
Michaël Zasso
66fe446efd
deps: V8: cherry-pick 0cccb6f27d78
Original commit message:

    [msvc] fix missing include <optional>

    clang/clang-cl compiled happily (probably included transitively this
    header), but not MSVC.

    Bug: v8:13312

    Change-Id: I69b6c15f76d8ef13e4fac33f733717429ba96f71
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913033
    Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
    Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#83402}

Refs: 0cccb6f27d
PR-URL: https://github.com/nodejs/node/pull/44741
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-10-11 07:27:04 +02:00
Michaël Zasso
88ed027d57
deps: V8: cherry-pick 7ddb8399f9f1
Original commit message:

    [msvc] fix ambiguous call to function in assembler test

    MSVC is confused by initializer list and default parameter, and reports
    an ambiguous call.

    test/cctest/test-assembler-arm64.cc(12208): error C2668: 'v8::internal::Clobber': ambiguous call to overloaded function
    test-utils-arm64.h(251): note: could be 'void v8::internal::Clobber(v8::internal::MacroAssembler *,v8::internal::CPURegList)'
    test-utils-arm64.h(241): note: or       'void v8::internal::Clobber(v8::internal::MacroAssembler *,v8::internal::RegList,const uint64_t)'

    Solution is to construct with explicit type.

    Bug: v8:13312
    Change-Id: I66f5ba48bcdf6eb30035beaf7214a3d26fc9f18b
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913034
    Reviewed-by: Igor Sheludko <ishell@chromium.org>
    Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
    Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#83406}

Refs: 7ddb8399f9
PR-URL: https://github.com/nodejs/node/pull/44741
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-10-11 07:26:59 +02:00
Michaël Zasso
26c651c34e
deps: V8: cherry-pick 1b3a4f0c34a1
Original commit message:

    [msvc] fix build with neon intrinsics

    This compilation error was found by NodeJS when updating V8:
    https://github.com/nodejs/node-v8/issues/240

    MSVC reports an error with "too many initializer" for type uint32x4_t.

    ---

    Under gcc/clang, this is a typedef to a builtin type.

    For MSVC, it is a typedef to this union:
    typedef union __n128
    {
         unsigned __int64   n128_u64[2];
         unsigned __int32   n128_u32[4];
         ...
    } __n128;

    C++ mandates that only first member of union can be initialized at
    declaration. Thus, it can only be initialized with {uint64_t, uint64_t}.

    VS people proposed to use designated initializer instead:
    var = {.n128_u32={1, 2, 3, 8}}
    https://developercommunity.visualstudio.com/t/error-c2078-too-many-initializers-when-using-arm-n/402911
    But, you need to use /std:c++20 for this, which is not the case in v8.

    ---

    Thus, the only solution is to implement a hack specifically for MSVC,
    where you build two uint64, from four uint32.

    ---------------------------------------

    Once solved, another error is reported:
    templated function extract_first_nonzero_index is specialized twice.

    This is because, with MSVC, uint32x4_t and uint64x2_t are typedef to the
    same __n128 union. The fix is to drop templates, and use explicit
    function names instead.

    Bug: v8:13312
    Change-Id: I231d8cf01c05af01af319d56d5666c415f8b989b
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3913035
    Reviewed-by: Igor Sheludko <ishell@chromium.org>
    Reviewed-by: Jakob Kummerow <jkummerow@chromium.org>
    Commit-Queue: Jakob Kummerow <jkummerow@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#83404}

Refs: 1b3a4f0c34
PR-URL: https://github.com/nodejs/node/pull/44741
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-10-11 07:26:51 +02:00