From e0f3d5703aa989857c1645937f16ebf9ec2ea2f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Reis?= Date: Wed, 11 Jul 2018 22:25:18 +0100 Subject: [PATCH] build,win,v8: allow precompiling objects-inl.h This makes compiling v8_base much faster on Windows. Sharding is disabled because the header would have to be precompiled for each shard but is only once. The library is much smaller, so sharding is unnecessary. This is enabled by default, but disabled for CI and releases. PR-URL: https://github.com/nodejs/node/pull/21772 Reviewed-By: Rich Trott Reviewed-By: Matteo Collina Reviewed-By: Refael Ackermann Reviewed-By: Kyle Farnung Reviewed-By: Bartosz Sosnowski --- common.gypi | 1 + configure | 10 ++++++++++ deps/v8/gypfiles/v8.gyp | 18 ++++++++++++++---- tools/msvs/pch/pch_v8_base.cc | 1 + tools/msvs/pch/pch_v8_base.h | 1 + vcbuild.bat | 8 ++++++-- 6 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 tools/msvs/pch/pch_v8_base.cc create mode 100644 tools/msvs/pch/pch_v8_base.h diff --git a/common.gypi b/common.gypi index 2496155cf93..b03e0a07ee9 100644 --- a/common.gypi +++ b/common.gypi @@ -17,6 +17,7 @@ 'node_use_bundled_v8%': 'true', 'node_module_version%': '', 'node_with_ltcg%': '', + 'node_use_pch%': 'false', 'node_tag%': '', 'uv_library%': 'static_library', diff --git a/configure b/configure index 068fb8a7699..f89812cc948 100755 --- a/configure +++ b/configure @@ -438,6 +438,11 @@ parser.add_option('--with-ltcg', dest='with_ltcg', help='Use Link Time Code Generation. This feature is only available on Windows.') +parser.add_option('--with-pch', + action='store_true', + dest='with_pch', + help='Use Precompiled Headers (only available on Windows).') + intl_optgroup.add_option('--download', action='store', dest='download_list', @@ -995,6 +1000,11 @@ def configure_node(o): if flavor != 'win' and options.with_ltcg: raise Exception('Link Time Code Generation is only supported on Windows.') + if flavor == 'win': + o['variables']['node_use_pch'] = b(options.with_pch) + else: + o['variables']['node_use_pch'] = 'false' + if options.tag: o['variables']['node_tag'] = '-' + options.tag else: diff --git a/deps/v8/gypfiles/v8.gyp b/deps/v8/gypfiles/v8.gyp index 99f868d1d38..277488b74a0 100644 --- a/deps/v8/gypfiles/v8.gyp +++ b/deps/v8/gypfiles/v8.gyp @@ -1796,10 +1796,20 @@ 'gyp_generators': '