Skip to content

Commit 6196f97

Browse files
authored
v8: update to 14.4.258.16 (#471)
* `v8`: update to `14.4.258.16` Signed-off-by: Matt Leon <mattleon@google.com> * v8: add define for V8 ASAN support Signed-off-by: Matt Leon <mattleon@google.com> --------- Signed-off-by: Matt Leon <mattleon@google.com>
1 parent beb8a4e commit 6196f97

3 files changed

Lines changed: 46 additions & 46 deletions

File tree

.bazelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ build:clang-xsan --linkopt --unwindlib=libgcc
2727
build:clang-asan --config=clang-xsan
2828
build:clang-asan --copt -DADDRESS_SANITIZER=1
2929
build:clang-asan --copt -DUNDEFINED_SANITIZER=1
30+
build:clang-asan --copt -DV8_USE_ADDRESS_SANITIZER=1
3031
build:clang-asan --copt -fsanitize=address,undefined
3132
build:clang-asan --copt -fsanitize-address-use-after-scope
3233
build:clang-asan --linkopt -fsanitize=address,undefined

bazel/external/v8.patch

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From bc2a85e39fd55879b9baed51429c08b27d5514c8 Mon Sep 17 00:00:00 2001
1+
From 3b6a69271801db1b1a411fb969b515c74c459f65 Mon Sep 17 00:00:00 2001
22
From: Matt Leon <mattleon@google.com>
33
Date: Wed, 16 Jul 2025 16:55:02 -0400
44
Subject: [PATCH 1/7] Disable pointer compression
@@ -11,10 +11,10 @@ Signed-off-by: Matt Leon <mattleon@google.com>
1111
1 file changed, 1 insertion(+), 1 deletion(-)
1212

1313
diff --git a/BUILD.bazel b/BUILD.bazel
14-
index 3f5a87d054e..0a693b7ee10 100644
14+
index b1a54b2b42c..96c8be8901f 100644
1515
--- a/BUILD.bazel
1616
+++ b/BUILD.bazel
17-
@@ -292,7 +292,7 @@ v8_int(
17+
@@ -296,7 +296,7 @@ v8_int(
1818
# If no explicit value for v8_enable_pointer_compression, we set it to 'none'.
1919
v8_string(
2020
name = "v8_enable_pointer_compression",
@@ -24,10 +24,10 @@ index 3f5a87d054e..0a693b7ee10 100644
2424

2525
# Default setting for v8_enable_pointer_compression.
2626
--
27-
2.50.0.727.gbf7dc18ff4-goog
27+
2.52.0.457.g6b5491de43-goog
2828

2929

30-
From 61898e9a63ac89a37261c081b84714cfc400a4b1 Mon Sep 17 00:00:00 2001
30+
From aea5afcb03b19af37ed1c04cfdf294e9f4499f6b Mon Sep 17 00:00:00 2001
3131
From: Matt Leon <mattleon@google.com>
3232
Date: Wed, 16 Jul 2025 16:56:31 -0400
3333
Subject: [PATCH 2/7] Restore _allowlist_function_transition
@@ -43,10 +43,10 @@ Signed-off-by: Matt Leon <mattleon@google.com>
4343
2 files changed, 14 insertions(+)
4444

4545
diff --git a/bazel/defs.bzl b/bazel/defs.bzl
46-
index 0539ea176ac..14d7ace5e59 100644
46+
index a7e1e2af786..ba8315bb938 100644
4747
--- a/bazel/defs.bzl
4848
+++ b/bazel/defs.bzl
49-
@@ -485,6 +485,9 @@ _v8_mksnapshot = rule(
49+
@@ -491,6 +491,9 @@ _v8_mksnapshot = rule(
5050
cfg = "exec",
5151
),
5252
"target_os": attr.string(mandatory = True),
@@ -79,10 +79,10 @@ index 8c929454840..57336154cf7 100644
7979
# Making this executable means it works with "$ bazel run".
8080
executable = True,
8181
--
82-
2.50.0.727.gbf7dc18ff4-goog
82+
2.52.0.457.g6b5491de43-goog
8383

8484

85-
From 4a6e7158fd4ca48c75c8e33ea15760c9beea1d2f Mon Sep 17 00:00:00 2001
85+
From 920ef0496317a512083a09caa905fbf87a01c14b Mon Sep 17 00:00:00 2001
8686
From: Matt Leon <mattleon@google.com>
8787
Date: Wed, 16 Jul 2025 16:56:52 -0400
8888
Subject: [PATCH 3/7] Don't expose Wasm C API (only Wasm C++ API).
@@ -93,10 +93,10 @@ Signed-off-by: Matt Leon <mattleon@google.com>
9393
1 file changed, 4 insertions(+)
9494

9595
diff --git a/src/wasm/c-api.cc b/src/wasm/c-api.cc
96-
index 05e4029f183..d705be96a16 100644
96+
index e7cf656ade4..660ed06021d 100644
9797
--- a/src/wasm/c-api.cc
9898
+++ b/src/wasm/c-api.cc
99-
@@ -2472,6 +2472,8 @@ WASM_EXPORT auto Instance::exports() const -> ownvec<Extern> {
99+
@@ -2481,6 +2481,8 @@ WASM_EXPORT auto Instance::exports() const -> ownvec<Extern> {
100100

101101
} // namespace wasm
102102

@@ -105,17 +105,17 @@ index 05e4029f183..d705be96a16 100644
105105
// BEGIN FILE wasm-c.cc
106106

107107
extern "C" {
108-
@@ -3518,3 +3520,5 @@ wasm_instance_t* wasm_frame_instance(const wasm_frame_t* frame) {
108+
@@ -3527,3 +3529,5 @@ wasm_instance_t* wasm_frame_instance(const wasm_frame_t* frame) {
109109
#undef WASM_DEFINE_SHARABLE_REF
110110

111111
} // extern "C"
112112
+
113113
+#endif
114114
--
115-
2.50.0.727.gbf7dc18ff4-goog
115+
2.52.0.457.g6b5491de43-goog
116116

117117

118-
From 7b593eb8086dcfe9012d4fa694d622f21dadb731 Mon Sep 17 00:00:00 2001
118+
From f6379d9391b775f0459c3740302e435421a942c1 Mon Sep 17 00:00:00 2001
119119
From: Matt Leon <mattleon@google.com>
120120
Date: Wed, 16 Jul 2025 16:58:02 -0400
121121
Subject: [PATCH 4/7] Stub out fast_float for bazel-supplied version
@@ -126,10 +126,10 @@ Signed-off-by: Matt Leon <mattleon@google.com>
126126
1 file changed, 1 insertion(+), 1 deletion(-)
127127

128128
diff --git a/BUILD.bazel b/BUILD.bazel
129-
index 0a693b7ee10..eafd9dad20c 100644
129+
index 96c8be8901f..05630ab7035 100644
130130
--- a/BUILD.bazel
131131
+++ b/BUILD.bazel
132-
@@ -4438,7 +4438,7 @@ v8_library(
132+
@@ -4557,7 +4557,7 @@ v8_library(
133133
],
134134
deps = [
135135
":lib_dragonbox",
@@ -139,10 +139,10 @@ index 0a693b7ee10..eafd9dad20c 100644
139139
":simdutf",
140140
":v8_libbase",
141141
--
142-
2.50.0.727.gbf7dc18ff4-goog
142+
2.52.0.457.g6b5491de43-goog
143143

144144

145-
From b442d34b12dd513946f509d9db86839ce8aa4d7f Mon Sep 17 00:00:00 2001
145+
From 98a46e051afa5186a07400c53923367b9bea0ebe Mon Sep 17 00:00:00 2001
146146
From: Matt Leon <mattleon@google.com>
147147
Date: Wed, 16 Jul 2025 20:04:05 -0400
148148
Subject: [PATCH 5/7] Stub out vendored dependencies for bazel-sourced versions
@@ -153,10 +153,10 @@ Signed-off-by: Matt Leon <mattleon@google.com>
153153
1 file changed, 3 insertions(+), 3 deletions(-)
154154

155155
diff --git a/BUILD.bazel b/BUILD.bazel
156-
index eafd9dad20c..ce36666e36e 100644
156+
index 05630ab7035..7f14a987148 100644
157157
--- a/BUILD.bazel
158158
+++ b/BUILD.bazel
159-
@@ -4437,10 +4437,10 @@ v8_library(
159+
@@ -4556,10 +4556,10 @@ v8_library(
160160
":noicu/generated_torque_definitions",
161161
],
162162
deps = [
@@ -171,10 +171,10 @@ index eafd9dad20c..ce36666e36e 100644
171171
"@abseil-cpp//absl/container:btree",
172172
"@abseil-cpp//absl/container:flat_hash_map",
173173
--
174-
2.50.0.727.gbf7dc18ff4-goog
174+
2.52.0.457.g6b5491de43-goog
175175

176176

177-
From e0b8f32cc057a3c0875437d5d54d012cabcab458 Mon Sep 17 00:00:00 2001
177+
From e3cebe8ca694935302a8c3806ab6398c593f31cd Mon Sep 17 00:00:00 2001
178178
From: Matt Leon <mattleon@google.com>
179179
Date: Wed, 16 Jul 2025 20:29:10 -0400
180180
Subject: [PATCH 6/7] Add build flags to make V8 compile with GCC
@@ -185,24 +185,24 @@ Signed-off-by: Matt Leon <mattleon@google.com>
185185
1 file changed, 3 insertions(+)
186186

187187
diff --git a/bazel/defs.bzl b/bazel/defs.bzl
188-
index 14d7ace5e59..c7a48d4e805 100644
188+
index ba8315bb938..277a07ef63d 100644
189189
--- a/bazel/defs.bzl
190190
+++ b/bazel/defs.bzl
191-
@@ -117,6 +117,9 @@ def _default_args():
192-
"-Wno-implicit-int-float-conversion",
191+
@@ -123,6 +123,9 @@ def _default_args():
193192
"-Wno-deprecated-copy",
194193
"-Wno-non-virtual-dtor",
194+
"-Wno-unnecessary-virtual-specifier",
195195
+ "-Wno-invalid-offsetof",
196196
+ "-Wno-dangling-pointer",
197197
+ "-Wno-dangling-reference",
198198
"-isystem .",
199199
],
200200
"//conditions:default": [],
201201
--
202-
2.50.0.727.gbf7dc18ff4-goog
202+
2.52.0.457.g6b5491de43-goog
203203

204204

205-
From 7ce2d6bd14b338ab91a8636a8694b9ef180b2f90 Mon Sep 17 00:00:00 2001
205+
From 5f9cd8cf1b1758678d41f96cd22477e052c787f8 Mon Sep 17 00:00:00 2001
206206
From: Matt Leon <mattleon@google.com>
207207
Date: Fri, 18 Jul 2025 17:28:42 -0400
208208
Subject: [PATCH 7/7] Hack out atomic simd support in V8.
@@ -230,10 +230,10 @@ Signed-off-by: Matt Leon <mattleon@google.com>
230230
3 files changed, 19 insertions(+), 1 deletion(-)
231231

232232
diff --git a/bazel/defs.bzl b/bazel/defs.bzl
233-
index c7a48d4e805..a73b3812882 100644
233+
index 277a07ef63d..0617ecf1607 100644
234234
--- a/bazel/defs.bzl
235235
+++ b/bazel/defs.bzl
236-
@@ -180,7 +180,7 @@ def _default_args():
236+
@@ -186,7 +186,7 @@ def _default_args():
237237
"Advapi32.lib",
238238
],
239239
"@v8//bazel/config:is_macos": ["-pthread"],
@@ -243,10 +243,10 @@ index c7a48d4e805..a73b3812882 100644
243243
":should_add_rdynamic": ["-rdynamic"],
244244
"//conditions:default": [],
245245
diff --git a/src/builtins/builtins-typed-array.cc b/src/builtins/builtins-typed-array.cc
246-
index 918cb873481..bc933e8dc1d 100644
246+
index af505a1f729..8c41631f291 100644
247247
--- a/src/builtins/builtins-typed-array.cc
248248
+++ b/src/builtins/builtins-typed-array.cc
249-
@@ -520,17 +520,21 @@ simdutf::result ArrayBufferSetFromBase64(
249+
@@ -506,17 +506,21 @@ simdutf::result ArrayBufferSetFromBase64(
250250
DirectHandle<JSTypedArray> typed_array, size_t& output_length) {
251251
output_length = array_length;
252252
simdutf::result simd_result;
@@ -268,19 +268,19 @@ index 918cb873481..bc933e8dc1d 100644
268268

269269
return simd_result;
270270
}
271-
@@ -833,15 +837,19 @@ BUILTIN(Uint8ArrayPrototypeToBase64) {
271+
@@ -840,15 +844,19 @@ BUILTIN(Uint8ArrayPrototypeToBase64) {
272272
// 11. Return CodePointsToString(outAscii).
273273

274274
size_t simd_result_size;
275275
+#ifdef WANT_ATOMIC_REF
276276
if (uint8array->buffer()->is_shared()) {
277277
simd_result_size = simdutf::atomic_binary_to_base64(
278-
std::bit_cast<const char*>(uint8array->DataPtr()), length,
278+
reinterpret_cast<const char*>(uint8array->DataPtr()), length,
279279
reinterpret_cast<char*>(output->GetChars(no_gc)), alphabet);
280280
} else {
281281
+#endif
282282
simd_result_size = simdutf::binary_to_base64(
283-
std::bit_cast<const char*>(uint8array->DataPtr()), length,
283+
reinterpret_cast<const char*>(uint8array->DataPtr()), length,
284284
reinterpret_cast<char*>(output->GetChars(no_gc)), alphabet);
285285
+#ifdef WANT_ATOMIC_REF
286286
}
@@ -289,7 +289,7 @@ index 918cb873481..bc933e8dc1d 100644
289289
USE(simd_result_size);
290290
}
291291
diff --git a/src/objects/simd.cc b/src/objects/simd.cc
292-
index 0ef570ceb7d..9217fa76072 100644
292+
index ef2b8118eec..68115031f1a 100644
293293
--- a/src/objects/simd.cc
294294
+++ b/src/objects/simd.cc
295295
@@ -477,6 +477,7 @@ void Uint8ArrayToHexSlow(const char* bytes, size_t length,
@@ -308,7 +308,7 @@ index 0ef570ceb7d..9217fa76072 100644
308308

309309
inline uint16_t ByteToHex(uint8_t byte) {
310310
const uint16_t correction = (('a' - '0' - 10) << 8) + ('a' - '0' - 10);
311-
@@ -645,11 +647,15 @@ Tagged<Object> Uint8ArrayToHex(const char* bytes, size_t length, bool is_shared,
311+
@@ -647,11 +649,15 @@ Tagged<Object> Uint8ArrayToHex(const char* bytes, size_t length, bool is_shared,
312312
}
313313
#endif
314314

@@ -324,7 +324,7 @@ index 0ef570ceb7d..9217fa76072 100644
324324
return *string_output;
325325
}
326326

327-
@@ -1082,12 +1088,16 @@ bool ArrayBufferFromHex(const base::Vector<T>& input_vector, bool is_shared,
327+
@@ -1084,12 +1090,16 @@ bool ArrayBufferFromHex(const base::Vector<T>& input_vector, bool is_shared,
328328
for (uint32_t i = 0; i < output_length * 2; i += 2) {
329329
result = HandleRemainingHexValues(input_vector, i);
330330
if (result.has_value()) {
@@ -342,5 +342,5 @@ index 0ef570ceb7d..9217fa76072 100644
342342
return false;
343343
}
344344
--
345-
2.50.0.727.gbf7dc18ff4-goog
345+
2.52.0.457.g6b5491de43-goog
346346

bazel/repositories.bzl

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ def proxy_wasm_cpp_host_repositories():
151151
maybe(
152152
http_archive,
153153
name = "com_google_absl",
154-
sha256 = "9b7a064305e9fd94d124ffa6cc358592eb42b5da588fb4e07d09254aa40086db",
155-
strip_prefix = "abseil-cpp-20250512.1",
156-
urls = ["https://github.com/abseil/abseil-cpp/archive/refs/tags/20250512.1.tar.gz"],
154+
sha256 = "1692f77d1739bacf3f94337188b78583cf09bab7e420d2dc6c5605a4f86785a1",
155+
strip_prefix = "abseil-cpp-20250814.1",
156+
urls = ["https://github.com/abseil/abseil-cpp/archive/20250814.1.tar.gz"],
157157
)
158158

159159
maybe(
@@ -211,12 +211,11 @@ def proxy_wasm_cpp_host_repositories():
211211
# V8 with dependencies.
212212

213213
maybe(
214-
git_repository,
214+
http_archive,
215215
name = "v8",
216-
# 13.8.258.26
217-
commit = "de9d0f8b56ae61896e4d2ac577fc589efb14f87d",
218-
remote = "https://chromium.googlesource.com/v8/v8",
219-
shallow_since = "1752074621 -0700",
216+
urls = ["https://github.com/v8/v8/archive/refs/tags/14.4.258.16.tar.gz"],
217+
integrity = "sha256-igwEEi6kcb2q7EodzjJasjCx/6LRMiFTVWfDKcNB+Xw=",
218+
strip_prefix = "v8-14.4.258.16",
220219
patches = [
221220
"@proxy_wasm_cpp_host//bazel/external:v8.patch",
222221
],

0 commit comments

Comments
 (0)