From 086c7b41b2c6581baa3de5f9c5d57ce1dfda4734 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Wed, 13 Nov 2019 12:18:10 +0100 Subject: [PATCH] build: add flag to enable pointer compression MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The --experimental-enable-pointer-compression is experimental as it breaks ABI compatibility. PR-URL: https://github.com/nodejs/node/pull/30463 Reviewed-By: Anna Henningsen Reviewed-By: Ruben Bridgewater Reviewed-By: Rod Vagg Reviewed-By: Colin Ihrig Reviewed-By: David Carlier Reviewed-By: Michaël Zasso Reviewed-By: Denys Otrishko Reviewed-By: James M Snell Reviewed-By: Tobias Nießen Reviewed-By: Rich Trott --- common.gypi | 3 --- configure.py | 7 +++++++ node.gyp | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/common.gypi b/common.gypi index 54a8d930c4c..c51912ddbae 100644 --- a/common.gypi +++ b/common.gypi @@ -73,9 +73,6 @@ # TODO(refack): make v8-perfetto happen 'v8_use_perfetto': 0, - 'v8_enable_pointer_compression': 0, - 'v8_enable_31bit_smis_on_64bit_arch': 0, - ##### end V8 defaults ##### 'conditions': [ diff --git a/configure.py b/configure.py index 48624aba92b..a5e5610ba7a 100755 --- a/configure.py +++ b/configure.py @@ -346,6 +346,11 @@ parser.add_option('--enable-trace-maps', dest='trace_maps', help='Enable the --trace-maps flag in V8 (use at your own risk)') +parser.add_option('--experimental-enable-pointer-compression', + action='store_true', + dest='enable_pointer_compression', + help='[Experimental] Enable V8 pointer compression (limits max heap to 4GB and breaks ABI compatibility)') + parser.add_option('--v8-options', action='store', dest='v8_options', @@ -1192,6 +1197,8 @@ def configure_v8(o): o['variables']['v8_random_seed'] = 0 # Use a random seed for hash tables. o['variables']['v8_promise_internal_field_count'] = 1 # Add internal field to promises for async hooks. 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_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) diff --git a/node.gyp b/node.gyp index 7b971b57397..1eb26729679 100644 --- a/node.gyp +++ b/node.gyp @@ -2,6 +2,8 @@ 'variables': { 'v8_use_siphash%': 0, 'v8_trace_maps%': 0, + 'v8_enable_pointer_compression%': 0, + 'v8_enable_31bit_smis_on_64bit_arch%': 0, 'node_use_dtrace%': 'false', 'node_use_etw%': 'false', 'node_no_browser_globals%': 'false',