Skip to content

Commit

Permalink
Rolling to V8 12.7.224.1 (#1502)
Browse files Browse the repository at this point in the history
* Rolling to V8 12.7.224.1

* fix v8/v8@eb0bb25

* idk

---------

Co-authored-by: snek <[email protected]>
  • Loading branch information
denobot and devsnek authored Jun 12, 2024
1 parent 37023e6 commit 4f03751
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
5 changes: 5 additions & 0 deletions src/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2232,6 +2232,11 @@ const extern int v8__PropertyCallbackInfo__kArgsLength = 7;
// NOTE(bartlomieju): V8 made this field private in 11.4
// v8::PropertyCallbackInfo<v8::Value>::kArgsLength;

const v8::Value* v8__FunctionCallbackInfo__Data(
const v8::FunctionCallbackInfo<v8::Value>& self) {
return local_to_ptr(self.Data());
}

bool v8__PropertyCallbackInfo__ShouldThrowOnError(
const v8::PropertyCallbackInfo<v8::Value>& self) {
return self.ShouldThrowOnError();
Expand Down
14 changes: 11 additions & 3 deletions src/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -238,7 +242,11 @@ impl FunctionCallbackInfo {

#[inline(always)]
pub(crate) fn data(&self) -> Local<Value> {
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)]
Expand Down
9 changes: 1 addition & 8 deletions src/isolate_create_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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);
}

Expand All @@ -210,7 +203,7 @@ pub(crate) mod raw {
pub array_buffer_allocator_shared: SharedPtr<ArrayBufferAllocator>,
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
Expand Down

0 comments on commit 4f03751

Please sign in to comment.