chore: upgrade rusty_v8 to 0.48.1 (#15310)

This commit is contained in:
Bartek Iwańczuk 2022-08-15 14:12:11 +02:00 committed by GitHub
parent 18dcc64910
commit 5a4f84a0e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 31 additions and 12 deletions

4
Cargo.lock generated
View File

@ -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",

View File

@ -1 +1 @@
Error: CompileError: WebAssembly.compile(): expected string length @+10
Error: CompileError: WebAssembly.compile(): expected length: @+10

View File

@ -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"

View File

@ -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>,

View File

@ -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
}

View File

@ -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"

View File

@ -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
},