diff --git a/README.md b/README.md index 2ed37ebc92..ce6762c7f5 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Rusty V8 Binding -V8 Version: 12.6.228.16 +V8 Version: 12.7.224.1 [![ci](https://github.com/denoland/rusty_v8/workflows/ci/badge.svg?branch=main)](https://github.com/denoland/rusty_v8/actions) [![crates](https://img.shields.io/crates/v/v8.svg)](https://crates.io/crates/v8) diff --git a/src/binding.cc b/src/binding.cc index 6a702a9d59..4abc4cbe3c 100644 --- a/src/binding.cc +++ b/src/binding.cc @@ -2232,6 +2232,11 @@ const extern int v8__PropertyCallbackInfo__kArgsLength = 7; // NOTE(bartlomieju): V8 made this field private in 11.4 // v8::PropertyCallbackInfo::kArgsLength; +const v8::Value* v8__FunctionCallbackInfo__Data( + const v8::FunctionCallbackInfo& self) { + return local_to_ptr(self.Data()); +} + bool v8__PropertyCallbackInfo__ShouldThrowOnError( const v8::PropertyCallbackInfo& self) { return self.ShouldThrowOnError(); diff --git a/src/function.rs b/src/function.rs index 39fa3e027b..beb5c5c2ea 100644 --- a/src/function.rs +++ b/src/function.rs @@ -64,6 +64,10 @@ extern "C" { static v8__PropertyCallbackInfo__kArgsLength: int; + fn v8__FunctionCallbackInfo__Data( + this: *const FunctionCallbackInfo, + ) -> *const Value; + fn v8__PropertyCallbackInfo__ShouldThrowOnError( this: *const PropertyCallbackInfo, ) -> bool; @@ -201,9 +205,9 @@ pub struct FunctionCallbackInfo { impl FunctionCallbackInfo { const kHolderIndex: i32 = 0; const kIsolateIndex: i32 = 1; - const kReturnValueDefaultValueIndex: i32 = 2; + const kUnusedIndex: i32 = 2; const kReturnValueIndex: i32 = 3; - const kDataIndex: i32 = 4; + const kTargetIndex: i32 = 4; const kNewTargetIndex: i32 = 5; const kArgsLength: i32 = 6; } @@ -238,7 +242,11 @@ impl FunctionCallbackInfo { #[inline(always)] pub(crate) fn data(&self) -> Local { - unsafe { self.get_implicit_arg_local(Self::kDataIndex) } + unsafe { + let ptr = v8__FunctionCallbackInfo__Data(self); + let nn = NonNull::new_unchecked(ptr as *mut Value); + Local::from_non_null(nn) + } } #[inline(always)] diff --git a/src/isolate_create_params.rs b/src/isolate_create_params.rs index a21fd29de4..0eef400a00 100644 --- a/src/isolate_create_params.rs +++ b/src/isolate_create_params.rs @@ -117,12 +117,6 @@ impl CreateParams { self } - /// Termination is postponed when there is no active SafeForTerminationScope. - pub fn only_terminate_in_safe_scope(mut self, value: bool) -> Self { - self.raw.only_terminate_in_safe_scope = value; - self - } - /// The following parameters describe the offsets for addressing type info /// for wrapped API objects and are used by the fast C API /// (for details see v8-fast-api-calls.h). @@ -190,7 +184,6 @@ fn create_param_defaults() { let params = CreateParams::default(); assert_eq!(params.raw.embedder_wrapper_type_index, -1); assert_eq!(params.raw.embedder_wrapper_object_index, -1); - assert!(!params.raw.only_terminate_in_safe_scope); assert!(params.raw.allow_atomics_wait); } @@ -210,7 +203,7 @@ pub(crate) mod raw { pub array_buffer_allocator_shared: SharedPtr, pub external_references: *const intptr_t, pub allow_atomics_wait: bool, - pub only_terminate_in_safe_scope: bool, + _only_terminate_in_safe_scope: bool, pub embedder_wrapper_type_index: int, pub embedder_wrapper_object_index: int, _fatal_error_handler: *const Opaque, // FatalErrorCallback