Skip to content

Commit

Permalink
build: enable V8's shared read-only heap
Browse files Browse the repository at this point in the history
It is what V8's build config does by default.

PR-URL: #42809
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
  • Loading branch information
targos committed Apr 28, 2022
1 parent d33cbab commit 4050b0d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1458,6 +1458,7 @@ def configure_v8(o):
o['variables']['v8_use_siphash'] = 0 if options.without_siphash else 1
o['variables']['v8_enable_pointer_compression'] = 1 if options.enable_pointer_compression else 0
o['variables']['v8_enable_31bit_smis_on_64bit_arch'] = 1 if options.enable_pointer_compression else 0
o['variables']['v8_enable_shared_ro_heap'] = 0 if options.enable_pointer_compression else 1
o['variables']['v8_trace_maps'] = 1 if options.trace_maps else 0
o['variables']['node_use_v8_platform'] = b(not options.without_v8_platform)
o['variables']['node_use_bundled_v8'] = b(not options.without_bundled_v8)
Expand Down
8 changes: 4 additions & 4 deletions test/parallel/test-worker-nearheaplimit-deadlock.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// Flags: --no-node-snapshot
// With node snapshot the OOM can occur during the deserialization of the
// context, so disable it since we want the OOM to occur during the creation of
// the message port.
'use strict';
const common = require('../common');
const assert = require('assert');
Expand All @@ -11,10 +15,6 @@ if (!process.env.HAS_STARTED_WORKER) {
maxYoungGenerationSizeMb: 0,
maxOldGenerationSizeMb: 0
},
// With node snapshot the OOM can occur during the deserialization of
// the context, so disable it since we want the OOM to occur during
// the creation of the message port.
execArgv: [ ...process.execArgv, '--no-node-snapshot']
};

const worker = new Worker(__filename, opts);
Expand Down
7 changes: 7 additions & 0 deletions tools/v8_gypfiles/features.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@
# Controls the threshold for on-heap/off-heap Typed Arrays.
'v8_typed_array_max_size_in_heap%': 64,

# Enable sharing read-only space across isolates.
# Sets -DV8_SHARED_RO_HEAP.
'v8_enable_shared_ro_heap%': 0,

# Enable lazy source positions by default.
'v8_enable_lazy_source_positions%': 1,

Expand Down Expand Up @@ -396,6 +400,9 @@
['v8_use_siphash==1', {
'defines': ['V8_USE_SIPHASH',],
}],
['v8_enable_shared_ro_heap==1', {
'defines': ['V8_SHARED_RO_HEAP',],
}],
['dcheck_always_on!=0', {
'defines': ['DEBUG',],
}],
Expand Down
1 change: 1 addition & 0 deletions tools/v8_gypfiles/v8.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -1757,6 +1757,7 @@
'v8_enable_verify_csa=<(v8_enable_verify_csa)',
'v8_enable_lite_mode=<(v8_enable_lite_mode)',
'v8_enable_pointer_compression=<(v8_enable_pointer_compression)',
'v8_enable_shared_ro_heap=<(v8_enable_shared_ro_heap)',
'v8_enable_webassembly=<(v8_enable_webassembly)',
# Not available in gyp.
'v8_control_flow_integrity=0',
Expand Down

0 comments on commit 4050b0d

Please sign in to comment.