Skip to content

Commit

Permalink
chore: upgrade rusty_v8 to 0.54.0 (denoland#16368)
Browse files Browse the repository at this point in the history
<!--
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 denoland#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.
-->
  • Loading branch information
bartlomieju authored Oct 20, 2022
1 parent da906de commit 869acee
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 20 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion core/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions ext/ffi/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) };
Expand Down
9 changes: 3 additions & 6 deletions ext/flash/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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();
Expand All @@ -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) };

Expand Down
9 changes: 4 additions & 5 deletions ext/napi/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 _
};

Expand Down
4 changes: 2 additions & 2 deletions ops/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
};

Expand Down
2 changes: 1 addition & 1 deletion serde_v8/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 869acee

Please sign in to comment.