From aa528738871ba9ae83fc5dc73754c5aa975777cb Mon Sep 17 00:00:00 2001 From: daomingq Date: Tue, 12 Apr 2022 21:46:04 +0800 Subject: [PATCH] build: add configure option --v8-enable-short-builtin-calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add configure option --v8-enable-short-builtin-calls and enable it by default on x86_64 platform. PR-URL: https://github.com/nodejs/node/pull/42109 Reviewed-By: Michaƫl Zasso Reviewed-By: Jiawen Geng Reviewed-By: James M Snell Reviewed-By: Richard Lau --- configure.py | 9 +++++++++ tools/v8_gypfiles/features.gypi | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/configure.py b/configure.py index 6519cf3b9624d2..24cc7d91cd57d3 100755 --- a/configure.py +++ b/configure.py @@ -782,6 +782,13 @@ help='Enable V8 transparent hugepage support. This feature is only '+ 'available on Linux platform.') +parser.add_argument('--v8-enable-short-builtin-calls', + action='store_true', + dest='v8_enable_short_builtin_calls', + default=None, + help='Enable V8 short builtin calls support. This feature is enabled '+ + 'on x86_64 platform by default.') + parser.add_argument('--node-builtin-modules-path', action='store', dest='node_builtin_modules_path', @@ -1464,6 +1471,8 @@ def configure_v8(o): if flavor != 'linux' and options.v8_enable_hugepage: raise Exception('--v8-enable-hugepage is supported only on linux.') o['variables']['v8_enable_hugepage'] = 1 if options.v8_enable_hugepage else 0 + if options.v8_enable_short_builtin_calls or o['variables']['target_arch'] == 'x64': + o['variables']['v8_enable_short_builtin_calls'] = 1 def configure_openssl(o): variables = o['variables'] diff --git a/tools/v8_gypfiles/features.gypi b/tools/v8_gypfiles/features.gypi index 2a2798156ff028..93162f53348c8d 100644 --- a/tools/v8_gypfiles/features.gypi +++ b/tools/v8_gypfiles/features.gypi @@ -132,6 +132,9 @@ 'v8_enable_pointer_compression%': 0, 'v8_enable_31bit_smis_on_64bit_arch%': 0, + # Sets -dV8_SHORT_BUILTIN_CALLS + 'v8_enable_short_builtin_calls%': 0, + # Sets -dOBJECT_PRINT. 'v8_enable_object_print%': 0, @@ -294,6 +297,9 @@ ['v8_enable_pointer_compression==1 or v8_enable_31bit_smis_on_64bit_arch==1', { 'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH',], }], + ['v8_enable_short_builtin_calls==1', { + 'defines': ['V8_SHORT_BUILTIN_CALLS',], + }], ['v8_enable_zone_compression==1', { 'defines': ['V8_COMPRESS_ZONES',], }],