From 68c0466b1f125a40b9db847c0812b2b63dcab177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 27 Apr 2023 01:03:54 +0200 Subject: [PATCH] Fix build for v11.4 (#1218) Updated "build/" submodule and adjusted to V8 API changes. --- build | 2 +- src/binding.cc | 12 +++++++----- src/isolate.rs | 2 +- src/script_compiler.rs | 2 ++ 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/build b/build index cf1eb294..46bd0455 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit cf1eb294256dd95a6273cdcf737e8b114a81ad40 +Subproject commit 46bd0455280f874964b4ef5543bcce93e7a8656e diff --git a/src/binding.cc b/src/binding.cc index 6f7f5695..f57b64c7 100644 --- a/src/binding.cc +++ b/src/binding.cc @@ -49,7 +49,7 @@ static_assert(sizeof(v8::PromiseRejectMessage) == sizeof(size_t) * 3, static_assert(sizeof(v8::Locker) == sizeof(size_t) * 2, "Locker size mismatch"); static_assert(sizeof(v8::ScriptCompiler::Source) == - align_to(sizeof(size_t) * 6 + sizeof(int) * 3), + align_to(sizeof(size_t) * 9 + sizeof(int) * 2), "Source size mismatch"); static_assert(sizeof(v8::FunctionCallbackInfo) == sizeof(size_t) * 3, @@ -1988,11 +1988,13 @@ const v8::ObjectTemplate* v8__FunctionTemplate__InstanceTemplate( return local_to_ptr(ptr_to_local(&self)->InstanceTemplate()); } -const extern int v8__FunctionCallbackInfo__kArgsLength = - v8::FunctionCallbackInfo::kArgsLength; +const extern int v8__FunctionCallbackInfo__kArgsLength = 6; +// NOTE(bartlomieju): V8 made this field private in 11.4 +// v8::FunctionCallbackInfo::kArgsLength; -const extern int v8__PropertyCallbackInfo__kArgsLength = - v8::PropertyCallbackInfo::kArgsLength; +const extern int v8__PropertyCallbackInfo__kArgsLength = 7; +// NOTE(bartlomieju): V8 made this field private in 11.4 +// v8::PropertyCallbackInfo::kArgsLength; bool v8__PropertyCallbackInfo__ShouldThrowOnError( const v8::PropertyCallbackInfo& self) { diff --git a/src/isolate.rs b/src/isolate.rs index aae5ffd8..b0657cd3 100644 --- a/src/isolate.rs +++ b/src/isolate.rs @@ -543,7 +543,7 @@ impl Isolate { // Byte offset inside `Isolate` where the isolate data slots are stored. This // should be the same as the value of `kIsolateEmbedderDataOffset` which is // defined in `v8-internal.h`. - const EMBEDDER_DATA_OFFSET: usize = size_of::<[*const (); 23]>(); + const EMBEDDER_DATA_OFFSET: usize = size_of::<[*const (); 61]>(); // Isolate data slots used internally by rusty_v8. const ANNEX_SLOT: u32 = 0; diff --git a/src/script_compiler.rs b/src/script_compiler.rs index 43d9490e..eac0dba0 100644 --- a/src/script_compiler.rs +++ b/src/script_compiler.rs @@ -72,6 +72,8 @@ pub struct Source { _host_defined_options: usize, _cached_data: usize, _consume_cache_task: usize, + _compile_hint_callback: usize, + _compile_hint_callback_data: usize, } /// Compilation data that the embedder can cache and pass back to speed up future