Skip to content

Commit

Permalink
deps: V8: stub backport fast API call changes
Browse files Browse the repository at this point in the history
This brings ABI compatibility for several changes related to
the fast API calls implementation in V8.

PR-URL: #32885
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
  • Loading branch information
addaleax authored and BethGriggs committed Apr 20, 2020
1 parent bf412ed commit 0f14123
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -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 #####

Expand Down
16 changes: 13 additions & 3 deletions deps/v8/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -6279,6 +6279,7 @@ typedef bool (*AccessCheckCallback)(Local<Context> accessing_context,
Local<Object> accessed_object,
Local<Value> data);

class CFunction;
/**
* A FunctionTemplate is used to create functions at runtime. There
* can only be one function created from a FunctionTemplate in a
Expand Down Expand Up @@ -6387,7 +6388,8 @@ class V8_EXPORT FunctionTemplate : public Template {
Local<Value> data = Local<Value>(),
Local<Signature> signature = Local<Signature>(), 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.
Expand Down Expand Up @@ -6418,7 +6420,8 @@ class V8_EXPORT FunctionTemplate : public Template {
*/
void SetCallHandler(
FunctionCallback callback, Local<Value> data = Local<Value>(),
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);
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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;
};


Expand Down
5 changes: 3 additions & 2 deletions deps/v8/src/api/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,7 @@ static Local<FunctionTemplate> FunctionTemplateNew(
Local<FunctionTemplate> FunctionTemplate::New(
Isolate* isolate, FunctionCallback callback, v8::Local<Value> data,
v8::Local<Signature> signature, int length, ConstructorBehavior behavior,
SideEffectType side_effect_type) {
SideEffectType side_effect_type, const CFunction*) {
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
// Changes to the environment cannot be captured in the snapshot. Expect no
// function templates when the isolate is created for serialization.
Expand Down Expand Up @@ -1540,7 +1540,8 @@ Local<AccessorSignature> AccessorSignature::New(

void FunctionTemplate::SetCallHandler(FunctionCallback callback,
v8::Local<Value> 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();
Expand Down

0 comments on commit 0f14123

Please sign in to comment.