Skip to content

Commit 019dfc3

Browse files
kvakilMedhansh404
authored andcommitted
deps: V8: cherry-pick de611e69ad51
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 <[email protected]> Commit-Queue: Leszek Swirski <[email protected]> Cr-Commit-Position: refs/heads/main@{#91553} Refs: v8/v8@de611e6 PR-URL: nodejs#51200 Refs: nodejs#50690 Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Richard Lau <[email protected]> PR-URL: nodejs#50115 Reviewed-By: Rafael Gonzaga <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent e406680 commit 019dfc3

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

common.gypi

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
# Reset this number to 0 on major V8 upgrades.
3838
# Increment by one for each non-official patch applied to deps/v8.
39-
'v8_embedder_string': '-node.11',
39+
'v8_embedder_string': '-node.12',
4040

4141
##### V8 defaults for Node.js #####
4242

deps/v8/src/maglev/maglev-code-generator.cc

+10-2
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,11 @@ class ParallelMoveResolver {
419419
void EmitMovesFromSource(RegisterT source_reg, GapMoveTargets&& targets) {
420420
DCHECK(moves_from_register_[source_reg.code()].is_empty());
421421
if constexpr (DecompressIfNeeded) {
422-
static_assert(COMPRESS_POINTERS_BOOL);
422+
// The DecompressIfNeeded clause is redundant with the if-constexpr above,
423+
// but otherwise this code cannot be compiled by compilers not yet
424+
// implementing CWG2518.
425+
static_assert(DecompressIfNeeded && COMPRESS_POINTERS_BOOL);
426+
423427
if (targets.needs_decompression == kNeedsDecompression) {
424428
__ DecompressTagged(source_reg, source_reg);
425429
}
@@ -462,7 +466,11 @@ class ParallelMoveResolver {
462466
// Decompress after the first move, subsequent moves reuse this register so
463467
// they're guaranteed to be decompressed.
464468
if constexpr (DecompressIfNeeded) {
465-
static_assert(COMPRESS_POINTERS_BOOL);
469+
// The DecompressIfNeeded clause is redundant with the if-constexpr above,
470+
// but otherwise this code cannot be compiled by compilers not yet
471+
// implementing CWG2518.
472+
static_assert(DecompressIfNeeded && COMPRESS_POINTERS_BOOL);
473+
466474
if (targets.needs_decompression == kNeedsDecompression) {
467475
__ DecompressTagged(register_with_slot_value, register_with_slot_value);
468476
targets.needs_decompression = kDoesNotNeedDecompression;

0 commit comments

Comments
 (0)