Skip to content

Commit a8c1bf9

Browse files
Merge pull request #3093 from cloudflare/chore/v8-13.1-upgrade
Upgrade V8 13.0.245.16 -> 13.1.201.8
2 parents f374a34 + bb1d560 commit a8c1bf9

24 files changed

+224
-295
lines changed

.bazelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ build --experimental_remote_cache_eviction_retries=5
1919
# Note that we use remote_download_minimal for test builds, which avoids fetching build outputs
2020
# where possible. While several previous BwoB bugs have been fixed, this is slower than it could be
2121
# due to https://github.com/bazelbuild/bazel/issues/20576.
22+
# Windows build is failing on some runs due to FileAccessException errors, Bazel has had several
23+
# similar bugs in the past. Disable BwoB for now.
24+
build:windows --remote_download_all
2225

2326
# Import CI-specific configuration. As the amount of custom configuration settings we use grows,
2427
# consider moving more flags out to separate files.

WORKSPACE

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ filegroup(
122122
#
123123
git_repository(
124124
name = "com_google_absl",
125-
commit = "ed3733b91e472a1e7a641c1f0c1e6c0ea698e958",
125+
commit = "dc257ad54f38739767a6cb26eb57fd51c37bfe3c",
126126
remote = "https://chromium.googlesource.com/chromium/src/third_party/abseil-cpp.git",
127127
)
128128

@@ -175,7 +175,7 @@ git_repository(
175175
name = "zlib",
176176
build_file = "//:build/BUILD.zlib",
177177
# Must match the version used by v8
178-
commit = "d3aea2341cdeaf7e717bc257a59aa7a9407d318a",
178+
commit = "fa9f14143c7938e6a1d18443900efee7a1e5e669",
179179
remote = "https://chromium.googlesource.com/chromium/src/third_party/zlib.git",
180180
)
181181

@@ -280,32 +280,31 @@ esbuild_register_toolchains(
280280

281281
http_archive(
282282
name = "v8",
283-
integrity = "sha256-2jQHW96t3jpEsjOlv9yyjgUem3kKNnpDAIDR4PPFSnw=",
283+
integrity = "sha256-s+oY+fAG0cXTGmKDxbioUudjUciK1dU2reu7lZ+uB1w=",
284284
patch_args = ["-p1"],
285285
patches = [
286286
"//:patches/v8/0001-Allow-manually-setting-ValueDeserializer-format-vers.patch",
287287
"//:patches/v8/0002-Allow-manually-setting-ValueSerializer-format-versio.patch",
288-
"//:patches/v8/0003-Add-ArrayBuffer-MaybeNew.patch",
289-
"//:patches/v8/0004-Allow-Windows-builds-under-Bazel.patch",
290-
"//:patches/v8/0005-Disable-bazel-whole-archive-build.patch",
291-
"//:patches/v8/0006-Speed-up-V8-bazel-build-by-always-using-target-cfg.patch",
292-
"//:patches/v8/0007-Implement-Promise-Context-Tagging.patch",
293-
"//:patches/v8/0008-Enable-V8-shared-linkage.patch",
294-
"//:patches/v8/0009-Randomize-the-initial-ExecutionContextId-used-by-the.patch",
295-
"//:patches/v8/0010-increase-visibility-of-virtual-method.patch",
296-
"//:patches/v8/0011-Add-ValueSerializer-SetTreatFunctionsAsHostObjects.patch",
297-
"//:patches/v8/0012-Set-torque-generator-path-to-external-v8.-This-allow.patch",
298-
"//:patches/v8/0013-Modify-where-to-look-for-fp16-dependency.-This-depen.patch",
299-
"//:patches/v8/0014-Expose-v8-Symbol-GetDispose.patch",
300-
"//:patches/v8/0015-Rename-V8_COMPRESS_POINTERS_IN_ISOLATE_CAGE-V8_COMPR.patch",
301-
"//:patches/v8/0016-Revert-TracedReference-deref-API-removal.patch",
302-
"//:patches/v8/0017-Revert-heap-Add-masm-specific-unwinding-annotations-.patch",
303-
"//:patches/v8/0018-Update-illegal-invocation-error-message-in-v8.patch",
304-
"//:patches/v8/0019-Implement-cross-request-context-promise-resolve-hand.patch",
305-
"//:patches/v8/0020-Modify-where-to-look-for-fast_float-dependency.patch",
288+
"//:patches/v8/0003-Allow-Windows-builds-under-Bazel.patch",
289+
"//:patches/v8/0004-Disable-bazel-whole-archive-build.patch",
290+
"//:patches/v8/0005-Speed-up-V8-bazel-build-by-always-using-target-cfg.patch",
291+
"//:patches/v8/0006-Implement-Promise-Context-Tagging.patch",
292+
"//:patches/v8/0007-Randomize-the-initial-ExecutionContextId-used-by-the.patch",
293+
"//:patches/v8/0008-increase-visibility-of-virtual-method.patch",
294+
"//:patches/v8/0009-Add-ValueSerializer-SetTreatFunctionsAsHostObjects.patch",
295+
"//:patches/v8/0010-Set-torque-generator-path-to-external-v8.-This-allow.patch",
296+
"//:patches/v8/0011-Modify-where-to-look-for-fp16-dependency.-This-depen.patch",
297+
"//:patches/v8/0012-Expose-v8-Symbol-GetDispose.patch",
298+
"//:patches/v8/0013-Revert-TracedReference-deref-API-removal.patch",
299+
"//:patches/v8/0014-Revert-heap-Add-masm-specific-unwinding-annotations-.patch",
300+
"//:patches/v8/0015-Update-illegal-invocation-error-message-in-v8.patch",
301+
"//:patches/v8/0016-Implement-cross-request-context-promise-resolve-hand.patch",
302+
"//:patches/v8/0017-Modify-where-to-look-for-fast_float-dependency.patch",
303+
"//:patches/v8/0018-Return-rejected-promise-from-WebAssembly.compile-if-.patch",
304+
"//:patches/v8/0019-codegen-Don-t-pass-a-nullptr-in-InitUnwindingRecord-.patch",
306305
],
307-
strip_prefix = "v8-13.0.245.16",
308-
url = "https://github.com/v8/v8/archive/refs/tags/13.0.245.16.tar.gz",
306+
strip_prefix = "v8-13.1.201.8",
307+
url = "https://github.com/v8/v8/archive/refs/tags/13.1.201.8.tar.gz",
309308
)
310309

311310
git_repository(

patches/v8/0001-Allow-manually-setting-ValueDeserializer-format-vers.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 9d82ceca73562418e6ea9be81d8fc985e9b10f2e Mon Sep 17 00:00:00 2001
1+
From 0d006413157bb6d286eca2dff77956a9e4ed36e5 Mon Sep 17 00:00:00 2001
22
From: Alex Robinson <[email protected]>
33
Date: Wed, 2 Mar 2022 15:58:04 -0600
44
Subject: Allow manually setting ValueDeserializer format version
@@ -35,10 +35,10 @@ index 0cb3e045bc46ec732956318b980e749d1847d06d..40ad805c7970cc9379e69f046205836d
3535
* Reads raw data in various common formats to the buffer.
3636
* Note that integer types are read in base-128 varint format, not with a
3737
diff --git a/src/api/api.cc b/src/api/api.cc
38-
index eddb472d5608567255c5f55f4ae8b451abe5f6d3..c86687981fab3ed28306ada00c9d5dff5c594377 100644
38+
index 29dd26037bc9ce4c21f421cba32bc3077bb064d2..cda724c712dda198f3c0c6b1d94e0a6d70b745fd 100644
3939
--- a/src/api/api.cc
4040
+++ b/src/api/api.cc
41-
@@ -3605,6 +3605,10 @@ uint32_t ValueDeserializer::GetWireFormatVersion() const {
41+
@@ -3619,6 +3619,10 @@ uint32_t ValueDeserializer::GetWireFormatVersion() const {
4242
return private_->deserializer.GetWireFormatVersion();
4343
}
4444

patches/v8/0002-Allow-manually-setting-ValueSerializer-format-versio.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From d4de923519e992bf2e5f1bf4a19f410d41791e10 Mon Sep 17 00:00:00 2001
1+
From 8aa5173892d869765d77bbe83e3c97ba5be123b3 Mon Sep 17 00:00:00 2001
22
From: James M Snell <[email protected]>
33
Date: Wed, 16 Mar 2022 08:59:21 -0700
44
Subject: Allow manually setting ValueSerializer format version
@@ -22,10 +22,10 @@ index 40ad805c7970cc9379e69f046205836dbd760373..596be18adeb3a5a81794aaa44b1d347d
2222
* Writes out a header, which includes the format version.
2323
*/
2424
diff --git a/src/api/api.cc b/src/api/api.cc
25-
index c86687981fab3ed28306ada00c9d5dff5c594377..7058f9a13cb73cbbd0602ddeb589268306ee45ea 100644
25+
index cda724c712dda198f3c0c6b1d94e0a6d70b745fd..b69788395974538231aa3d2094453630d0c4f62a 100644
2626
--- a/src/api/api.cc
2727
+++ b/src/api/api.cc
28-
@@ -3473,6 +3473,10 @@ ValueSerializer::ValueSerializer(Isolate* v8_isolate, Delegate* delegate)
28+
@@ -3487,6 +3487,10 @@ ValueSerializer::ValueSerializer(Isolate* v8_isolate, Delegate* delegate)
2929

3030
ValueSerializer::~ValueSerializer() { delete private_; }
3131

@@ -37,7 +37,7 @@ index c86687981fab3ed28306ada00c9d5dff5c594377..7058f9a13cb73cbbd0602ddeb5892683
3737

3838
void ValueSerializer::SetTreatArrayBufferViewsAsHostObjects(bool mode) {
3939
diff --git a/src/objects/value-serializer.cc b/src/objects/value-serializer.cc
40-
index 51abbe13a599ce3a0f1b7d6fffea3abcfbfbafa4..eeb74aa42a9d783bbfdedc171717422321435c3a 100644
40+
index b62f2f907806fa3fa6189e15908aaeb218b06b82..187700b273d5d79b79b554d597ca6e605cdb4d26 100644
4141
--- a/src/objects/value-serializer.cc
4242
+++ b/src/objects/value-serializer.cc
4343
@@ -291,6 +291,7 @@ ValueSerializer::ValueSerializer(Isolate* isolate,

patches/v8/0003-Add-ArrayBuffer-MaybeNew.patch

Lines changed: 0 additions & 28 deletions
This file was deleted.

patches/v8/0004-Allow-Windows-builds-under-Bazel.patch renamed to patches/v8/0003-Allow-Windows-builds-under-Bazel.patch

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
1-
From 6dfefbe388136c0d648e7cee0c2080c7eaac7861 Mon Sep 17 00:00:00 2001
1+
From 162d27ca507656e5f99c407fa31cef577b7266cf Mon Sep 17 00:00:00 2001
22
From: Brendan Coll <[email protected]>
33
Date: Thu, 16 Mar 2023 11:56:10 +0000
44
Subject: Allow Windows builds under Bazel
55

66

77
diff --git a/BUILD.bazel b/BUILD.bazel
8-
index 1f269f9c149e56a7098697fc2346b5998b0c6e01..89bc2f54fc5e42a2cf6d6fa41742c2dfe2c9ab48 100644
8+
index 762483456429100f864e9d3f25e6e974c8bd8f05..80bf8f89783334bbcf44f05a8de3f32dd04790f0 100644
99
--- a/BUILD.bazel
1010
+++ b/BUILD.bazel
11-
@@ -817,6 +817,7 @@ filegroup(
11+
@@ -826,6 +826,7 @@ filegroup(
1212
"src/base/platform/mutex.h",
1313
"src/base/platform/platform.cc",
1414
"src/base/platform/platform.h",
1515
+ "src/base/platform/platform-posix.h", # Always included by src/execution/isolate.h
1616
"src/base/platform/semaphore.cc",
1717
"src/base/platform/semaphore.h",
1818
"src/base/platform/time.cc",
19-
@@ -860,7 +861,6 @@ filegroup(
19+
@@ -869,7 +870,6 @@ filegroup(
2020
] + select({
2121
"@v8//bazel/config:is_posix": [
2222
"src/base/platform/platform-posix.cc",
2323
- "src/base/platform/platform-posix.h",
2424
"src/base/platform/platform-posix-time.cc",
2525
"src/base/platform/platform-posix-time.h",
2626
],
27-
@@ -883,6 +883,7 @@ filegroup(
27+
@@ -892,6 +892,7 @@ filegroup(
2828
"@v8//bazel/config:is_windows": [
2929
"src/base/debug/stack_trace_win.cc",
3030
"src/base/platform/platform-win32.cc",
3131
+ "src/base/platform/platform-win32.h",
3232
"src/base/win32-headers.h",
3333
],
3434
}),
35-
@@ -1265,6 +1266,7 @@ filegroup(
35+
@@ -1274,6 +1275,7 @@ filegroup(
3636
"include/v8-wasm-trap-handler-posix.h",
3737
"src/api/api.cc",
3838
"src/api/api.h",
3939
+ "include/v8-wasm-trap-handler-win.h",
4040
"src/api/api-arguments.cc",
4141
"src/api/api-arguments.h",
4242
"src/api/api-arguments-inl.h",
43-
@@ -2739,6 +2741,11 @@ filegroup(
43+
@@ -2755,6 +2757,11 @@ filegroup(
4444
"src/trap-handler/handler-inside-posix.cc",
4545
"src/trap-handler/handler-outside-posix.cc",
4646
],
@@ -52,7 +52,7 @@ index 1f269f9c149e56a7098697fc2346b5998b0c6e01..89bc2f54fc5e42a2cf6d6fa41742c2df
5252
"//conditions:default": [],
5353
}) + select({
5454
"@v8//bazel/config:v8_arm64_simulator": [
55-
@@ -2746,13 +2753,6 @@ filegroup(
55+
@@ -2762,13 +2769,6 @@ filegroup(
5656
"src/trap-handler/trap-handler-simulator.h",
5757
],
5858
"//conditions:default": [],
@@ -66,7 +66,7 @@ index 1f269f9c149e56a7098697fc2346b5998b0c6e01..89bc2f54fc5e42a2cf6d6fa41742c2df
6666
}) + select({
6767
"@v8//bazel/config:is_windows_64bit": [
6868
"src/diagnostics/unwinding-info-win64.cc",
69-
@@ -3805,6 +3805,9 @@ filegroup(
69+
@@ -3825,6 +3825,9 @@ filegroup(
7070
"@v8//bazel/config:is_msvc_asm_ia32": ["src/heap/base/asm/ia32/push_registers_masm.asm"],
7171
"@v8//bazel/config:is_msvc_asm_x64": ["src/heap/base/asm/x64/push_registers_masm.asm"],
7272
"@v8//bazel/config:is_msvc_asm_arm64": ["src/heap/base/asm/arm64/push_registers_masm.S"],
@@ -76,7 +76,7 @@ index 1f269f9c149e56a7098697fc2346b5998b0c6e01..89bc2f54fc5e42a2cf6d6fa41742c2df
7676
}),
7777
)
7878

79-
@@ -4201,9 +4204,11 @@ filegroup(
79+
@@ -4227,9 +4230,11 @@ filegroup(
8080
"src/d8/d8-js.cc",
8181
"src/d8/d8-platforms.cc",
8282
"src/d8/d8-platforms.h",
@@ -90,7 +90,7 @@ index 1f269f9c149e56a7098697fc2346b5998b0c6e01..89bc2f54fc5e42a2cf6d6fa41742c2df
9090
)
9191

9292
genrule(
93-
@@ -4554,7 +4559,7 @@ py_test(
93+
@@ -4580,7 +4585,7 @@ py_test(
9494
":noicu/d8",
9595
":noicu/v8_build_config",
9696
"//testing/pybase",
@@ -99,7 +99,7 @@ index 1f269f9c149e56a7098697fc2346b5998b0c6e01..89bc2f54fc5e42a2cf6d6fa41742c2df
9999
main = "tools/run-tests.py",
100100
python_version = "PY3",
101101
tags = [
102-
@@ -4593,7 +4598,7 @@ py_test(
102+
@@ -4619,7 +4624,7 @@ py_test(
103103
":icu/d8",
104104
":icu/v8_build_config",
105105
"//testing/pybase",
@@ -178,7 +178,7 @@ index c81f278203126913c3bad74d31348706678ccf06..96e0f9cdb61d0d8f6597d337c2dd965b
178178
name = "is_clang",
179179
match_any = [
180180
diff --git a/bazel/defs.bzl b/bazel/defs.bzl
181-
index ba1716d9ad466a1a7a0a8976631c6a82cad9b894..cda9c55baefe428bd85b8d98dbf475d07e9c4307 100644
181+
index f961346e942d3f106ccd87f40bbe8c3a262c5261..a854e3cb4b3a70a4e683b1112598deefb28cbe58 100644
182182
--- a/bazel/defs.bzl
183183
+++ b/bazel/defs.bzl
184184
@@ -119,6 +119,24 @@ def _default_args():
@@ -230,15 +230,15 @@ index ba1716d9ad466a1a7a0a8976631c6a82cad9b894..cda9c55baefe428bd85b8d98dbf475d0
230230
],
231231
"@v8//bazel/config:is_macos": ["-pthread"],
232232
"//conditions:default": ["-Wl,--no-as-needed -ldl -pthread"],
233-
@@ -495,6 +523,7 @@ def v8_mksnapshot(name, args, suffix = ""):
233+
@@ -492,6 +520,7 @@ def v8_mksnapshot(name, args, suffix = ""):
234234
suffix = suffix,
235235
target_os = select({
236236
"@v8//bazel/config:is_macos": "mac",
237237
+ "@v8//bazel/config:is_windows": "win",
238238
"//conditions:default": "",
239239
}),
240240
)
241-
@@ -506,6 +535,7 @@ def v8_mksnapshot(name, args, suffix = ""):
241+
@@ -503,6 +532,7 @@ def v8_mksnapshot(name, args, suffix = ""):
242242
suffix = suffix,
243243
target_os = select({
244244
"@v8//bazel/config:is_macos": "mac",

patches/v8/0005-Disable-bazel-whole-archive-build.patch renamed to patches/v8/0004-Disable-bazel-whole-archive-build.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 3fab228a85820d93478887f88725d740b8fb919c Mon Sep 17 00:00:00 2001
1+
From fc8627f4d7aac841d000f3e88208e619eaebd84a Mon Sep 17 00:00:00 2001
22
From: Felix Hanau <[email protected]>
33
Date: Tue, 11 Apr 2023 14:41:31 -0400
44
Subject: Disable bazel whole-archive build

patches/v8/0006-Speed-up-V8-bazel-build-by-always-using-target-cfg.patch renamed to patches/v8/0005-Speed-up-V8-bazel-build-by-always-using-target-cfg.patch

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 1f4c8f5f723a9e80abcb8a966249b13105d890bb Mon Sep 17 00:00:00 2001
1+
From a62bdfd1858fff43ed8248a3d39b7bd00dd06e25 Mon Sep 17 00:00:00 2001
22
From: Felix Hanau <[email protected]>
33
Date: Wed, 7 Jun 2023 21:40:54 -0400
44
Subject: Speed up V8 bazel build by always using target cfg
@@ -12,7 +12,7 @@ generated files as the output set. While unrelated to the build cfg change,
1212
this also improves build times.
1313

1414
diff --git a/BUILD.bazel b/BUILD.bazel
15-
index 89bc2f54fc5e42a2cf6d6fa41742c2dfe2c9ab48..675c36f7784409f10b28b6fca93d4fd39f69a17d 100644
15+
index 80bf8f89783334bbcf44f05a8de3f32dd04790f0..23915096536d7f80e46b7dc33ca2ee56a61487bc 100644
1616
--- a/BUILD.bazel
1717
+++ b/BUILD.bazel
1818
@@ -17,6 +17,7 @@ load(
@@ -23,7 +23,7 @@ index 89bc2f54fc5e42a2cf6d6fa41742c2dfe2c9ab48..675c36f7784409f10b28b6fca93d4fd3
2323
)
2424
load(":bazel/v8-non-pointer-compression.bzl", "v8_binary_non_pointer_compression")
2525

26-
@@ -4211,22 +4212,20 @@ filegroup(
26+
@@ -4237,22 +4238,20 @@ filegroup(
2727
}),
2828
)
2929

@@ -52,7 +52,7 @@ index 89bc2f54fc5e42a2cf6d6fa41742c2dfe2c9ab48..675c36f7784409f10b28b6fca93d4fd3
5252
)
5353

5454
v8_mksnapshot(
55-
@@ -4427,8 +4426,6 @@ v8_binary(
55+
@@ -4453,8 +4452,6 @@ v8_binary(
5656
srcs = [
5757
"src/regexp/gen-regexp-special-case.cc",
5858
"src/regexp/special-case.h",
@@ -61,7 +61,7 @@ index 89bc2f54fc5e42a2cf6d6fa41742c2dfe2c9ab48..675c36f7784409f10b28b6fca93d4fd3
6161
],
6262
copts = ["-Wno-implicit-fallthrough"],
6363
defines = [
64-
@@ -4440,6 +4437,7 @@ v8_binary(
64+
@@ -4466,6 +4463,7 @@ v8_binary(
6565
],
6666
deps = [
6767
"//external:absl_optional",
@@ -70,10 +70,10 @@ index 89bc2f54fc5e42a2cf6d6fa41742c2dfe2c9ab48..675c36f7784409f10b28b6fca93d4fd3
7070
],
7171
)
7272
diff --git a/bazel/defs.bzl b/bazel/defs.bzl
73-
index cda9c55baefe428bd85b8d98dbf475d07e9c4307..658b44b7deca596ef8ea5b178b2d51b0d06820d3 100644
73+
index a854e3cb4b3a70a4e683b1112598deefb28cbe58..a0e8b91ecc9deb4e045c947d2e62eba0bc87cf0e 100644
7474
--- a/bazel/defs.bzl
7575
+++ b/bazel/defs.bzl
76-
@@ -340,6 +340,15 @@ def v8_library(
76+
@@ -337,6 +337,15 @@ def v8_library(
7777
**kwargs
7878
)
7979

@@ -89,7 +89,7 @@ index cda9c55baefe428bd85b8d98dbf475d07e9c4307..658b44b7deca596ef8ea5b178b2d51b0
8989
# Use a single generator target for torque definitions and initializers. We can
9090
# split the set of outputs by using OutputGroupInfo, that way we do not need to
9191
# run the torque generator twice.
92-
@@ -404,7 +413,7 @@ _v8_torque_files = rule(
92+
@@ -401,7 +410,7 @@ _v8_torque_files = rule(
9393
"tool": attr.label(
9494
allow_files = True,
9595
executable = True,
@@ -98,7 +98,7 @@ index cda9c55baefe428bd85b8d98dbf475d07e9c4307..658b44b7deca596ef8ea5b178b2d51b0
9898
),
9999
"args": attr.string_list(),
100100
},
101-
@@ -505,13 +514,16 @@ _v8_mksnapshot = rule(
101+
@@ -502,13 +511,16 @@ _v8_mksnapshot = rule(
102102
mandatory = True,
103103
allow_files = True,
104104
executable = True,
@@ -117,7 +117,7 @@ index cda9c55baefe428bd85b8d98dbf475d07e9c4307..658b44b7deca596ef8ea5b178b2d51b0
117117
)
118118

119119
def v8_mksnapshot(name, args, suffix = ""):
120-
@@ -635,3 +647,34 @@ def v8_build_config(name, arch):
120+
@@ -633,3 +645,34 @@ def v8_build_config(name, arch):
121121
outs = ["icu/" + name + ".json"],
122122
cmd = "echo '" + build_config_content(cpu, "true") + "' > \"$@\"",
123123
)

0 commit comments

Comments
 (0)