Skip to content

Commit d399137

Browse files
committed
Merge upstream denoland/rusty_v8 into openworkers/rusty-v8
Brings in simdutf support, crdtp/deno_inspector, PlatformImpl task ownership. Resolved conflicts: - Cargo.toml: kept openworkers-v8 name/description, took upstream version 146.8.0 - ci.yml: kept our features string system (none/ptrcomp/sandbox), removed upstream simdutf-only builds, simdutf now always enabled in all builds - Cargo.lock: regenerated from scratch
2 parents b1b66e9 + ba58a4f commit d399137

26 files changed

Lines changed: 4404 additions & 75 deletions

.github/workflows/ci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ jobs:
115115
variant: release
116116
features: none
117117

118-
119118
env:
120119
V8_FROM_SOURCE: true
121120
CARGO_VARIANT_FLAG: ${{ matrix.config.variant == 'release' && '--release' || '' }}
@@ -154,13 +153,13 @@ jobs:
154153
shell: bash
155154
run: |
156155
if [ "${{ matrix.config.features }}" = "sandbox" ]; then
157-
echo "CARGO_FEATURE_FLAGS=--features v8_enable_sandbox" >> $GITHUB_ENV
156+
echo "CARGO_FEATURE_FLAGS=--features v8_enable_sandbox --features simdutf" >> $GITHUB_ENV
158157
echo "FEATURES_SUFFIX=_sandbox" >> $GITHUB_ENV
159158
elif [ "${{ matrix.config.features }}" = "ptrcomp" ]; then
160-
echo "CARGO_FEATURE_FLAGS=--features v8_enable_pointer_compression" >> $GITHUB_ENV
159+
echo "CARGO_FEATURE_FLAGS=--features v8_enable_pointer_compression --features simdutf" >> $GITHUB_ENV
161160
echo "FEATURES_SUFFIX=_ptrcomp" >> $GITHUB_ENV
162161
else
163-
echo "CARGO_FEATURE_FLAGS=" >> $GITHUB_ENV
162+
echo "CARGO_FEATURE_FLAGS=--features simdutf" >> $GITHUB_ENV
164163
echo "FEATURES_SUFFIX=" >> $GITHUB_ENV
165164
fi
166165

BUILD.gn

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
22
import("//build/config/host_byteorder.gni")
33

4+
declare_args() {
5+
rusty_v8_enable_simdutf = false
6+
}
7+
48
static_library("rusty_v8") {
59
complete_static_lib = true
6-
sources = [ "src/binding.cc" ]
10+
sources = [
11+
"src/binding.cc",
12+
"src/crdtp_binding.cc",
13+
]
714
deps = [
815
"//build/config:shared_library_deps",
916
"//v8:v8",
1017
"//v8:v8_libbase",
1118
"//v8:v8_libplatform",
19+
"//v8/third_party/inspector_protocol:crdtp",
20+
"//src/deno_inspector:deno_inspector_protocol",
1221
]
22+
if (rusty_v8_enable_simdutf) {
23+
deps += [ "//third_party/simdutf:simdutf" ]
24+
}
1325
configs -= [
1426
"//build/config/compiler:default_init_stack_vars",
1527
"//build/config/compiler:thin_archive",
@@ -33,12 +45,22 @@ config("rusty_v8_config") {
3345
# We need these directories in the search path to be able to include some
3446
# internal V8 headers.
3547
include_dirs = [
48+
".",
3649
"v8",
50+
".",
51+
"$target_gen_dir",
3752
"$target_gen_dir/v8",
53+
"$target_gen_dir/src/inspector",
54+
"$target_gen_dir/src/deno_inspector",
3855
]
3956

57+
defines = []
4058
if (is_debug) {
41-
defines = [ "DEBUG" ]
59+
defines += [ "DEBUG" ]
60+
}
61+
62+
if (rusty_v8_enable_simdutf) {
63+
defines += [ "RUSTY_V8_ENABLE_SIMDUTF" ]
4264
}
4365

4466
if (is_clang) {

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "openworkers-v8"
3-
version = "146.5.2"
3+
version = "146.8.0"
44
description = "Rust bindings to V8 (fork with Locker/UnenteredIsolate support for isolate pooling)"
55
readme = "README.md"
66
authors = ["the Deno authors", "OpenWorkers Authors <contact@openworkers.dev>"]
@@ -105,6 +105,7 @@ opt-level = 1
105105
[features]
106106
default = ["use_custom_libcxx"]
107107
use_custom_libcxx = []
108+
simdutf = []
108109
v8_enable_pointer_compression = []
109110
v8_enable_sandbox = ["v8_enable_pointer_compression"]
110111
v8_enable_v8_checks = []

build.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,11 @@ fn build_v8(is_asan: bool) {
312312
env::var("CARGO_FEATURE_V8_ENABLE_V8_CHECKS").is_ok()
313313
));
314314

315+
gn_args.push(format!(
316+
"rusty_v8_enable_simdutf={}",
317+
env::var("CARGO_FEATURE_SIMDUTF").is_ok()
318+
));
319+
315320
// Fix GN's host_cpu detection when using x86_64 bins on Apple Silicon
316321
if cfg!(target_os = "macos") && cfg!(target_arch = "aarch64") {
317322
gn_args.push("host_cpu=\"arm64\"".to_string());
@@ -539,6 +544,9 @@ fn prebuilt_features_suffix() -> String {
539544
if env::var("CARGO_FEATURE_V8_ENABLE_SANDBOX").is_ok() {
540545
features.push_str("_sandbox");
541546
}
547+
if env::var("CARGO_FEATURE_SIMDUTF").is_ok() {
548+
features.push_str("_simdutf");
549+
}
542550
features
543551
}
544552

0 commit comments

Comments
 (0)