1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-24 08:09:08 -05:00

chore: upgrade rusty_v8 to 0.54.0 (#16368)

<!--
Before submitting a PR, please read http://deno.land/manual/contributing

1. Give the PR a descriptive title.

  Examples of good title:
    - fix(std/http): Fix race condition in server
    - docs(console): Update docstrings
    - feat(doc): Handle nested reexports

  Examples of bad title:
    - fix #7123
    - update docs
    - fix bugs

2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
-->
This commit is contained in:
Bartek Iwańczuk 2022-10-20 21:01:49 +02:00 committed by GitHub
parent da906de184
commit 869acee8fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 15 additions and 20 deletions

4
Cargo.lock generated
View file

@ -5347,9 +5347,9 @@ dependencies = [
[[package]]
name = "v8"
version = "0.53.1"
version = "0.54.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e952e936bcb610c9f22997f50dc7f65887afe76e1fedd37daf532a20211335ca"
checksum = "3b63103bd7caa4c3571e8baafe58f3e04818df70505304ed814737e655d1d8d6"
dependencies = [
"bitflags",
"fslock",

View file

@ -34,7 +34,7 @@ serde_json = { version = "1.0.79", features = ["preserve_order"] }
serde_v8 = { version = "0.66.0", path = "../serde_v8" }
sourcemap = "6.1"
url = { version = "2.3.1", features = ["serde", "expose_internals"] }
v8 = { version = "0.53.1", default-features = false }
v8 = { version = "0.54.0", default-features = false }
[[example]]
name = "http_bench_json_ops"

View file

@ -343,7 +343,7 @@ fn import_meta_resolve(
}
let specifier = maybe_arg_str.unwrap();
let referrer = {
let url_prop = args.data().unwrap();
let url_prop = args.data();
url_prop.to_rust_string_lossy(scope)
};
let module_map_rc = JsRuntime::module_map(scope);

View file

@ -706,8 +706,7 @@ fn make_sync_fn<'s>(
|scope: &mut v8::HandleScope,
args: v8::FunctionCallbackArguments,
mut rv: v8::ReturnValue| {
let external: v8::Local<v8::External> =
args.data().unwrap().try_into().unwrap();
let external: v8::Local<v8::External> = args.data().try_into().unwrap();
// SAFETY: The pointer will not be deallocated until the function is
// garbage collected.
let symbol = unsafe { &*(external.value() as *const Symbol) };

View file

@ -539,8 +539,7 @@ fn op_flash_make_request<'scope>(
|_: &mut v8::HandleScope,
args: v8::FunctionCallbackArguments,
mut rv: v8::ReturnValue| {
let external: v8::Local<v8::External> =
args.data().unwrap().try_into().unwrap();
let external: v8::Local<v8::External> = args.data().try_into().unwrap();
// SAFETY: This external is guaranteed to be a pointer to a ServerContext
let ctx = unsafe { &mut *(external.value() as *mut ServerContext) };
rv.set_uint32(next_request_sync(ctx));
@ -561,8 +560,7 @@ fn op_flash_make_request<'scope>(
|scope: &mut v8::HandleScope,
args: v8::FunctionCallbackArguments,
mut rv: v8::ReturnValue| {
let external: v8::Local<v8::External> =
args.data().unwrap().try_into().unwrap();
let external: v8::Local<v8::External> = args.data().try_into().unwrap();
// SAFETY: This external is guaranteed to be a pointer to a ServerContext
let ctx = unsafe { &mut *(external.value() as *mut ServerContext) };
let token = args.get(0).uint32_value(scope).unwrap();
@ -585,8 +583,7 @@ fn op_flash_make_request<'scope>(
|scope: &mut v8::HandleScope,
args: v8::FunctionCallbackArguments,
mut rv: v8::ReturnValue| {
let external: v8::Local<v8::External> =
args.data().unwrap().try_into().unwrap();
let external: v8::Local<v8::External> = args.data().try_into().unwrap();
// SAFETY: This external is guaranteed to be a pointer to a ServerContext
let ctx = unsafe { &mut *(external.value() as *mut ServerContext) };

View file

@ -27,13 +27,12 @@ impl CallbackInfo {
}
extern "C" fn call_fn(info: *const v8::FunctionCallbackInfo) {
let args =
unsafe { v8::FunctionCallbackArguments::from_function_callback_info(info) };
let mut rv = unsafe { v8::ReturnValue::from_function_callback_info(info) };
let info = unsafe { &*info };
let args = v8::FunctionCallbackArguments::from_function_callback_info(info);
let mut rv = v8::ReturnValue::from_function_callback_info(info);
// SAFETY: create_function guarantees that the data is a CallbackInfo external.
let info_ptr: *mut CallbackInfo = unsafe {
let external_value =
v8::Local::<v8::External>::cast(args.data().unwrap_unchecked());
let external_value = v8::Local::<v8::External>::cast(args.data());
external_value.value() as _
};

View file

@ -229,7 +229,7 @@ fn codegen_v8_async(
use #core::futures::FutureExt;
// SAFETY: #core guarantees args.data() is a v8 External pointing to an OpCtx for the isolates lifetime
let ctx = unsafe {
&*(#core::v8::Local::<#core::v8::External>::cast(args.data().unwrap_unchecked()).value()
&*(#core::v8::Local::<#core::v8::External>::cast(args.data()).value()
as *const #core::_ops::OpCtx)
};
let op_id = ctx.id;
@ -557,7 +557,7 @@ fn codegen_v8_sync(
quote! {
// SAFETY: #core guarantees args.data() is a v8 External pointing to an OpCtx for the isolates lifetime
let ctx = unsafe {
&*(#core::v8::Local::<#core::v8::External>::cast(args.data().unwrap_unchecked()).value()
&*(#core::v8::Local::<#core::v8::External>::cast(args.data()).value()
as *const #core::_ops::OpCtx)
};

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.53.1", default-features = false }
v8 = { version = "0.54.0", default-features = false }
[dev-dependencies]
bencher = "0.1"