summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-08-15 14:12:11 +0200
committerGitHub <noreply@github.com>2022-08-15 14:12:11 +0200
commit5a4f84a0e1a514c0e6040116953717051b44c168 (patch)
tree6cdbaa14f14963cb8567a56570bd6e299a35571e
parent18dcc64910e6dd5f26f3828a07f2ff0845dfaa4b (diff)
chore: upgrade rusty_v8 to 0.48.1 (#15310)
-rw-r--r--Cargo.lock4
-rw-r--r--cli/tests/testdata/worker_close_in_wasm_reactions.js.out2
-rw-r--r--core/Cargo.toml2
-rw-r--r--core/bindings.rs16
-rw-r--r--core/runtime.rs13
-rw-r--r--serde_v8/Cargo.toml2
-rw-r--r--tools/wpt/expectation.json4
7 files changed, 31 insertions, 12 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 2b052373f..16173cfd1 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -5189,9 +5189,9 @@ dependencies = [
[[package]]
name = "v8"
-version = "0.47.1"
+version = "0.48.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be156dece7a023d5959a72dc0d398d6c95100ec601a2cea10d868da143e85166"
+checksum = "3734ddf37e06e5020a1d5c969301be0cdf023cde0ef4257248ff19eb3a7223e3"
dependencies = [
"bitflags",
"fslock",
diff --git a/cli/tests/testdata/worker_close_in_wasm_reactions.js.out b/cli/tests/testdata/worker_close_in_wasm_reactions.js.out
index eef017a96..6485c620e 100644
--- a/cli/tests/testdata/worker_close_in_wasm_reactions.js.out
+++ b/cli/tests/testdata/worker_close_in_wasm_reactions.js.out
@@ -1 +1 @@
-Error: CompileError: WebAssembly.compile(): expected string length @+10
+Error: CompileError: WebAssembly.compile(): expected length: @+10
diff --git a/core/Cargo.toml b/core/Cargo.toml
index 7f9b5072f..61c38521d 100644
--- a/core/Cargo.toml
+++ b/core/Cargo.toml
@@ -33,7 +33,7 @@ serde_json = { version = "1.0.79", features = ["preserve_order"] }
serde_v8 = { version = "0.58.0", path = "../serde_v8" }
sourcemap = "=6.0.1"
url = { version = "2.2.2", features = ["serde"] }
-v8 = { version = "0.47.1", default-features = false }
+v8 = { version = "0.48.1", default-features = false }
[[example]]
name = "http_bench_json_ops"
diff --git a/core/bindings.rs b/core/bindings.rs
index aef479472..f3c16acbf 100644
--- a/core/bindings.rs
+++ b/core/bindings.rs
@@ -140,6 +140,22 @@ pub fn set_func_raw(
obj.set(scope, key.into(), val.into());
}
+pub extern "C" fn wasm_async_resolve_promise_callback(
+ _isolate: *mut v8::Isolate,
+ context: v8::Local<v8::Context>,
+ resolver: v8::Local<v8::PromiseResolver>,
+ compilation_result: v8::Local<v8::Value>,
+ success: v8::WasmAsyncSuccess,
+) {
+ // SAFETY: `CallbackScope` can be safely constructed from `Local<Context>`
+ let scope = &mut unsafe { v8::CallbackScope::new(context) };
+ if success == v8::WasmAsyncSuccess::Success {
+ resolver.resolve(scope, compilation_result).unwrap();
+ } else {
+ resolver.reject(scope, compilation_result).unwrap();
+ }
+}
+
pub extern "C" fn host_import_module_dynamically_callback(
context: v8::Local<v8::Context>,
_host_defined_options: v8::Local<v8::Data>,
diff --git a/core/runtime.rs b/core/runtime.rs
index 541aa7c02..7f113223f 100644
--- a/core/runtime.rs
+++ b/core/runtime.rs
@@ -227,11 +227,6 @@ fn v8_init(
static ICU_DATA: IcuData = IcuData(*include_bytes!("icudtl.dat"));
v8::icu::set_common_data_71(&ICU_DATA.0).unwrap();
- let v8_platform = v8_platform
- .unwrap_or_else(|| v8::new_default_platform(0, false).make_shared());
- v8::V8::initialize_platform(v8_platform);
- v8::V8::initialize();
-
let flags = concat!(
" --experimental-wasm-threads",
" --wasm-test-streaming",
@@ -248,6 +243,11 @@ fn v8_init(
} else {
v8::V8::set_flags_from_string(flags);
}
+
+ let v8_platform = v8_platform
+ .unwrap_or_else(|| v8::new_default_platform(0, false).make_shared());
+ v8::V8::initialize_platform(v8_platform);
+ v8::V8::initialize();
}
#[derive(Default)]
@@ -516,6 +516,9 @@ impl JsRuntime {
isolate.set_host_import_module_dynamically_callback(
bindings::host_import_module_dynamically_callback,
);
+ isolate.set_wasm_async_resolve_promise_callback(
+ bindings::wasm_async_resolve_promise_callback,
+ );
isolate
}
diff --git a/serde_v8/Cargo.toml b/serde_v8/Cargo.toml
index a5a144151..38e067857 100644
--- a/serde_v8/Cargo.toml
+++ b/serde_v8/Cargo.toml
@@ -18,7 +18,7 @@ derive_more = "0.99.17"
serde = { version = "1.0.136", features = ["derive"] }
serde_bytes = "0.11"
smallvec = { version = "1.8", features = ["union"] }
-v8 = { version = "0.47.1", default-features = false }
+v8 = { version = "0.48.1", default-features = false }
[dev-dependencies]
bencher = "0.1"
diff --git a/tools/wpt/expectation.json b/tools/wpt/expectation.json
index 0d53dd962..813abbbba 100644
--- a/tools/wpt/expectation.json
+++ b/tools/wpt/expectation.json
@@ -1479,8 +1479,8 @@
],
"is.tentative.any.html": true,
"is.tentative.any.worker.html": true,
- "toString.tentative.any.html": false,
- "toString.tentative.any.worker.html": false,
+ "toString.tentative.any.html": true,
+ "toString.tentative.any.worker.html": true,
"type.tentative.any.html": false,
"type.tentative.any.worker.html": false
},