From 7d917d3be4422e218ce9b981c821167a33ec4f8a Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Wed, 12 Jun 2019 02:37:44 +0800 Subject: [PATCH 1/2] tools: assert that the snapshot can be rehashed in node_mksnapshot --- tools/snapshot/snapshot_builder.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/snapshot/snapshot_builder.cc b/tools/snapshot/snapshot_builder.cc index 54a4a2e73da249..0fd2c49d2845a8 100644 --- a/tools/snapshot/snapshot_builder.cc +++ b/tools/snapshot/snapshot_builder.cc @@ -96,6 +96,7 @@ std::string SnapshotBuilder::Generate( // Must be out of HandleScope StartupData blob = creator.CreateBlob(SnapshotCreator::FunctionCodeHandling::kClear); + CHECK(blob.CanBeRehashed()); // Must be done while the snapshot creator isolate is entered i.e. the // creator is still alive. main_instance->Dispose(); From c1a2c64d52a274a373ba6cd06049d3fbf158ddf3 Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Wed, 12 Jun 2019 02:38:14 +0800 Subject: [PATCH 2/2] build: turn on custom V8 snapshot by default This patch re-enables custom V8 snapshot integration. Also renames the experimental configure switch from `--with-node-snapshot` to `--without-node-snapshot` to be consistent with`--without-snapshot` which is used for the default V8 snapshot. --- configure.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/configure.py b/configure.py index 38ff742e3a76ef..41678b926449a1 100755 --- a/configure.py +++ b/configure.py @@ -421,10 +421,10 @@ dest='with_ltcg', help='Use Link Time Code Generation. This feature is only available on Windows.') -parser.add_option('--with-node-snapshot', +parser.add_option('--without-node-snapshot', action='store_true', - dest='with_node_snapshot', - help='Turn on V8 snapshot integration. Currently experimental.') + dest='without_node_snapshot', + help='Turn off V8 snapshot integration. Currently experimental.') intl_optgroup.add_option('--download', action='store', @@ -940,11 +940,9 @@ def configure_node(o): o['variables']['want_separate_host_toolset'] = int( cross_compiling and want_snapshots) - if options.with_node_snapshot: - o['variables']['node_use_node_snapshot'] = 'true' + if not options.without_node_snapshot: + o['variables']['node_use_node_snapshot'] = b(not cross_compiling) else: - # Default to false for now. - # TODO(joyeecheung): enable it once we fix the hashseed uniqueness o['variables']['node_use_node_snapshot'] = 'false' if target_arch == 'arm':