Skip to content

Commit

Permalink
Merge pull request #2857 from cloudflare/dlapid/v8-12.9
Browse files Browse the repository at this point in the history
Revert v8 to 12.9
  • Loading branch information
danlapid authored Oct 8, 2024
2 parents 77ebaf0 + cd8125b commit 0f366d5
Show file tree
Hide file tree
Showing 24 changed files with 146 additions and 237 deletions.
14 changes: 3 additions & 11 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,6 @@ 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 @@ -336,7 +329,7 @@ npm_repositories()

http_archive(
name = "v8",
integrity = "sha256-xrrRWhvzf0Kl9FVZ8xO7zb07gefU3sx6uLiPdQ6VV0E=",
integrity = "sha256-OTr3bwOCu50VAtMUd7d1kZXIkT1OoF9+zo9g3E7Vyvo=",
patch_args = ["-p1"],
patches = [
"//:patches/v8/0001-Allow-manually-setting-ValueDeserializer-format-vers.patch",
Expand All @@ -358,10 +351,9 @@ 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-13.0.245.1",
url = "https://github.com/v8/v8/archive/refs/tags/13.0.245.1.tar.gz",
strip_prefix = "v8-12.9.202.27",
url = "https://github.com/v8/v8/archive/refs/tags/12.9.202.27.tar.gz",
)

git_repository(
Expand Down
10 changes: 5 additions & 5 deletions docs/v8-updates.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ To update the version of V8 used by workerd, the steps are:
```

6. Rebase the workerd V8 changes onto the new version of V8. For example, assuming
we are updating to 11.4.183.8 and there are 8 workerd patches for V8, the
we are updating to 11.4.183.8 and there are 19 workerd patches for V8, the
command would be:

```sh
git rebase --onto 11.4.183.8 HEAD~8
git rebase --onto 11.4.183.8 HEAD~19
```

Note that `HEAD~8`, here and elsewhere, could be replaced with
Note that `HEAD~19`, here and elsewhere, could be replaced with
`$(git describe --tags --abbrev=0)`, which prints the name of the tag on which the
branch is based.

Expand All @@ -52,11 +52,11 @@ To update the version of V8 used by workerd, the steps are:
Ideally at this stage, you should be able to build and test the local V8 with the
patches applied. See the V8 [Testing](https://v8.dev/docs/test) page.

7. Re-generate workerd's V8 patches. Assuming there are 8 workerd patches for V8,
7. Re-generate workerd's V8 patches. Assuming there are 19 workerd patches for V8,
the command would be:
```sh
git format-patch --full-index -k --no-signature --no-stat HEAD~8
git format-patch --full-index -k --no-signature --no-stat HEAD~19
```
8. Remove the existing patches from `workerd/patches/v8` and copy over the latest generated patches
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From ab1c70706bef5ba96894e955724f61df62daec8b Mon Sep 17 00:00:00 2001
From 1716f5dcb290435138f2d2c9b15f7260da8f0934 Mon Sep 17 00:00:00 2001
From: Alex Robinson <[email protected]>
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 eddb472d5608567255c5f55f4ae8b451abe5f6d3..c86687981fab3ed28306ada00c9d5dff5c594377 100644
index 5ab671c8c4168ac7ccd9d18ea4b9fda16734e4ad..eb880d8e77b80f941c6920c8f5b85896b6334cf0 100644
--- a/src/api/api.cc
+++ b/src/api/api.cc
@@ -3605,6 +3605,10 @@ uint32_t ValueDeserializer::GetWireFormatVersion() const {
@@ -3603,6 +3603,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 acdf8354d09cccdc782dfb00a208e3cf63d6f941 Mon Sep 17 00:00:00 2001
From 761b74e4f5c0298dc28ea84ec27050c1503bc196 Mon Sep 17 00:00:00 2001
From: James M Snell <[email protected]>
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 c86687981fab3ed28306ada00c9d5dff5c594377..7058f9a13cb73cbbd0602ddeb589268306ee45ea 100644
index eb880d8e77b80f941c6920c8f5b85896b6334cf0..6e2191ef66d5c04b99f7d314df6fb4b75de3fd7a 100644
--- a/src/api/api.cc
+++ b/src/api/api.cc
@@ -3473,6 +3473,10 @@ ValueSerializer::ValueSerializer(Isolate* v8_isolate, Delegate* delegate)
@@ -3471,6 +3471,10 @@ ValueSerializer::ValueSerializer(Isolate* v8_isolate, Delegate* delegate)

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

Expand All @@ -37,7 +37,7 @@ index c86687981fab3ed28306ada00c9d5dff5c594377..7058f9a13cb73cbbd0602ddeb5892683

void ValueSerializer::SetTreatArrayBufferViewsAsHostObjects(bool mode) {
diff --git a/src/objects/value-serializer.cc b/src/objects/value-serializer.cc
index 51abbe13a599ce3a0f1b7d6fffea3abcfbfbafa4..eeb74aa42a9d783bbfdedc171717422321435c3a 100644
index 89c0d96baff05ce3b2cf506386149c14ed81779e..f7da4eefa361807dec4a76bfaf0025299cfb6b86 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 559da3ef33b370a64e2dd8b58cb840b3e594cdbe Mon Sep 17 00:00:00 2001
From 5f11274f4eadae25a81124d03dca88348d7c072c Mon Sep 17 00:00:00 2001
From: Kenton Varda <[email protected]>
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 7958c73efccb179171fcf9072a179f6b1aa67e24 Mon Sep 17 00:00:00 2001
From 9fa08868bc3ef667fbe0c1d4922bdd2f8f43acfa Mon Sep 17 00:00:00 2001
From: Brendan Coll <[email protected]>
Date: Thu, 16 Mar 2023 11:56:10 +0000
Subject: Allow Windows builds under Bazel


diff --git a/BUILD.bazel b/BUILD.bazel
index 1f269f9c149e56a7098697fc2346b5998b0c6e01..89bc2f54fc5e42a2cf6d6fa41742c2dfe2c9ab48 100644
index f2b2f4da0f8164ef29e36a3d1e9489b8e9c7b86e..84a281458aaa18525fa3640b3710414153e008b1 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -817,6 +817,7 @@ filegroup(
@@ -820,6 +820,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",
@@ -860,7 +861,6 @@ filegroup(
@@ -863,7 +864,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",
],
@@ -883,6 +883,7 @@ filegroup(
@@ -886,6 +886,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",
],
}),
@@ -1265,6 +1266,7 @@ filegroup(
@@ -1268,6 +1269,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",
@@ -2739,6 +2741,11 @@ filegroup(
@@ -2741,6 +2743,11 @@ filegroup(
"src/trap-handler/handler-inside-posix.cc",
"src/trap-handler/handler-outside-posix.cc",
],
Expand All @@ -52,7 +52,7 @@ index 1f269f9c149e56a7098697fc2346b5998b0c6e01..89bc2f54fc5e42a2cf6d6fa41742c2df
"//conditions:default": [],
}) + select({
"@v8//bazel/config:v8_arm64_simulator": [
@@ -2746,13 +2753,6 @@ filegroup(
@@ -2748,13 +2755,6 @@ filegroup(
"src/trap-handler/trap-handler-simulator.h",
],
"//conditions:default": [],
Expand All @@ -66,7 +66,7 @@ index 1f269f9c149e56a7098697fc2346b5998b0c6e01..89bc2f54fc5e42a2cf6d6fa41742c2df
}) + select({
"@v8//bazel/config:is_windows_64bit": [
"src/diagnostics/unwinding-info-win64.cc",
@@ -3805,6 +3805,9 @@ filegroup(
@@ -3793,6 +3793,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 1f269f9c149e56a7098697fc2346b5998b0c6e01..89bc2f54fc5e42a2cf6d6fa41742c2df
}),
)

@@ -4201,9 +4204,11 @@ filegroup(
@@ -4170,9 +4173,11 @@ filegroup(
"src/d8/d8-js.cc",
"src/d8/d8-platforms.cc",
"src/d8/d8-platforms.h",
Expand All @@ -90,7 +90,7 @@ index 1f269f9c149e56a7098697fc2346b5998b0c6e01..89bc2f54fc5e42a2cf6d6fa41742c2df
)

genrule(
@@ -4554,7 +4559,7 @@ py_test(
@@ -4522,7 +4527,7 @@ py_test(
":noicu/d8",
":noicu/v8_build_config",
"//testing/pybase",
Expand All @@ -99,7 +99,7 @@ index 1f269f9c149e56a7098697fc2346b5998b0c6e01..89bc2f54fc5e42a2cf6d6fa41742c2df
main = "tools/run-tests.py",
python_version = "PY3",
tags = [
@@ -4593,7 +4598,7 @@ py_test(
@@ -4561,7 +4566,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 ba1716d9ad466a1a7a0a8976631c6a82cad9b894..cda9c55baefe428bd85b8d98dbf475d07e9c4307 100644
index 6a3c868b002142754cbfa671e1d30a1459d32f92..7ab09f062fd0d9bad3785836cdaa2c8be789e0f2 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 2e5ab7c0faa7ea01c8f3159540d9d563ebed2cdd Mon Sep 17 00:00:00 2001
From 4dd002f20f669a7b845e8a73e82997eb6e02d0e2 Mon Sep 17 00:00:00 2001
From: Felix Hanau <[email protected]>
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 9bca82fb298ec759a04383fc830827eaf205ccbd Mon Sep 17 00:00:00 2001
From de23c2346084629d63b6d620a4a0a70fd9a9390a Mon Sep 17 00:00:00 2001
From: Felix Hanau <[email protected]>
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 89bc2f54fc5e42a2cf6d6fa41742c2dfe2c9ab48..675c36f7784409f10b28b6fca93d4fd39f69a17d 100644
index 84a281458aaa18525fa3640b3710414153e008b1..55eaca3189c6b9464c2a0a795efea9bdc83ab8da 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -17,6 +17,7 @@ load(
Expand All @@ -23,7 +23,7 @@ index 89bc2f54fc5e42a2cf6d6fa41742c2dfe2c9ab48..675c36f7784409f10b28b6fca93d4fd3
)
load(":bazel/v8-non-pointer-compression.bzl", "v8_binary_non_pointer_compression")

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

Expand Down Expand Up @@ -52,7 +52,7 @@ index 89bc2f54fc5e42a2cf6d6fa41742c2dfe2c9ab48..675c36f7784409f10b28b6fca93d4fd3
)

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

0 comments on commit 0f366d5

Please sign in to comment.