Skip to content

Commit 4bae830

Browse files
committed
Update to 12.4 branch (node22)
1 parent dc957bf commit 4bae830

File tree

4 files changed

+103
-6
lines changed

4 files changed

+103
-6
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ jobs:
1414
fail-fast: false
1515
matrix:
1616
distro: [ 'centos-8', 'debian-11', 'debian-11-arm', 'debian-12-libcxx', 'alpine' ]
17-
version: [ '11.9.169.7' ]
17+
version: [ '12.4.254.21' ]
1818

1919
steps:
2020
- name: checkout
2121
uses: actions/checkout@v4
2222

2323
- name: build
2424
run: |
25-
docker build --build-arg v8_version=${{ matrix.version }} ${{ matrix.distro }} -t mybuild
25+
docker build --build-arg v8_version=${{ matrix.version }} -f ${{ matrix.distro }}/Dockerfile . -t mybuild
2626
2727
- name: copy
2828
run: |

12.4-fixes.diff

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
diff --git a/BUILD.gn b/BUILD.gn
2+
index a25b6f2ac986..e2e0c16d9708 100644
3+
--- a/BUILD.gn
4+
+++ b/BUILD.gn
5+
@@ -1716,6 +1716,10 @@ config("toolchain") {
6+
7+
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108517
8+
"-Wno-nonnull",
9+
+
10+
+ # Disable dangling pointer warnings, which are often false positives when
11+
+ # using scopes.
12+
+ "-Wno-dangling-pointer",
13+
]
14+
}
15+
16+
diff --git a/src/base/logging.h b/src/base/logging.h
17+
index 0139cb10cee7..e68e79ebaac0 100644
18+
--- a/src/base/logging.h
19+
+++ b/src/base/logging.h
20+
@@ -61,7 +61,7 @@ constexpr const char* kUnreachableCodeMessage = "unreachable code";
21+
} // namespace v8::base
22+
23+
#define UNIMPLEMENTED() FATAL(::v8::base::kUnimplementedCodeMessage)
24+
-#define UNREACHABLE() FATAL(::v8::base::kUnreachableCodeMessage)
25+
+#define UNREACHABLE() abort()
26+
// g++ versions <= 8 cannot use UNREACHABLE() in a constexpr function.
27+
// TODO(miladfarca): Remove once all compilers handle this properly.
28+
#if defined(__GNUC__) && !defined(__clang__) && (__GNUC__ <= 8)
29+
diff --git a/src/compiler/turboshaft/assembler.h b/src/compiler/turboshaft/assembler.h
30+
index e324c82b08cf..8493aca79ddc 100644
31+
--- a/src/compiler/turboshaft/assembler.h
32+
+++ b/src/compiler/turboshaft/assembler.h
33+
@@ -6,6 +6,7 @@
34+
#define V8_COMPILER_TURBOSHAFT_ASSEMBLER_H_
35+
36+
#include <cstring>
37+
+#include <iomanip>
38+
#include <iterator>
39+
#include <limits>
40+
#include <memory>
41+
diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc
42+
index 16f1f1470b78..b4813b9ff759 100644
43+
--- a/src/compiler/wasm-compiler.cc
44+
+++ b/src/compiler/wasm-compiler.cc
45+
@@ -8613,11 +8613,13 @@ wasm::WasmCompilationResult CompileWasmImportCallWrapper(
46+
'-');
47+
48+
auto compile_with_turboshaft = [&]() {
49+
+ wasm::WrapperCompilationInfo ci;
50+
+ ci.code_kind = CodeKind::WASM_TO_JS_FUNCTION;
51+
+ ci.import_info.import_kind = kind;
52+
+ ci.import_info.expected_arity = expected_arity;
53+
+ ci.import_info.suspend = suspend;
54+
return Pipeline::GenerateCodeForWasmNativeStubFromTurboshaft(
55+
- env->module, sig,
56+
- wasm::WrapperCompilationInfo{
57+
- .code_kind = CodeKind::WASM_TO_JS_FUNCTION,
58+
- .import_info = {kind, expected_arity, suspend}},
59+
+ env->module, sig, ci,
60+
func_name, WasmStubAssemblerOptions(), nullptr);
61+
};
62+
auto compile_with_turbofan = [&]() {
63+
@@ -8774,12 +8776,14 @@ MaybeHandle<Code> CompileWasmToJSWrapper(Isolate* isolate,
64+
base::VectorOf(name_buffer.get(), kMaxNameLen) + kNamePrefixLen, sig);
65+
66+
auto compile_with_turboshaft = [&]() {
67+
+ wasm::WrapperCompilationInfo ci;
68+
+ ci.code_kind = CodeKind::WASM_TO_JS_FUNCTION;
69+
+ ci.import_info.import_kind = kind;
70+
+ ci.import_info.expected_arity = expected_arity;
71+
+ ci.import_info.suspend = suspend;
72+
std::unique_ptr<turboshaft::TurboshaftCompilationJob> job =
73+
Pipeline::NewWasmTurboshaftWrapperCompilationJob(
74+
- isolate, sig,
75+
- wasm::WrapperCompilationInfo{
76+
- .code_kind = CodeKind::WASM_TO_JS_FUNCTION,
77+
- .import_info = {kind, expected_arity, suspend}},
78+
+ isolate, sig, ci,
79+
nullptr, std::move(name_buffer), WasmAssemblerOptions());
80+
81+
// Compile the wrapper
82+
diff --git a/src/wasm/wasm-disassembler.cc b/src/wasm/wasm-disassembler.cc
83+
index 6c5da414047f..1690ca026e75 100644
84+
--- a/src/wasm/wasm-disassembler.cc
85+
+++ b/src/wasm/wasm-disassembler.cc
86+
@@ -4,6 +4,8 @@
87+
88+
#include "src/wasm/wasm-disassembler.h"
89+
90+
+#include <iomanip>
91+
+
92+
#include "src/debug/debug-interface.h"
93+
#include "src/numbers/conversions.h"
94+
#include "src/wasm/module-decoder-impl.h"

alpine/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ FROM alpine:3.16 as v8
4848
COPY --from=source /tmp/v8 /tmp/v8
4949
COPY --from=gn-builder /usr/local/bin/gn /tmp/v8/buildtools/linux64/gn
5050
RUN \
51-
apk add --update --virtual .v8-build-dependencies curl g++ gcc glib-dev icu-dev libstdc++ linux-headers make ninja python3 tar xz && \
51+
apk add --update --virtual .v8-build-dependencies curl g++ gcc glib-dev icu-dev libstdc++ linux-headers make ninja python3 tar xz patch && \
5252
ln -s /usr/bin/python3 /usr/bin/python && \
5353
cd /tmp/v8 && \
54+
patch -p1 -i 12.4-fixes.diff && \
5455
./tools/dev/v8gen.py x64.release -- \
5556
binutils_path=\"/usr/bin\" \
5657
target_os=\"linux\" \

centos-8/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ENV pkgdir=/package
1010

1111
RUN yum update -y && \
1212
yum upgrade -y && \
13-
yum install -y python38 xz git gcc-c++ bzip2 libatomic glib2-devel && \
13+
yum install -y python38 xz git gcc-c++ bzip2 libatomic glib2-devel patch curl && \
1414
ln -s /usr/bin/python3 /usr/bin/python
1515

1616
RUN git clone https://chromium.googlesource.com/chromium/tools/depot_tools
@@ -22,8 +22,10 @@ WORKDIR /v8
2222
RUN gclient sync --nohooks -D --force --reset && \
2323
gclient sync --revision ${version}
2424

25-
# Workaround for GCC-8 bug
26-
RUN sed -i.bak 's|tuple()|tuple{}|g' src/compiler/turboshaft/operations.h
25+
# Workaround for GCC-8 bugs
26+
RUN \
27+
sed -i.bak 's|tuple()|tuple{}|g' src/compiler/turboshaft/operations.h && \
28+
patch -p1 -i 12.4-fixes.diff
2729

2830
RUN gn gen ${target} -vv --fail-on-unused-args \
2931
--args='v8_monolithic=true \

0 commit comments

Comments
 (0)