Skip to content

Commit

Permalink
v8 13.2 update
Browse files Browse the repository at this point in the history
  • Loading branch information
mikea committed Jan 22, 2025
1 parent 2cfbca6 commit 91e9bbb
Show file tree
Hide file tree
Showing 24 changed files with 160 additions and 187 deletions.
67 changes: 36 additions & 31 deletions build/deps/v8.bzl
Original file line number Diff line number Diff line change
@@ -1,6 +1,34 @@
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

VERSION = "13.2.152.34"

INTEGRITY = "sha256-wER1sDu6Ez7pXzLDufpxYE26d3S1WdsyuQxoFvzLc5Q="

PATCHES = [
"0001-Allow-manually-setting-ValueDeserializer-format-vers.patch",
"0002-Allow-manually-setting-ValueSerializer-format-versio.patch",
"0003-Allow-Windows-builds-under-Bazel.patch",
"0004-Disable-bazel-whole-archive-build.patch",
"0005-Speed-up-V8-bazel-build-by-always-using-target-cfg.patch",
"0006-Implement-Promise-Context-Tagging.patch",
"0007-Randomize-the-initial-ExecutionContextId-used-by-the.patch",
"0008-increase-visibility-of-virtual-method.patch",
"0009-Add-ValueSerializer-SetTreatFunctionsAsHostObjects.patch",
"0010-Set-torque-generator-path-to-external-v8.-This-allow.patch",
"0011-Modify-where-to-look-for-fp16-dependency.-This-depen.patch",
"0012-Expose-v8-Symbol-GetDispose.patch",
"0013-Revert-TracedReference-deref-API-removal.patch",
"0014-Revert-heap-Add-masm-specific-unwinding-annotations-.patch",
"0015-Update-illegal-invocation-error-message-in-v8.patch",
"0016-Implement-cross-request-context-promise-resolve-hand.patch",
"0017-Modify-where-to-look-for-fast_float-dependency.patch",
"0018-Return-rejected-promise-from-WebAssembly.compile-if-.patch",
"0019-Add-another-slot-in-the-isolate-for-embedder.patch",
"0020-Add-ValueSerializer-SetTreatProxiesAsHostObjects.patch",
"0021-Disable-memory-leak-assert-when-shutting-down-V8.patch",
]

# V8 and its dependencies
#
# Note that googlesource does not generate tarballs deterministically, so we cannot use
Expand All @@ -17,50 +45,27 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def deps_v8():
http_archive(
name = "v8",
integrity = "sha256-s+oY+fAG0cXTGmKDxbioUudjUciK1dU2reu7lZ+uB1w=",
integrity = INTEGRITY,
patch_args = ["-p1"],
patches = [
"//:patches/v8/0001-Allow-manually-setting-ValueDeserializer-format-vers.patch",
"//:patches/v8/0002-Allow-manually-setting-ValueSerializer-format-versio.patch",
"//:patches/v8/0003-Allow-Windows-builds-under-Bazel.patch",
"//:patches/v8/0004-Disable-bazel-whole-archive-build.patch",
"//:patches/v8/0005-Speed-up-V8-bazel-build-by-always-using-target-cfg.patch",
"//:patches/v8/0006-Implement-Promise-Context-Tagging.patch",
"//:patches/v8/0007-Randomize-the-initial-ExecutionContextId-used-by-the.patch",
"//:patches/v8/0008-increase-visibility-of-virtual-method.patch",
"//:patches/v8/0009-Add-ValueSerializer-SetTreatFunctionsAsHostObjects.patch",
"//:patches/v8/0010-Set-torque-generator-path-to-external-v8.-This-allow.patch",
"//:patches/v8/0011-Modify-where-to-look-for-fp16-dependency.-This-depen.patch",
"//:patches/v8/0012-Expose-v8-Symbol-GetDispose.patch",
"//:patches/v8/0013-Revert-TracedReference-deref-API-removal.patch",
"//:patches/v8/0014-Revert-heap-Add-masm-specific-unwinding-annotations-.patch",
"//:patches/v8/0015-Update-illegal-invocation-error-message-in-v8.patch",
"//:patches/v8/0016-Implement-cross-request-context-promise-resolve-hand.patch",
"//:patches/v8/0017-Modify-where-to-look-for-fast_float-dependency.patch",
"//:patches/v8/0018-Return-rejected-promise-from-WebAssembly.compile-if-.patch",
"//:patches/v8/0019-codegen-Don-t-pass-a-nullptr-in-InitUnwindingRecord-.patch",
"//:patches/v8/0020-Add-another-slot-in-the-isolate-for-embedder.patch",
"//:patches/v8/0021-Add-ValueSerializer-SetTreatProxiesAsHostObjects.patch",
"//:patches/v8/0022-Disable-memory-leak-assert-when-shutting-down-V8.patch",
],
strip_prefix = "v8-13.1.201.8",
url = "https://github.com/v8/v8/archive/refs/tags/13.1.201.8.tar.gz",
patches = ["//:patches/v8/" + p for p in PATCHES],
strip_prefix = "v8-" + VERSION,
url = "https://github.com/v8/v8/archive/refs/tags/" + VERSION + ".tar.gz",
)

git_repository(
name = "com_googlesource_chromium_icu",
build_file = "@v8//:bazel/BUILD.icu",
commit = "9408c6fd4a39e6fef0e1c4077602e1c83b15f3fb",
commit = "4239b1559d11d4fa66c100543eda4161e060311e",
patch_cmds = ["find source -name BUILD.bazel | xargs rm"],
patch_cmds_win = ["Get-ChildItem -Path source -File -Include BUILD.bazel -Recurse | Remove-Item"],
remote = "https://chromium.googlesource.com/chromium/deps/icu.git",
)

http_archive(
name = "perfetto",
integrity = "sha256-jRxr9E8b2wmKtwzWDaPOa25zHk6yHdUrJSfL3PhdmE0=",
strip_prefix = "perfetto-48.1",
url = "https://github.com/google/perfetto/archive/refs/tags/v48.1.tar.gz",
integrity = "sha256-CHGpKhYqxWVbfXJPk1mxWnXE6SRycW7bxCJ6ZKRoC+Q=",
strip_prefix = "perfetto-49.0",
url = "https://github.com/google/perfetto/archive/refs/tags/v49.0.tar.gz",
)

# For use with perfetto
Expand Down
3 changes: 3 additions & 0 deletions build/perfetto/perfetto_cfg.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ PERFETTO_CONFIG = struct(
# your own demangling implementation.
demangle_wrapper = ["//:src_trace_processor_demangle"],
llvm_demangle = ["@perfetto_dep_llvm_demangle//:llvm_demangle"],

# no open csd support needed
open_csd = [],
),

# This struct allows embedders to customize the cc_opts for Perfetto
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From 0d006413157bb6d286eca2dff77956a9e4ed36e5 Mon Sep 17 00:00:00 2001
From 38b8fe7083c7b168204f0225040403a5a5887524 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 29dd26037bc9ce4c21f421cba32bc3077bb064d2..cda724c712dda198f3c0c6b1d94e0a6d70b745fd 100644
index 3e15759b3d30ff0ac8c311fa409b34d19ba7ae2c..88b9002375fba64bd6b4aa41eaaccce25a861b23 100644
--- a/src/api/api.cc
+++ b/src/api/api.cc
@@ -3619,6 +3619,10 @@ uint32_t ValueDeserializer::GetWireFormatVersion() const {
@@ -3626,6 +3626,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 8aa5173892d869765d77bbe83e3c97ba5be123b3 Mon Sep 17 00:00:00 2001
From a5f845b13014fddc6f6f108b7b466159b06229d2 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 cda724c712dda198f3c0c6b1d94e0a6d70b745fd..b69788395974538231aa3d2094453630d0c4f62a 100644
index 88b9002375fba64bd6b4aa41eaaccce25a861b23..2e2dcb6a26d61bddd23a783fc50d2f22b2ed4070 100644
--- a/src/api/api.cc
+++ b/src/api/api.cc
@@ -3487,6 +3487,10 @@ ValueSerializer::ValueSerializer(Isolate* v8_isolate, Delegate* delegate)
@@ -3494,6 +3494,10 @@ ValueSerializer::ValueSerializer(Isolate* v8_isolate, Delegate* delegate)

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

Expand All @@ -37,7 +37,7 @@ index cda724c712dda198f3c0c6b1d94e0a6d70b745fd..b69788395974538231aa3d2094453630

void ValueSerializer::SetTreatArrayBufferViewsAsHostObjects(bool mode) {
diff --git a/src/objects/value-serializer.cc b/src/objects/value-serializer.cc
index b62f2f907806fa3fa6189e15908aaeb218b06b82..187700b273d5d79b79b554d597ca6e605cdb4d26 100644
index fbd616fbf6f7678279a8ead4fd91e7b9bae3fc5d..7683d5e8e802503ff76ded13b2dfdba44e8fbdaa 100644
--- a/src/objects/value-serializer.cc
+++ b/src/objects/value-serializer.cc
@@ -291,6 +291,7 @@ ValueSerializer::ValueSerializer(Isolate* isolate,
Expand Down
30 changes: 15 additions & 15 deletions patches/v8/0003-Allow-Windows-builds-under-Bazel.patch
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
From 162d27ca507656e5f99c407fa31cef577b7266cf Mon Sep 17 00:00:00 2001
From 3f722017889ee5ca565a41ff57954ef3a52b90eb 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 762483456429100f864e9d3f25e6e974c8bd8f05..80bf8f89783334bbcf44f05a8de3f32dd04790f0 100644
index 6c19fa58f66ea0e680be6881cd4f402f4c7bef93..13e4bc0c80f23907cf07a7d338a6bd4398e413ca 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -826,6 +826,7 @@ filegroup(
@@ -829,6 +829,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",
@@ -869,7 +870,6 @@ filegroup(
@@ -872,7 +873,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",
],
@@ -892,6 +892,7 @@ filegroup(
@@ -895,6 +895,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",
],
}),
@@ -1274,6 +1275,7 @@ filegroup(
@@ -1277,6 +1278,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",
@@ -2755,6 +2757,11 @@ filegroup(
@@ -2762,6 +2764,11 @@ filegroup(
"src/trap-handler/handler-inside-posix.cc",
"src/trap-handler/handler-outside-posix.cc",
],
Expand All @@ -52,7 +52,7 @@ index 762483456429100f864e9d3f25e6e974c8bd8f05..80bf8f89783334bbcf44f05a8de3f32d
"//conditions:default": [],
}) + select({
"@v8//bazel/config:v8_arm64_simulator": [
@@ -2762,13 +2769,6 @@ filegroup(
@@ -2769,13 +2776,6 @@ filegroup(
"src/trap-handler/trap-handler-simulator.h",
],
"//conditions:default": [],
Expand All @@ -66,7 +66,7 @@ index 762483456429100f864e9d3f25e6e974c8bd8f05..80bf8f89783334bbcf44f05a8de3f32d
}) + select({
"@v8//bazel/config:is_windows_64bit": [
"src/diagnostics/unwinding-info-win64.cc",
@@ -3825,6 +3825,9 @@ filegroup(
@@ -3836,6 +3836,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 762483456429100f864e9d3f25e6e974c8bd8f05..80bf8f89783334bbcf44f05a8de3f32d
}),
)

@@ -4227,9 +4230,11 @@ filegroup(
@@ -4232,9 +4235,11 @@ filegroup(
"src/d8/d8-js.cc",
"src/d8/d8-platforms.cc",
"src/d8/d8-platforms.h",
Expand All @@ -90,7 +90,7 @@ index 762483456429100f864e9d3f25e6e974c8bd8f05..80bf8f89783334bbcf44f05a8de3f32d
)

genrule(
@@ -4580,7 +4585,7 @@ py_test(
@@ -4585,7 +4590,7 @@ py_test(
":noicu/d8",
":noicu/v8_build_config",
"//testing/pybase",
Expand All @@ -99,7 +99,7 @@ index 762483456429100f864e9d3f25e6e974c8bd8f05..80bf8f89783334bbcf44f05a8de3f32d
main = "tools/run-tests.py",
python_version = "PY3",
tags = [
@@ -4619,7 +4624,7 @@ py_test(
@@ -4624,7 +4629,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 f961346e942d3f106ccd87f40bbe8c3a262c5261..a854e3cb4b3a70a4e683b1112598deefb28cbe58 100644
index 16f2a61faa39bf189ddeb7ba01e7fb8ef9eb83f3..e607fb59079e85de87f9e84eb7b6973cca8fc46d 100644
--- a/bazel/defs.bzl
+++ b/bazel/defs.bzl
@@ -119,6 +119,24 @@ def _default_args():
Expand Down Expand Up @@ -230,15 +230,15 @@ index f961346e942d3f106ccd87f40bbe8c3a262c5261..a854e3cb4b3a70a4e683b1112598deef
],
"@v8//bazel/config:is_macos": ["-pthread"],
"//conditions:default": ["-Wl,--no-as-needed -ldl -pthread"],
@@ -492,6 +520,7 @@ def v8_mksnapshot(name, args, suffix = ""):
@@ -495,6 +523,7 @@ def v8_mksnapshot(name, args, suffix = ""):
suffix = suffix,
target_os = select({
"@v8//bazel/config:is_macos": "mac",
+ "@v8//bazel/config:is_windows": "win",
"//conditions:default": "",
}),
)
@@ -503,6 +532,7 @@ def v8_mksnapshot(name, args, suffix = ""):
@@ -506,6 +535,7 @@ def v8_mksnapshot(name, args, suffix = ""):
suffix = suffix,
target_os = select({
"@v8//bazel/config:is_macos": "mac",
Expand Down
2 changes: 1 addition & 1 deletion patches/v8/0004-Disable-bazel-whole-archive-build.patch
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From fc8627f4d7aac841d000f3e88208e619eaebd84a Mon Sep 17 00:00:00 2001
From 23f8db09c4d8ac24637d0f9d190c8247f67415ed 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 a62bdfd1858fff43ed8248a3d39b7bd00dd06e25 Mon Sep 17 00:00:00 2001
From b44a9a7a78ddfe2d29b96b05ea9ed3c3638088bd 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 80bf8f89783334bbcf44f05a8de3f32dd04790f0..23915096536d7f80e46b7dc33ca2ee56a61487bc 100644
index 13e4bc0c80f23907cf07a7d338a6bd4398e413ca..f62048d985496583457ef370bea74c761524bf3a 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -17,6 +17,7 @@ load(
Expand All @@ -23,7 +23,7 @@ index 80bf8f89783334bbcf44f05a8de3f32dd04790f0..23915096536d7f80e46b7dc33ca2ee56
)
load(":bazel/v8-non-pointer-compression.bzl", "v8_binary_non_pointer_compression")

@@ -4237,22 +4238,20 @@ filegroup(
@@ -4242,22 +4243,20 @@ filegroup(
}),
)

Expand Down Expand Up @@ -52,7 +52,7 @@ index 80bf8f89783334bbcf44f05a8de3f32dd04790f0..23915096536d7f80e46b7dc33ca2ee56
)

v8_mksnapshot(
@@ -4453,8 +4452,6 @@ v8_binary(
@@ -4458,8 +4457,6 @@ v8_binary(
srcs = [
"src/regexp/gen-regexp-special-case.cc",
"src/regexp/special-case.h",
Expand All @@ -61,7 +61,7 @@ index 80bf8f89783334bbcf44f05a8de3f32dd04790f0..23915096536d7f80e46b7dc33ca2ee56
],
copts = ["-Wno-implicit-fallthrough"],
defines = [
@@ -4466,6 +4463,7 @@ v8_binary(
@@ -4471,6 +4468,7 @@ v8_binary(
],
deps = [
"//external:absl_optional",
Expand All @@ -70,10 +70,10 @@ index 80bf8f89783334bbcf44f05a8de3f32dd04790f0..23915096536d7f80e46b7dc33ca2ee56
],
)
diff --git a/bazel/defs.bzl b/bazel/defs.bzl
index a854e3cb4b3a70a4e683b1112598deefb28cbe58..a0e8b91ecc9deb4e045c947d2e62eba0bc87cf0e 100644
index e607fb59079e85de87f9e84eb7b6973cca8fc46d..1a6afe57fa386afe3900e4a3a165426f14b1f8a4 100644
--- a/bazel/defs.bzl
+++ b/bazel/defs.bzl
@@ -337,6 +337,15 @@ def v8_library(
@@ -340,6 +340,15 @@ def v8_library(
**kwargs
)

Expand All @@ -89,7 +89,7 @@ index a854e3cb4b3a70a4e683b1112598deefb28cbe58..a0e8b91ecc9deb4e045c947d2e62eba0
# Use a single generator target for torque definitions and initializers. We can
# split the set of outputs by using OutputGroupInfo, that way we do not need to
# run the torque generator twice.
@@ -401,7 +410,7 @@ _v8_torque_files = rule(
@@ -404,7 +413,7 @@ _v8_torque_files = rule(
"tool": attr.label(
allow_files = True,
executable = True,
Expand All @@ -98,7 +98,7 @@ index a854e3cb4b3a70a4e683b1112598deefb28cbe58..a0e8b91ecc9deb4e045c947d2e62eba0
),
"args": attr.string_list(),
},
@@ -502,13 +511,16 @@ _v8_mksnapshot = rule(
@@ -505,13 +514,16 @@ _v8_mksnapshot = rule(
mandatory = True,
allow_files = True,
executable = True,
Expand All @@ -117,7 +117,7 @@ index a854e3cb4b3a70a4e683b1112598deefb28cbe58..a0e8b91ecc9deb4e045c947d2e62eba0
)

def v8_mksnapshot(name, args, suffix = ""):
@@ -633,3 +645,34 @@ def v8_build_config(name, arch):
@@ -637,3 +649,34 @@ def v8_build_config(name, arch):
outs = ["icu/" + name + ".json"],
cmd = "echo '" + build_config_content(cpu, "true") + "' > \"$@\"",
)
Expand Down
Loading

0 comments on commit 91e9bbb

Please sign in to comment.