From 26398575dc5b5155e7d31e961aaf5f189d584e08 Mon Sep 17 00:00:00 2001 From: Daoming Qiu Date: Wed, 12 Jan 2022 12:08:16 +0800 Subject: [PATCH] build: add --v8-enable-hugepage flag PR-URL: https://github.com/nodejs/node/pull/41487 Reviewed-By: James M Snell Reviewed-By: Jiawen Geng --- common.gypi | 3 +++ configure.py | 11 ++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/common.gypi b/common.gypi index dd89f1c9290..880f59acbfe 100644 --- a/common.gypi +++ b/common.gypi @@ -66,6 +66,9 @@ 'v8_enable_pointer_compression%': 0, 'v8_enable_31bit_smis_on_64bit_arch%': 0, + # Disable v8 hugepage by default. + 'v8_enable_hugepage%': 0, + # This is more of a V8 dev setting # https://github.com/nodejs/node/pull/22920/files#r222779926 'v8_enable_fast_mksnapshot': 0, diff --git a/configure.py b/configure.py index 44929db5f1a..1bd24a4a8e3 100755 --- a/configure.py +++ b/configure.py @@ -776,6 +776,13 @@ parser.add_argument('--v8-enable-object-print', default=True, help='compile V8 with auxiliar functions for native debuggers') +parser.add_argument('--v8-enable-hugepage', + action='store_true', + dest='v8_enable_hugepage', + default=None, + help='Enable V8 transparent hugepage support. This feature is only '+ + 'available on Linux platform.') + parser.add_argument('--node-builtin-modules-path', action='store', dest='node_builtin_modules_path', @@ -1434,7 +1441,9 @@ def configure_v8(o): raise Exception('--enable-d8 is incompatible with --without-bundled-v8.') if options.static_zoslib_gyp: o['variables']['static_zoslib_gyp'] = options.static_zoslib_gyp - + 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 def configure_openssl(o): variables = o['variables']