Skip to content

Commit

Permalink
deps: V8: cherry-pick de611e69ad51
Browse files Browse the repository at this point in the history
This allows Maglev (see ref) to build on the compilers we use.

Original commit message:

    [maglev] fix non-ptr-compr compilation on old compilers

    When pointer compression is disabled, the preprocessor expands some
    static asserts to static_assert(false), which doesn't compile on
    compilers not implementing the C++ defect report CWG2518, notably clang
    before version 17 and gcc before version 13.

    Adding in part of the template parameter to the static assert prevents
    it from being evaluated immediately which fixes the compilation.

    Test: compiled with gcc-11 and clang-14 without pointer compression.
    Change-Id: I95ce29bdb1278e6dad9e592d6f9476395f8aeb59
    Fixed: v8:14355
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5022760
    Reviewed-by: Leszek Swirski <leszeks@chromium.org>
    Commit-Queue: Leszek Swirski <leszeks@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#91553}

Refs: v8/v8@de611e6
Refs: nodejs#50690
  • Loading branch information
kvakil committed Dec 18, 2023
1 parent 71e19e8 commit 9452dc3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.18',
'v8_embedder_string': '-node.19',

##### V8 defaults for Node.js #####

Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/maglev/maglev-code-generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ class ParallelMoveResolver {
void EmitMovesFromSource(RegisterT source_reg, GapMoveTargets&& targets) {
DCHECK(moves_from_register_[source_reg.code()].is_empty());
if constexpr (DecompressIfNeeded) {
static_assert(COMPRESS_POINTERS_BOOL);
// static_assert(COMPRESS_POINTERS_BOOL);
if (targets.needs_decompression == kNeedsDecompression) {
__ DecompressTagged(source_reg, source_reg);
}
Expand Down Expand Up @@ -462,7 +462,7 @@ class ParallelMoveResolver {
// Decompress after the first move, subsequent moves reuse this register so
// they're guaranteed to be decompressed.
if constexpr (DecompressIfNeeded) {
static_assert(COMPRESS_POINTERS_BOOL);
// static_assert(COMPRESS_POINTERS_BOOL);
if (targets.needs_decompression == kNeedsDecompression) {
__ DecompressTagged(register_with_slot_value, register_with_slot_value);
targets.needs_decompression = kDoesNotNeedDecompression;
Expand Down

0 comments on commit 9452dc3

Please sign in to comment.