From 8915dd80d52856837a178e99bfab8bcf6c8e9534 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Thu, 5 Dec 2019 19:06:52 +0800 Subject: [PATCH 1/2] Revert "build: do not build mksnapshot and mkcodecache for --shared" This reverts commit 8cf8eb16ac873c11a6b1051c3a71a91659d431e3. --- configure.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/configure.py b/configure.py index 48624aba92bf19..61708a4447d125 100755 --- a/configure.py +++ b/configure.py @@ -981,15 +981,13 @@ def configure_node(o): o['variables']['want_separate_host_toolset'] = int(cross_compiling) if not options.without_node_snapshot: - o['variables']['node_use_node_snapshot'] = b( - not cross_compiling and not options.shared) + o['variables']['node_use_node_snapshot'] = b(not cross_compiling) else: o['variables']['node_use_node_snapshot'] = 'false' if not options.without_node_code_cache: # TODO(refack): fix this when implementing embedded code-cache when cross-compiling. - o['variables']['node_use_node_code_cache'] = b( - not cross_compiling and not options.shared) + o['variables']['node_use_node_code_cache'] = b(not cross_compiling) else: o['variables']['node_use_node_code_cache'] = 'false' From 9197897857edb7e9dcd310d11cbc5fda72942b76 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Thu, 5 Dec 2019 21:38:15 +0800 Subject: [PATCH 2/2] Revert "build: add --without-node-code-cache configure option" This reverts commit 6fd289860190f80b616fdb126bb97ce3f8a0a1c7. --- configure.py | 15 +++------------ node.gyp | 2 +- test/parallel/test-code-cache.js | 7 ++++--- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/configure.py b/configure.py index 61708a4447d125..959c1db6518fdb 100755 --- a/configure.py +++ b/configure.py @@ -455,11 +455,6 @@ dest='without_node_snapshot', help='Turn off V8 snapshot integration. Currently experimental.') -parser.add_option('--without-node-code-cache', - action='store_true', - dest='without_node_code_cache', - help='Turn off V8 Code cache integration.') - intl_optgroup.add_option('--download', action='store', dest='download_list', @@ -985,12 +980,6 @@ def configure_node(o): else: o['variables']['node_use_node_snapshot'] = 'false' - if not options.without_node_code_cache: - # TODO(refack): fix this when implementing embedded code-cache when cross-compiling. - o['variables']['node_use_node_code_cache'] = b(not cross_compiling) - else: - o['variables']['node_use_node_code_cache'] = 'false' - if target_arch == 'arm': configure_arm(o) elif target_arch in ('mips', 'mipsel', 'mips64el'): @@ -1111,7 +1100,9 @@ def configure_node(o): o['variables']['debug_nghttp2'] = 'false' o['variables']['node_no_browser_globals'] = b(options.no_browser_globals) - + # TODO(refack): fix this when implementing embedded code-cache when cross-compiling. + if o['variables']['want_separate_host_toolset'] == 0: + o['variables']['node_code_cache'] = 'yes' # For testing o['variables']['node_shared'] = b(options.shared) node_module_version = getmoduleversion.get_version() diff --git a/node.gyp b/node.gyp index 8becce9062edef..cffd150845e51a 100644 --- a/node.gyp +++ b/node.gyp @@ -436,7 +436,7 @@ }, }, }], - ['node_use_node_code_cache=="true"', { + ['want_separate_host_toolset==0', { 'dependencies': [ 'mkcodecache', ], diff --git a/test/parallel/test-code-cache.js b/test/parallel/test-code-cache.js index 3c4488c557d524..d01392f1ee6433 100644 --- a/test/parallel/test-code-cache.js +++ b/test/parallel/test-code-cache.js @@ -33,8 +33,6 @@ const loadedModules = process.moduleLoadList // are all compiled without cache and we are doing the bookkeeping right. if (!process.features.cached_builtins) { console.log('The binary is not configured with code cache'); - assert(!process.config.variables.node_use_node_code_cache); - if (isMainThread) { assert.deepStrictEqual(compiledWithCache, new Set()); for (const key of loadedModules) { @@ -48,7 +46,10 @@ if (!process.features.cached_builtins) { assert.notDeepStrictEqual(compiledWithCache, new Set()); } } else { // Native compiled - assert(process.config.variables.node_use_node_code_cache); + assert.strictEqual( + process.config.variables.node_code_cache, + 'yes' + ); if (!isMainThread) { for (const key of [ 'internal/bootstrap/pre_execution' ]) {