Skip to content

Commit daae938

Browse files
authored
build: enable V8's shared read-only heap
It is what V8's build config does by default. PR-URL: nodejs#42809 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
1 parent 5ad47a0 commit daae938

File tree

4 files changed

+13
-4
lines changed

4 files changed

+13
-4
lines changed

configure.py

+1
Original file line numberDiff line numberDiff line change
@@ -1458,6 +1458,7 @@ def configure_v8(o):
14581458
o['variables']['v8_use_siphash'] = 0 if options.without_siphash else 1
14591459
o['variables']['v8_enable_pointer_compression'] = 1 if options.enable_pointer_compression else 0
14601460
o['variables']['v8_enable_31bit_smis_on_64bit_arch'] = 1 if options.enable_pointer_compression else 0
1461+
o['variables']['v8_enable_shared_ro_heap'] = 0 if options.enable_pointer_compression else 1
14611462
o['variables']['v8_trace_maps'] = 1 if options.trace_maps else 0
14621463
o['variables']['node_use_v8_platform'] = b(not options.without_v8_platform)
14631464
o['variables']['node_use_bundled_v8'] = b(not options.without_bundled_v8)

test/parallel/test-worker-nearheaplimit-deadlock.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Flags: --no-node-snapshot
2+
// With node snapshot the OOM can occur during the deserialization of the
3+
// context, so disable it since we want the OOM to occur during the creation of
4+
// the message port.
15
'use strict';
26
const common = require('../common');
37
const assert = require('assert');
@@ -11,10 +15,6 @@ if (!process.env.HAS_STARTED_WORKER) {
1115
maxYoungGenerationSizeMb: 0,
1216
maxOldGenerationSizeMb: 0
1317
},
14-
// With node snapshot the OOM can occur during the deserialization of
15-
// the context, so disable it since we want the OOM to occur during
16-
// the creation of the message port.
17-
execArgv: [ ...process.execArgv, '--no-node-snapshot']
1818
};
1919

2020
const worker = new Worker(__filename, opts);

tools/v8_gypfiles/features.gypi

+7
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@
179179
# Controls the threshold for on-heap/off-heap Typed Arrays.
180180
'v8_typed_array_max_size_in_heap%': 64,
181181

182+
# Enable sharing read-only space across isolates.
183+
# Sets -DV8_SHARED_RO_HEAP.
184+
'v8_enable_shared_ro_heap%': 0,
185+
182186
# Enable lazy source positions by default.
183187
'v8_enable_lazy_source_positions%': 1,
184188

@@ -396,6 +400,9 @@
396400
['v8_use_siphash==1', {
397401
'defines': ['V8_USE_SIPHASH',],
398402
}],
403+
['v8_enable_shared_ro_heap==1', {
404+
'defines': ['V8_SHARED_RO_HEAP',],
405+
}],
399406
['dcheck_always_on!=0', {
400407
'defines': ['DEBUG',],
401408
}],

tools/v8_gypfiles/v8.gyp

+1
Original file line numberDiff line numberDiff line change
@@ -1757,6 +1757,7 @@
17571757
'v8_enable_verify_csa=<(v8_enable_verify_csa)',
17581758
'v8_enable_lite_mode=<(v8_enable_lite_mode)',
17591759
'v8_enable_pointer_compression=<(v8_enable_pointer_compression)',
1760+
'v8_enable_shared_ro_heap=<(v8_enable_shared_ro_heap)',
17601761
'v8_enable_webassembly=<(v8_enable_webassembly)',
17611762
# Not available in gyp.
17621763
'v8_control_flow_integrity=0',

0 commit comments

Comments
 (0)