Skip to content

Commit

Permalink
deps: patch V8 to be API/ABI compatible with 7.4 (from 7.5)
Browse files Browse the repository at this point in the history
Reverts v8/v8@1b51dca
Reverts v8/v8@1ab717d
Partially reverts v8/v8@b0077b3

Backport-PR-URL: #30109
Backport-PR-URL: #29241
Backport-PR-URL: #28955
PR-URL: #28005
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Ujjwal Sharma <[email protected]>
  • Loading branch information
targos authored and MylesBorins committed Jan 8, 2020
1 parent 8a16f80 commit da3459b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 29 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,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.17',
'v8_embedder_string': '-node.18',

##### V8 defaults for Node.js #####

Expand Down
19 changes: 6 additions & 13 deletions deps/v8/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -5218,7 +5218,8 @@ class V8_EXPORT SharedArrayBuffer : public Object {
allocation_length_(0),
allocation_mode_(Allocator::AllocationMode::kNormal),
deleter_(nullptr),
deleter_data_(nullptr) {}
deleter_data_(nullptr),
is_growable_(false) {}

void* AllocationBase() const { return allocation_base_; }
size_t AllocationLength() const { return allocation_length_; }
Expand All @@ -5230,12 +5231,13 @@ class V8_EXPORT SharedArrayBuffer : public Object {
size_t ByteLength() const { return byte_length_; }
DeleterCallback Deleter() const { return deleter_; }
void* DeleterData() const { return deleter_data_; }
bool IsGrowable() const { return is_growable_; }

private:
Contents(void* data, size_t byte_length, void* allocation_base,
size_t allocation_length,
Allocator::AllocationMode allocation_mode, DeleterCallback deleter,
void* deleter_data);
void* deleter_data, bool is_growable);

void* data_;
size_t byte_length_;
Expand All @@ -5244,6 +5246,7 @@ class V8_EXPORT SharedArrayBuffer : public Object {
Allocator::AllocationMode allocation_mode_;
DeleterCallback deleter_;
void* deleter_data_;
bool is_growable_;

friend class SharedArrayBuffer;
};
Expand Down Expand Up @@ -6900,8 +6903,7 @@ class V8_EXPORT MicrotaskQueue {
/**
* Creates an empty MicrotaskQueue instance.
*/
static std::unique_ptr<MicrotaskQueue> New(
Isolate* isolate, MicrotasksPolicy policy = MicrotasksPolicy::kAuto);
static std::unique_ptr<MicrotaskQueue> New(Isolate* isolate);

virtual ~MicrotaskQueue() = default;

Expand Down Expand Up @@ -6949,15 +6951,6 @@ class V8_EXPORT MicrotaskQueue {
*/
virtual bool IsRunningMicrotasks() const = 0;

/**
* Returns the current depth of nested MicrotasksScope that has
* kRunMicrotasks.
*/
virtual int GetMicrotasksScopeDepth() const = 0;

MicrotaskQueue(const MicrotaskQueue&) = delete;
MicrotaskQueue& operator=(const MicrotaskQueue&) = delete;

private:
friend class internal::MicrotaskQueue;
MicrotaskQueue() = default;
Expand Down
17 changes: 7 additions & 10 deletions deps/v8/src/api/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7471,14 +7471,15 @@ v8::SharedArrayBuffer::Contents v8::SharedArrayBuffer::Externalize() {
v8::SharedArrayBuffer::Contents::Contents(
void* data, size_t byte_length, void* allocation_base,
size_t allocation_length, Allocator::AllocationMode allocation_mode,
DeleterCallback deleter, void* deleter_data)
DeleterCallback deleter, void* deleter_data, bool is_growable)
: data_(data),
byte_length_(byte_length),
allocation_base_(allocation_base),
allocation_length_(allocation_length),
allocation_mode_(allocation_mode),
deleter_(deleter),
deleter_data_(deleter_data) {
deleter_data_(deleter_data),
is_growable_(is_growable) {
DCHECK_LE(allocation_base_, data_);
DCHECK_LE(byte_length_, allocation_length_);
}
Expand All @@ -7496,7 +7497,8 @@ v8::SharedArrayBuffer::Contents v8::SharedArrayBuffer::GetContents() {
: reinterpret_cast<Contents::DeleterCallback>(ArrayBufferDeleter),
self->is_wasm_memory()
? static_cast<void*>(self->GetIsolate()->wasm_engine())
: static_cast<void*>(self->GetIsolate()->array_buffer_allocator()));
: static_cast<void*>(self->GetIsolate()->array_buffer_allocator()),
false);
return contents;
}

Expand Down Expand Up @@ -8673,13 +8675,8 @@ void v8::Isolate::LocaleConfigurationChangeNotification() {
}

// static
std::unique_ptr<MicrotaskQueue> MicrotaskQueue::New(Isolate* isolate,
MicrotasksPolicy policy) {
auto microtask_queue =
i::MicrotaskQueue::New(reinterpret_cast<i::Isolate*>(isolate));
microtask_queue->set_microtasks_policy(policy);
std::unique_ptr<MicrotaskQueue> ret(std::move(microtask_queue));
return ret;
std::unique_ptr<MicrotaskQueue> MicrotaskQueue::New(Isolate* isolate) {
return i::MicrotaskQueue::New(reinterpret_cast<i::Isolate*>(isolate));
}

MicrotasksScope::MicrotasksScope(Isolate* isolate, MicrotasksScope::Type type)
Expand Down
4 changes: 0 additions & 4 deletions deps/v8/src/execution/microtask-queue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,6 @@ void MicrotaskQueue::IterateMicrotasks(RootVisitor* visitor) {
}
}

int MicrotaskQueue::GetMicrotasksScopeDepth() const {
return microtasks_depth_;
}

void MicrotaskQueue::AddMicrotasksCompletedCallback(
MicrotasksCompletedCallbackWithData callback, void* data) {
CallbackWithData callback_with_data(callback, data);
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/execution/microtask-queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class V8_EXPORT_PRIVATE MicrotaskQueue final : public v8::MicrotaskQueue {
// invocation, which happens when depth reaches zero.
void IncrementMicrotasksScopeDepth() { ++microtasks_depth_; }
void DecrementMicrotasksScopeDepth() { --microtasks_depth_; }
int GetMicrotasksScopeDepth() const override;
int GetMicrotasksScopeDepth() const { return microtasks_depth_; }

// Possibly nested microtasks suppression scopes prevent microtasks
// from running.
Expand Down

0 comments on commit da3459b

Please sign in to comment.