build,src,tools: adapt build config for V8 13.3 · nodejs/node@756abac · GitHub
Skip to content

Commit 756abac

Browse files
targosRafaelGSS
authored andcommitted
build,src,tools: adapt build config for V8 13.3
Refs: v8/v8@1c9f59c Refs: v8/v8@b1c5eba Refs: v8/v8@b3054f7 Refs: v8/v8@f81e87e Refs: v8/v8@dc0e305 Refs: v8/v8@41d42ce PR-URL: #58070 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
1 parent f8953e5 commit 756abac

10 files changed

Lines changed: 33 additions & 38 deletions

File tree

configure.py

Lines changed: 0 additions & 7 deletions

node.gypi

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@
100100
'NODE_USE_V8_PLATFORM=0',
101101
],
102102
}],
103-
[ 'v8_enable_shared_ro_heap==1', {
104-
'defines': ['NODE_V8_SHARED_RO_HEAP',],
105-
}],
106103
[ 'node_tag!=""', {
107104
'defines': [ 'NODE_TAG="<(node_tag)"' ],
108105
}],

src/api/embed_helpers.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,11 +352,7 @@ EmbedderSnapshotData::EmbedderSnapshotData(const SnapshotData* impl,
352352
: impl_(impl), owns_impl_(owns_impl) {}
353353

354354
bool EmbedderSnapshotData::CanUseCustomSnapshotPerIsolate() {
355-
#ifdef NODE_V8_SHARED_RO_HEAP
356355
return false;
357-
#else
358-
return true;
359-
#endif
360356
}
361357

362358
} // namespace node

src/api/environment.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,17 +312,15 @@ Isolate* NewIsolate(Isolate::CreateParams* params,
312312
SnapshotBuilder::InitializeIsolateParams(snapshot_data, params);
313313
}
314314

315-
#ifdef NODE_V8_SHARED_RO_HEAP
316315
{
317-
// In shared-readonly-heap mode, V8 requires all snapshots used for
318-
// creating Isolates to be identical. This isn't really memory-safe
316+
// Because it uses a shared readonly-heap, V8 requires all snapshots used
317+
// for creating Isolates to be identical. This isn't really memory-safe
319318
// but also otherwise just doesn't work, and the only real alternative
320319
// is disabling shared-readonly-heap mode altogether.
321320
static Isolate::CreateParams first_params = *params;
322321
params->snapshot_blob = first_params.snapshot_blob;
323322
params->external_references = first_params.external_references;
324323
}
325-
#endif
326324

327325
// Register the isolate on the platform before the isolate gets initialized,
328326
// so that the isolate can access the platform during initialization.

src/env.cc

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -828,15 +828,9 @@ Environment::Environment(IsolateData* isolate_data,
828828
thread_id_(thread_id.id == static_cast<uint64_t>(-1)
829829
? AllocateEnvironmentThreadId().id
830830
: thread_id.id) {
831-
constexpr bool is_shared_ro_heap =
832-
#ifdef NODE_V8_SHARED_RO_HEAP
833-
true;
834-
#else
835-
false;
836-
#endif
837-
if (is_shared_ro_heap && !is_main_thread()) {
838-
// If this is a Worker thread and we are in shared-readonly-heap mode,
839-
// we can always safely use the parent's Isolate's code cache.
831+
if (!is_main_thread()) {
832+
// If this is a Worker thread, we can always safely use the parent's
833+
// Isolate's code cache because of the shared read-only heap.
840834
CHECK_NOT_NULL(isolate_data->worker_context());
841835
builtin_loader()->CopySourceAndCodeCacheReferenceFrom(
842836
isolate_data->worker_context()->env()->builtin_loader());

src/node.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,8 @@ class EmbedderSnapshotData {
543543
void ToFile(FILE* out) const;
544544
std::vector<char> ToBlob() const;
545545

546-
// Returns whether custom snapshots can be used. Currently, this means
547-
// that V8 was configured without the shared-readonly-heap feature.
546+
// Returns whether custom snapshots can be used. Currently, this always
547+
// returns false since V8 enforces shared readonly-heap.
548548
static bool CanUseCustomSnapshotPerIsolate();
549549

550550
EmbedderSnapshotData(const EmbedderSnapshotData&) = delete;

tools/v8_gypfiles/abseil.gyp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
'include_dirs': [
1212
'<(ABSEIL_ROOT)',
1313
],
14+
'xcode_settings': {
15+
'OTHER_LDFLAGS': ['-framework CoreFoundation'],
16+
},
1417
},
1518
'include_dirs': [
1619
'<(ABSEIL_ROOT)',

tools/v8_gypfiles/features.gypi

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@
134134
# Enable fast mksnapshot runs.
135135
'v8_enable_fast_mksnapshot%': 0,
136136

137+
# Enable using multiple threads to build builtins in mksnapshot.
138+
'v8_enable_concurrent_mksnapshot%': 1,
139+
137140
# Enable the registration of unwinding info for Windows/x64 and ARM64.
138141
'v8_win64_unwinding_info%': 1,
139142

@@ -209,10 +212,6 @@
209212
# Controls the threshold for on-heap/off-heap Typed Arrays.
210213
'v8_typed_array_max_size_in_heap%': 64,
211214

212-
# Enable sharing read-only space across isolates.
213-
# Sets -DV8_SHARED_RO_HEAP.
214-
'v8_enable_shared_ro_heap%': 0,
215-
216215
# Enable lazy source positions by default.
217216
'v8_enable_lazy_source_positions%': 1,
218217

@@ -437,9 +436,6 @@
437436
['v8_use_siphash==1', {
438437
'defines': ['V8_USE_SIPHASH',],
439438
}],
440-
['v8_enable_shared_ro_heap==1', {
441-
'defines': ['V8_SHARED_RO_HEAP',],
442-
}],
443439
['dcheck_always_on!=0', {
444440
'defines': ['DEBUG',],
445441
}, {

tools/v8_gypfiles/inspector.gypi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@
119119
'<(inspector_protocol_path)/crdtp/find_by_first.h',
120120
'<(inspector_protocol_path)/crdtp/json.cc',
121121
'<(inspector_protocol_path)/crdtp/json.h',
122-
'<(inspector_protocol_path)/crdtp/maybe.h',
123122
'<(inspector_protocol_path)/crdtp/parser_handler.h',
124123
'<(inspector_protocol_path)/crdtp/protocol_core.cc',
125124
'<(inspector_protocol_path)/crdtp/protocol_core.h',

tools/v8_gypfiles/v8.gyp

Lines changed: 20 additions & 1 deletion

0 commit comments

Comments
 (0)