Skip to content

Commit 40a1a11

Browse files
committed
deps: patch V8 to be API/ABI compatible with 7.4
Reverts v8/v8@1b51dca Reverts v8/v8@1ab717d Partially reverts v8/v8@b0077b3 PR-URL: nodejs#28005 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Ujjwal Sharma <[email protected]>
1 parent 92d1ca9 commit 40a1a11

File tree

4 files changed

+14
-25
lines changed

4 files changed

+14
-25
lines changed

deps/v8/include/v8.h

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5164,7 +5164,8 @@ class V8_EXPORT SharedArrayBuffer : public Object {
51645164
allocation_length_(0),
51655165
allocation_mode_(Allocator::AllocationMode::kNormal),
51665166
deleter_(nullptr),
5167-
deleter_data_(nullptr) {}
5167+
deleter_data_(nullptr),
5168+
is_growable_(false) {}
51685169

51695170
void* AllocationBase() const { return allocation_base_; }
51705171
size_t AllocationLength() const { return allocation_length_; }
@@ -5176,12 +5177,13 @@ class V8_EXPORT SharedArrayBuffer : public Object {
51765177
size_t ByteLength() const { return byte_length_; }
51775178
DeleterCallback Deleter() const { return deleter_; }
51785179
void* DeleterData() const { return deleter_data_; }
5180+
bool IsGrowable() const { return is_growable_; }
51795181

51805182
private:
51815183
Contents(void* data, size_t byte_length, void* allocation_base,
51825184
size_t allocation_length,
51835185
Allocator::AllocationMode allocation_mode, DeleterCallback deleter,
5184-
void* deleter_data);
5186+
void* deleter_data, bool is_growable);
51855187

51865188
void* data_;
51875189
size_t byte_length_;
@@ -5190,6 +5192,7 @@ class V8_EXPORT SharedArrayBuffer : public Object {
51905192
Allocator::AllocationMode allocation_mode_;
51915193
DeleterCallback deleter_;
51925194
void* deleter_data_;
5195+
bool is_growable_;
51935196

51945197
friend class SharedArrayBuffer;
51955198
};
@@ -6767,8 +6770,7 @@ class V8_EXPORT MicrotaskQueue {
67676770
/**
67686771
* Creates an empty MicrotaskQueue instance.
67696772
*/
6770-
static std::unique_ptr<MicrotaskQueue> New(
6771-
Isolate* isolate, MicrotasksPolicy policy = MicrotasksPolicy::kAuto);
6773+
static std::unique_ptr<MicrotaskQueue> New(Isolate* isolate);
67726774

67736775
virtual ~MicrotaskQueue() = default;
67746776

@@ -6816,12 +6818,6 @@ class V8_EXPORT MicrotaskQueue {
68166818
*/
68176819
virtual bool IsRunningMicrotasks() const = 0;
68186820

6819-
/**
6820-
* Returns the current depth of nested MicrotasksScope that has
6821-
* kRunMicrotasks.
6822-
*/
6823-
virtual int GetMicrotasksScopeDepth() const = 0;
6824-
68256821
private:
68266822
friend class internal::MicrotaskQueue;
68276823
MicrotaskQueue() = default;

deps/v8/src/api.cc

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7741,14 +7741,15 @@ v8::SharedArrayBuffer::Contents v8::SharedArrayBuffer::Externalize() {
77417741
v8::SharedArrayBuffer::Contents::Contents(
77427742
void* data, size_t byte_length, void* allocation_base,
77437743
size_t allocation_length, Allocator::AllocationMode allocation_mode,
7744-
DeleterCallback deleter, void* deleter_data)
7744+
DeleterCallback deleter, void* deleter_data, bool is_growable)
77457745
: data_(data),
77467746
byte_length_(byte_length),
77477747
allocation_base_(allocation_base),
77487748
allocation_length_(allocation_length),
77497749
allocation_mode_(allocation_mode),
77507750
deleter_(deleter),
7751-
deleter_data_(deleter_data) {
7751+
deleter_data_(deleter_data),
7752+
is_growable_(is_growable) {
77527753
DCHECK_LE(allocation_base_, data_);
77537754
DCHECK_LE(byte_length_, allocation_length_);
77547755
}
@@ -7766,7 +7767,8 @@ v8::SharedArrayBuffer::Contents v8::SharedArrayBuffer::GetContents() {
77667767
: reinterpret_cast<Contents::DeleterCallback>(ArrayBufferDeleter),
77677768
self->is_wasm_memory()
77687769
? static_cast<void*>(self->GetIsolate()->wasm_engine())
7769-
: static_cast<void*>(self->GetIsolate()->array_buffer_allocator()));
7770+
: static_cast<void*>(self->GetIsolate()->array_buffer_allocator()),
7771+
false);
77707772
return contents;
77717773
}
77727774

@@ -8935,13 +8937,8 @@ void v8::Isolate::LocaleConfigurationChangeNotification() {
89358937
}
89368938

89378939
// static
8938-
std::unique_ptr<MicrotaskQueue> MicrotaskQueue::New(Isolate* isolate,
8939-
MicrotasksPolicy policy) {
8940-
auto microtask_queue =
8941-
i::MicrotaskQueue::New(reinterpret_cast<i::Isolate*>(isolate));
8942-
microtask_queue->set_microtasks_policy(policy);
8943-
std::unique_ptr<MicrotaskQueue> ret(std::move(microtask_queue));
8944-
return ret;
8940+
std::unique_ptr<MicrotaskQueue> MicrotaskQueue::New(Isolate* isolate) {
8941+
return i::MicrotaskQueue::New(reinterpret_cast<i::Isolate*>(isolate));
89458942
}
89468943

89478944
MicrotasksScope::MicrotasksScope(Isolate* isolate, MicrotasksScope::Type type)

deps/v8/src/microtask-queue.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -211,10 +211,6 @@ void MicrotaskQueue::IterateMicrotasks(RootVisitor* visitor) {
211211
}
212212
}
213213

214-
int MicrotaskQueue::GetMicrotasksScopeDepth() const {
215-
return microtasks_depth_;
216-
}
217-
218214
void MicrotaskQueue::AddMicrotasksCompletedCallback(
219215
MicrotasksCompletedCallbackWithData callback, void* data) {
220216
CallbackWithData callback_with_data(callback, data);

deps/v8/src/microtask-queue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class V8_EXPORT_PRIVATE MicrotaskQueue final : public v8::MicrotaskQueue {
6262
// invocation, which happens when depth reaches zero.
6363
void IncrementMicrotasksScopeDepth() { ++microtasks_depth_; }
6464
void DecrementMicrotasksScopeDepth() { --microtasks_depth_; }
65-
int GetMicrotasksScopeDepth() const override;
65+
int GetMicrotasksScopeDepth() const { return microtasks_depth_; }
6666

6767
// Possibly nested microtasks suppression scopes prevent microtasks
6868
// from running.

0 commit comments

Comments
 (0)