From 97291d72900cac67e010aa13fb0247184f90b3eb Mon Sep 17 00:00:00 2001 From: snek Date: Thu, 25 Jul 2024 13:34:26 -0700 Subject: [PATCH] Roll V8 to include new patches (#1549) --- src/binding.cc | 5 +++++ src/isolate.rs | 15 +++++++++++++++ v8 | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/binding.cc b/src/binding.cc index cf84d673..b698a559 100644 --- a/src/binding.cc +++ b/src/binding.cc @@ -164,6 +164,11 @@ void v8__Isolate__Exit(v8::Isolate* isolate) { isolate->Exit(); } v8::Isolate* v8__Isolate__GetCurrent() { return v8::Isolate::GetCurrent(); } +const v8::Data* v8__Isolate__GetCurrentHostDefinedOptions( + v8::Isolate* isolate) { + return maybe_local_to_ptr(isolate->GetCurrentHostDefinedOptions()); +} + void v8__Isolate__MemoryPressureNotification(v8::Isolate* isolate, v8::MemoryPressureLevel level) { isolate->MemoryPressureNotification(level); diff --git a/src/isolate.rs b/src/isolate.rs index 6762fee2..c91ca80b 100644 --- a/src/isolate.rs +++ b/src/isolate.rs @@ -412,6 +412,9 @@ extern "C" { fn v8__Isolate__Enter(this: *mut Isolate); fn v8__Isolate__Exit(this: *mut Isolate); fn v8__Isolate__GetCurrent() -> *mut Isolate; + fn v8__Isolate__GetCurrentHostDefinedOptions( + this: *mut Isolate, + ) -> *const Data; fn v8__Isolate__MemoryPressureNotification(this: *mut Isolate, level: u8); fn v8__Isolate__ClearKeptObjects(isolate: *mut Isolate); fn v8__Isolate__LowMemoryNotification(isolate: *mut Isolate); @@ -1425,6 +1428,18 @@ impl Isolate { .unwrap(); snapshot_creator.add_context_data(context, data) } + + /// Returns the host defined options set for currently running script or + /// module, if available. + #[inline(always)] + pub fn get_current_host_defined_options<'s>( + &mut self, + scope: &mut HandleScope<'s, ()>, + ) -> Option> { + unsafe { + scope.cast_local(|_| v8__Isolate__GetCurrentHostDefinedOptions(self)) + } + } } pub(crate) struct IsolateAnnex { diff --git a/v8 b/v8 index e5daef10..4be08c11 160000 --- a/v8 +++ b/v8 @@ -1 +1 @@ -Subproject commit e5daef104abeaaa4b3c8c206405ed437f30081ae +Subproject commit 4be08c1170fb989a22870a5602b2707304a62338