From 0f141231868a686ef5c105a85e22e35c3cae827f Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Thu, 16 Apr 2020 18:51:44 +0200 Subject: [PATCH] deps: V8: stub backport fast API call changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This brings ABI compatibility for several changes related to the fast API calls implementation in V8. PR-URL: https://github.com/nodejs/node/pull/32885 Reviewed-By: Michaël Zasso Reviewed-By: Ujjwal Sharma Reviewed-By: Gerhard Stöbich Reviewed-By: Beth Griggs --- common.gypi | 2 +- deps/v8/include/v8.h | 16 +++++++++++++--- deps/v8/src/api/api.cc | 5 +++-- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/common.gypi b/common.gypi index c3a79ae936847c..040d0d1593eb15 100644 --- a/common.gypi +++ b/common.gypi @@ -35,7 +35,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.29', + 'v8_embedder_string': '-node.30', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index ef7bb43efb1171..d09055e15d2fbd 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -6279,6 +6279,7 @@ typedef bool (*AccessCheckCallback)(Local accessing_context, Local accessed_object, Local data); +class CFunction; /** * A FunctionTemplate is used to create functions at runtime. There * can only be one function created from a FunctionTemplate in a @@ -6387,7 +6388,8 @@ class V8_EXPORT FunctionTemplate : public Template { Local data = Local(), Local signature = Local(), int length = 0, ConstructorBehavior behavior = ConstructorBehavior::kAllow, - SideEffectType side_effect_type = SideEffectType::kHasSideEffect); + SideEffectType side_effect_type = SideEffectType::kHasSideEffect, + const CFunction* not_available_in_node_v14_yet = nullptr); /** * Creates a function template backed/cached by a private property. @@ -6418,7 +6420,8 @@ class V8_EXPORT FunctionTemplate : public Template { */ void SetCallHandler( FunctionCallback callback, Local data = Local(), - SideEffectType side_effect_type = SideEffectType::kHasSideEffect); + SideEffectType side_effect_type = SideEffectType::kHasSideEffect, + const CFunction* not_available_in_node_v14_yet = nullptr); /** Set the predefined length property for the FunctionTemplate. */ void SetLength(int length); @@ -8110,7 +8113,10 @@ class V8_EXPORT Isolate { array_buffer_allocator_shared(), external_references(nullptr), allow_atomics_wait(true), - only_terminate_in_safe_scope(false) {} + only_terminate_in_safe_scope(false), + embedder_wrapper_type_index(-1), + embedder_wrapper_object_index(-1) {} + /** * Allows the host application to provide the address of a function that is @@ -8174,6 +8180,10 @@ class V8_EXPORT Isolate { * Termination is postponed when there is no active SafeForTerminationScope. */ bool only_terminate_in_safe_scope; + + // Not available in Node v14 yet. + int embedder_wrapper_type_index; + int embedder_wrapper_object_index; }; diff --git a/deps/v8/src/api/api.cc b/deps/v8/src/api/api.cc index 65853fdd94a702..9693e4c843ed18 100644 --- a/deps/v8/src/api/api.cc +++ b/deps/v8/src/api/api.cc @@ -1499,7 +1499,7 @@ static Local FunctionTemplateNew( Local FunctionTemplate::New( Isolate* isolate, FunctionCallback callback, v8::Local data, v8::Local signature, int length, ConstructorBehavior behavior, - SideEffectType side_effect_type) { + SideEffectType side_effect_type, const CFunction*) { i::Isolate* i_isolate = reinterpret_cast(isolate); // Changes to the environment cannot be captured in the snapshot. Expect no // function templates when the isolate is created for serialization. @@ -1540,7 +1540,8 @@ Local AccessorSignature::New( void FunctionTemplate::SetCallHandler(FunctionCallback callback, v8::Local data, - SideEffectType side_effect_type) { + SideEffectType side_effect_type, + const CFunction*) { auto info = Utils::OpenHandle(this); EnsureNotInstantiated(info, "v8::FunctionTemplate::SetCallHandler"); i::Isolate* isolate = info->GetIsolate();