Skip to content

Commit

Permalink
Merge pull request #2780 from cloudflare/dominik/v8-13.0
Browse files Browse the repository at this point in the history
Update v8 to 13.0
  • Loading branch information
dom96 authored Oct 3, 2024
2 parents e8f21f4 + 4a94a6f commit 2178684
Show file tree
Hide file tree
Showing 24 changed files with 238 additions and 165 deletions.
14 changes: 11 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,13 @@ git_repository(
remote = "https://chromium.googlesource.com/chromium/src/third_party/abseil-cpp.git",
)

git_repository(
name = "fast_float",
build_file_content = "exports_files(glob([\"**\"]))",
commit = "d7417618f93d2c47e9bbde561510f9fc8bafe003",
remote = "https://chromium.googlesource.com/external/github.com/fastfloat/fast_float.git",
)

git_repository(
name = "fp16",
build_file_content = "exports_files(glob([\"**\"]))",
Expand Down Expand Up @@ -329,7 +336,7 @@ npm_repositories()

http_archive(
name = "v8",
integrity = "sha256-oOgRa4akl02v8tcMbpmbHu21VL1qOYBjerq1CzekLxc=",
integrity = "sha256-xrrRWhvzf0Kl9FVZ8xO7zb07gefU3sx6uLiPdQ6VV0E=",
patch_args = ["-p1"],
patches = [
"//:patches/v8/0001-Allow-manually-setting-ValueDeserializer-format-vers.patch",
Expand All @@ -351,9 +358,10 @@ http_archive(
"//:patches/v8/0017-Revert-heap-Add-masm-specific-unwinding-annotations-.patch",
"//:patches/v8/0018-Update-illegal-invocation-error-message-in-v8.patch",
"//:patches/v8/0019-Implement-cross-request-context-promise-resolve-hand.patch",
"//:patches/v8/0020-Modify-where-to-look-for-fast_float-dependency.patch",
],
strip_prefix = "v8-12.9.202.13",
url = "https://github.com/v8/v8/archive/refs/tags/12.9.202.13.tar.gz",
strip_prefix = "v8-13.0.245.1",
url = "https://github.com/v8/v8/archive/refs/tags/13.0.245.1.tar.gz",
)

git_repository(
Expand Down
3 changes: 2 additions & 1 deletion docs/v8-updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ from the V8 directory.
The `integrity` check needs to be updated to the new value. You can get the new value in
bazel's preferred format just by looking into the mismatch error while trying to compile
workerd using the newer V8 version.
workerd using the newer V8 version or by running
`openssl dgst -sha256 -binary <tarball_filename> | openssl base64 -A`

See [V8 http_archive in WORKSPACE](https://github.com/cloudflare/workerd/blob/587ad90dd1e91d2660c271018056f4189fca3501/WORKSPACE#L408)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 7f2b87c02eeef64b1d15ec78b45a128e6a8b9254 Mon Sep 17 00:00:00 2001
From ab1c70706bef5ba96894e955724f61df62daec8b Mon Sep 17 00:00:00 2001
From: Alex Robinson <arobinson@cloudflare.com>
Date: Wed, 2 Mar 2022 15:58:04 -0600
Subject: Allow manually setting ValueDeserializer format version
Expand Down Expand Up @@ -35,10 +35,10 @@ index 0cb3e045bc46ec732956318b980e749d1847d06d..40ad805c7970cc9379e69f046205836d
* Reads raw data in various common formats to the buffer.
* Note that integer types are read in base-128 varint format, not with a
diff --git a/src/api/api.cc b/src/api/api.cc
index 5ab671c8c4168ac7ccd9d18ea4b9fda16734e4ad..eb880d8e77b80f941c6920c8f5b85896b6334cf0 100644
index eddb472d5608567255c5f55f4ae8b451abe5f6d3..c86687981fab3ed28306ada00c9d5dff5c594377 100644
--- a/src/api/api.cc
+++ b/src/api/api.cc
@@ -3603,6 +3603,10 @@ uint32_t ValueDeserializer::GetWireFormatVersion() const {
@@ -3605,6 +3605,10 @@ uint32_t ValueDeserializer::GetWireFormatVersion() const {
return private_->deserializer.GetWireFormatVersion();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 904f424662a91a0d3942f31fb8fbc72516efc8b8 Mon Sep 17 00:00:00 2001
From acdf8354d09cccdc782dfb00a208e3cf63d6f941 Mon Sep 17 00:00:00 2001
From: James M Snell <jasnell@gmail.com>
Date: Wed, 16 Mar 2022 08:59:21 -0700
Subject: Allow manually setting ValueSerializer format version
Expand All @@ -22,10 +22,10 @@ index 40ad805c7970cc9379e69f046205836dbd760373..596be18adeb3a5a81794aaa44b1d347d
* Writes out a header, which includes the format version.
*/
diff --git a/src/api/api.cc b/src/api/api.cc
index eb880d8e77b80f941c6920c8f5b85896b6334cf0..6e2191ef66d5c04b99f7d314df6fb4b75de3fd7a 100644
index c86687981fab3ed28306ada00c9d5dff5c594377..7058f9a13cb73cbbd0602ddeb589268306ee45ea 100644
--- a/src/api/api.cc
+++ b/src/api/api.cc
@@ -3471,6 +3471,10 @@ ValueSerializer::ValueSerializer(Isolate* v8_isolate, Delegate* delegate)
@@ -3473,6 +3473,10 @@ ValueSerializer::ValueSerializer(Isolate* v8_isolate, Delegate* delegate)

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

Expand All @@ -37,7 +37,7 @@ index eb880d8e77b80f941c6920c8f5b85896b6334cf0..6e2191ef66d5c04b99f7d314df6fb4b7

void ValueSerializer::SetTreatArrayBufferViewsAsHostObjects(bool mode) {
diff --git a/src/objects/value-serializer.cc b/src/objects/value-serializer.cc
index 89c0d96baff05ce3b2cf506386149c14ed81779e..f7da4eefa361807dec4a76bfaf0025299cfb6b86 100644
index 51abbe13a599ce3a0f1b7d6fffea3abcfbfbafa4..eeb74aa42a9d783bbfdedc171717422321435c3a 100644
--- a/src/objects/value-serializer.cc
+++ b/src/objects/value-serializer.cc
@@ -291,6 +291,7 @@ ValueSerializer::ValueSerializer(Isolate* isolate,
Expand Down
2 changes: 1 addition & 1 deletion patches/v8/0003-Add-ArrayBuffer-MaybeNew.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From aefb9a35747b3d42287a8a5f503d2ad7410b9b0c Mon Sep 17 00:00:00 2001
From 559da3ef33b370a64e2dd8b58cb840b3e594cdbe Mon Sep 17 00:00:00 2001
From: Kenton Varda <kenton@cloudflare.com>
Date: Fri, 16 Sep 2022 21:41:45 -0500
Subject: Add `ArrayBuffer::MaybeNew()`.
Expand Down
26 changes: 13 additions & 13 deletions patches/v8/0004-Allow-Windows-builds-under-Bazel.patch
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
From 10c8b0b828769d8a0dd3cf454704785a270fb2a6 Mon Sep 17 00:00:00 2001
From 7958c73efccb179171fcf9072a179f6b1aa67e24 Mon Sep 17 00:00:00 2001
From: Brendan Coll <bcoll@cloudflare.com>
Date: Thu, 16 Mar 2023 11:56:10 +0000
Subject: Allow Windows builds under Bazel


diff --git a/BUILD.bazel b/BUILD.bazel
index f2b2f4da0f8164ef29e36a3d1e9489b8e9c7b86e..84a281458aaa18525fa3640b3710414153e008b1 100644
index 1f269f9c149e56a7098697fc2346b5998b0c6e01..89bc2f54fc5e42a2cf6d6fa41742c2dfe2c9ab48 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -820,6 +820,7 @@ filegroup(
@@ -817,6 +817,7 @@ filegroup(
"src/base/platform/mutex.h",
"src/base/platform/platform.cc",
"src/base/platform/platform.h",
+ "src/base/platform/platform-posix.h", # Always included by src/execution/isolate.h
"src/base/platform/semaphore.cc",
"src/base/platform/semaphore.h",
"src/base/platform/time.cc",
@@ -863,7 +864,6 @@ filegroup(
@@ -860,7 +861,6 @@ filegroup(
] + select({
"@v8//bazel/config:is_posix": [
"src/base/platform/platform-posix.cc",
- "src/base/platform/platform-posix.h",
"src/base/platform/platform-posix-time.cc",
"src/base/platform/platform-posix-time.h",
],
@@ -886,6 +886,7 @@ filegroup(
@@ -883,6 +883,7 @@ filegroup(
"@v8//bazel/config:is_windows": [
"src/base/debug/stack_trace_win.cc",
"src/base/platform/platform-win32.cc",
+ "src/base/platform/platform-win32.h",
"src/base/win32-headers.h",
],
}),
@@ -1268,6 +1269,7 @@ filegroup(
@@ -1265,6 +1266,7 @@ filegroup(
"include/v8-wasm-trap-handler-posix.h",
"src/api/api.cc",
"src/api/api.h",
+ "include/v8-wasm-trap-handler-win.h",
"src/api/api-arguments.cc",
"src/api/api-arguments.h",
"src/api/api-arguments-inl.h",
@@ -2741,6 +2743,11 @@ filegroup(
@@ -2739,6 +2741,11 @@ filegroup(
"src/trap-handler/handler-inside-posix.cc",
"src/trap-handler/handler-outside-posix.cc",
],
Expand All @@ -52,7 +52,7 @@ index f2b2f4da0f8164ef29e36a3d1e9489b8e9c7b86e..84a281458aaa18525fa3640b37104141
"//conditions:default": [],
}) + select({
"@v8//bazel/config:v8_arm64_simulator": [
@@ -2748,13 +2755,6 @@ filegroup(
@@ -2746,13 +2753,6 @@ filegroup(
"src/trap-handler/trap-handler-simulator.h",
],
"//conditions:default": [],
Expand All @@ -66,7 +66,7 @@ index f2b2f4da0f8164ef29e36a3d1e9489b8e9c7b86e..84a281458aaa18525fa3640b37104141
}) + select({
"@v8//bazel/config:is_windows_64bit": [
"src/diagnostics/unwinding-info-win64.cc",
@@ -3793,6 +3793,9 @@ filegroup(
@@ -3805,6 +3805,9 @@ filegroup(
"@v8//bazel/config:is_msvc_asm_ia32": ["src/heap/base/asm/ia32/push_registers_masm.asm"],
"@v8//bazel/config:is_msvc_asm_x64": ["src/heap/base/asm/x64/push_registers_masm.asm"],
"@v8//bazel/config:is_msvc_asm_arm64": ["src/heap/base/asm/arm64/push_registers_masm.S"],
Expand All @@ -76,7 +76,7 @@ index f2b2f4da0f8164ef29e36a3d1e9489b8e9c7b86e..84a281458aaa18525fa3640b37104141
}),
)

@@ -4170,9 +4173,11 @@ filegroup(
@@ -4201,9 +4204,11 @@ filegroup(
"src/d8/d8-js.cc",
"src/d8/d8-platforms.cc",
"src/d8/d8-platforms.h",
Expand All @@ -90,7 +90,7 @@ index f2b2f4da0f8164ef29e36a3d1e9489b8e9c7b86e..84a281458aaa18525fa3640b37104141
)

genrule(
@@ -4522,7 +4527,7 @@ py_test(
@@ -4554,7 +4559,7 @@ py_test(
":noicu/d8",
":noicu/v8_build_config",
"//testing/pybase",
Expand All @@ -99,7 +99,7 @@ index f2b2f4da0f8164ef29e36a3d1e9489b8e9c7b86e..84a281458aaa18525fa3640b37104141
main = "tools/run-tests.py",
python_version = "PY3",
tags = [
@@ -4561,7 +4566,7 @@ py_test(
@@ -4593,7 +4598,7 @@ py_test(
":icu/d8",
":icu/v8_build_config",
"//testing/pybase",
Expand Down Expand Up @@ -178,7 +178,7 @@ index c81f278203126913c3bad74d31348706678ccf06..96e0f9cdb61d0d8f6597d337c2dd965b
name = "is_clang",
match_any = [
diff --git a/bazel/defs.bzl b/bazel/defs.bzl
index 6a3c868b002142754cbfa671e1d30a1459d32f92..7ab09f062fd0d9bad3785836cdaa2c8be789e0f2 100644
index ba1716d9ad466a1a7a0a8976631c6a82cad9b894..cda9c55baefe428bd85b8d98dbf475d07e9c4307 100644
--- a/bazel/defs.bzl
+++ b/bazel/defs.bzl
@@ -119,6 +119,24 @@ def _default_args():
Expand Down
2 changes: 1 addition & 1 deletion patches/v8/0005-Disable-bazel-whole-archive-build.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 847bacce9b981c36c973192aeedaba7d2abb1ec4 Mon Sep 17 00:00:00 2001
From 2e5ab7c0faa7ea01c8f3159540d9d563ebed2cdd Mon Sep 17 00:00:00 2001
From: Felix Hanau <felix@cloudflare.com>
Date: Tue, 11 Apr 2023 14:41:31 -0400
Subject: Disable bazel whole-archive build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 9b8c6cdd0a183a34d4516ff924af9fd9fa0477fe Mon Sep 17 00:00:00 2001
From 9bca82fb298ec759a04383fc830827eaf205ccbd Mon Sep 17 00:00:00 2001
From: Felix Hanau <felix@cloudflare.com>
Date: Wed, 7 Jun 2023 21:40:54 -0400
Subject: Speed up V8 bazel build by always using target cfg
Expand All @@ -12,7 +12,7 @@ generated files as the output set. While unrelated to the build cfg change,
this also improves build times.

diff --git a/BUILD.bazel b/BUILD.bazel
index 84a281458aaa18525fa3640b3710414153e008b1..55eaca3189c6b9464c2a0a795efea9bdc83ab8da 100644
index 89bc2f54fc5e42a2cf6d6fa41742c2dfe2c9ab48..675c36f7784409f10b28b6fca93d4fd39f69a17d 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -17,6 +17,7 @@ load(
Expand All @@ -23,7 +23,7 @@ index 84a281458aaa18525fa3640b3710414153e008b1..55eaca3189c6b9464c2a0a795efea9bd
)
load(":bazel/v8-non-pointer-compression.bzl", "v8_binary_non_pointer_compression")

@@ -4180,22 +4181,20 @@ filegroup(
@@ -4211,22 +4212,20 @@ filegroup(
}),
)

Expand Down Expand Up @@ -52,7 +52,7 @@ index 84a281458aaa18525fa3640b3710414153e008b1..55eaca3189c6b9464c2a0a795efea9bd
)

v8_mksnapshot(
@@ -4395,8 +4394,6 @@ v8_binary(
@@ -4427,8 +4426,6 @@ v8_binary(
srcs = [
"src/regexp/gen-regexp-special-case.cc",
"src/regexp/special-case.h",
Expand All @@ -61,7 +61,7 @@ index 84a281458aaa18525fa3640b3710414153e008b1..55eaca3189c6b9464c2a0a795efea9bd
],
copts = ["-Wno-implicit-fallthrough"],
defines = [
@@ -4408,6 +4405,7 @@ v8_binary(
@@ -4440,6 +4437,7 @@ v8_binary(
],
deps = [
"//external:absl_optional",
Expand All @@ -70,7 +70,7 @@ index 84a281458aaa18525fa3640b3710414153e008b1..55eaca3189c6b9464c2a0a795efea9bd
],
)
diff --git a/bazel/defs.bzl b/bazel/defs.bzl
index 7ab09f062fd0d9bad3785836cdaa2c8be789e0f2..bb75ea080ed4a4e441e212b067c27b6d9316f81c 100644
index cda9c55baefe428bd85b8d98dbf475d07e9c4307..658b44b7deca596ef8ea5b178b2d51b0d06820d3 100644
--- a/bazel/defs.bzl
+++ b/bazel/defs.bzl
@@ -340,6 +340,15 @@ def v8_library(
Expand Down
Loading

0 comments on commit 2178684

Please sign in to comment.