From 277e5fadf8fb1f5784d886fa67317d8742971a8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Wed, 11 Sep 2019 08:26:00 +0200 Subject: [PATCH] build,tools: update V8 gypfiles for V8 7.9 V8 can can no longer be built without snapshot. Backport-PR-URL: https://github.com/nodejs/node/pull/30513 PR-URL: https://github.com/nodejs/node/pull/30020 Reviewed-By: Colin Ihrig Reviewed-By: Jiawen Geng Reviewed-By: Anna Henningsen Reviewed-By: Matteo Collina --- common.gypi | 56 ++++++++---------------- node.gyp | 1 - tools/v8_gypfiles/features.gypi | 13 +----- tools/v8_gypfiles/v8.gyp | 76 +++++++++++++++++++++++++++------ 4 files changed, 84 insertions(+), 62 deletions(-) diff --git a/common.gypi b/common.gypi index c63b03399db4b6..2e59636b1718f1 100644 --- a/common.gypi +++ b/common.gypi @@ -43,9 +43,6 @@ ##### V8 defaults for Node.js ##### - # Old time default, now explicitly stated. - 'v8_use_snapshot': 1, - # Turn on SipHash for hash seed generation, addresses HashWick 'v8_use_siphash': 'true', @@ -76,52 +73,27 @@ # TODO(refack): make v8-perfetto happen 'v8_use_perfetto': 0, + 'v8_enable_pointer_compression': 0, + 'v8_enable_31bit_smis_on_64bit_arch': 0, + ##### end V8 defaults ##### 'conditions': [ ['OS == "win"', { 'os_posix': 0, 'v8_postmortem_support%': 0, + 'obj_dir': '<(PRODUCT_DIR)/obj', + 'v8_base': '<(PRODUCT_DIR)/lib/libv8_snapshot.a', }, { 'os_posix': 1, 'v8_postmortem_support%': 1, }], - ['v8_use_snapshot==1', { - 'conditions': [ - ['GENERATOR == "ninja"', { - 'obj_dir': '<(PRODUCT_DIR)/obj', - 'v8_base': '<(PRODUCT_DIR)/obj/tools/v8_gypfiles/libv8_snapshot.a', - }, { - 'obj_dir%': '<(PRODUCT_DIR)/obj.target', - 'v8_base': '<(PRODUCT_DIR)/obj.target/tools/v8_gypfiles/libv8_snapshot.a', - }], - ['OS == "win"', { - 'obj_dir': '<(PRODUCT_DIR)/obj', - 'v8_base': '<(PRODUCT_DIR)/lib/libv8_snapshot.a', - }], - ['OS == "mac"', { - 'obj_dir%': '<(PRODUCT_DIR)/obj.target', - 'v8_base': '<(PRODUCT_DIR)/libv8_snapshot.a', - }], - ], + ['GENERATOR == "ninja"', { + 'obj_dir': '<(PRODUCT_DIR)/obj', + 'v8_base': '<(PRODUCT_DIR)/obj/tools/v8_gypfiles/libv8_snapshot.a', }, { - 'conditions': [ - ['GENERATOR == "ninja"', { - 'obj_dir': '<(PRODUCT_DIR)/obj', - 'v8_base': '<(PRODUCT_DIR)/obj/tools/v8_gypfiles/libv8_nosnapshot.a', - }, { - 'obj_dir%': '<(PRODUCT_DIR)/obj.target', - 'v8_base': '<(PRODUCT_DIR)/obj.target/tools/v8_gypfiles/libv8_nosnapshot.a', - }], - ['OS == "win"', { - 'obj_dir': '<(PRODUCT_DIR)/obj', - 'v8_base': '<(PRODUCT_DIR)/lib/libv8_nosnapshot.a', - }], - ['OS == "mac"', { - 'obj_dir%': '<(PRODUCT_DIR)/obj.target', - 'v8_base': '<(PRODUCT_DIR)/libv8_nosnapshot.a', - }], - ], + 'obj_dir%': '<(PRODUCT_DIR)/obj.target', + 'v8_base': '<(PRODUCT_DIR)/obj.target/tools/v8_gypfiles/libv8_snapshot.a', }], ['openssl_fips != ""', { 'openssl_product': '<(STATIC_LIB_PREFIX)crypto<(STATIC_LIB_SUFFIX)', @@ -130,6 +102,8 @@ }], ['OS=="mac"', { 'clang%': 1, + 'obj_dir%': '<(PRODUCT_DIR)/obj.target', + 'v8_base': '<(PRODUCT_DIR)/libv8_snapshot.a', }], ], }, @@ -334,6 +308,12 @@ }], ], }], + ['v8_enable_pointer_compression == 1', { + 'defines': ['V8_COMPRESS_POINTERS'], + }], + ['v8_enable_pointer_compression == 1 or v8_enable_31bit_smis_on_64bit_arch == 1', { + 'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH'], + }], ['OS == "win"', { 'defines': [ 'WIN32', diff --git a/node.gyp b/node.gyp index 58990af0394e2f..d3c8518b774c0c 100644 --- a/node.gyp +++ b/node.gyp @@ -1,7 +1,6 @@ { 'variables': { 'v8_use_siphash%': 0, - 'v8_use_snapshot%': 1, 'v8_trace_maps%': 0, 'node_use_dtrace%': 'false', 'node_use_etw%': 'false', diff --git a/tools/v8_gypfiles/features.gypi b/tools/v8_gypfiles/features.gypi index 602d6063f36173..aa8ae2874b3142 100644 --- a/tools/v8_gypfiles/features.gypi +++ b/tools/v8_gypfiles/features.gypi @@ -198,10 +198,6 @@ # Variables from v8.gni - # Enable the snapshot feature, for fast context creation. - # http://v8project.blogspot.com/2015/09/custom-startup-snapshots.html - 'v8_use_snapshot%': 1, - # Enable ECMAScript Internationalization API. Enabling this feature will # add a dependency on the ICU library. 'v8_enable_i18n_support%': 1, @@ -287,13 +283,8 @@ # ['v8_enable_handle_zapping==1', { # 'defines': ['ENABLE_HANDLE_ZAPPING',], # }], - ['v8_use_snapshot==1', { - 'defines': ['V8_USE_SNAPSHOT',], - 'conditions': [ - ['v8_enable_snapshot_native_code_counters==1', { - 'defines': ['V8_SNAPSHOT_NATIVE_CODE_COUNTERS',], - }], - ], + ['v8_enable_snapshot_native_code_counters==1', { + 'defines': ['V8_SNAPSHOT_NATIVE_CODE_COUNTERS',], }], ['v8_enable_single_generation==1', { 'defines': ['V8_ENABLE_SINGLE_GENERATION',], diff --git a/tools/v8_gypfiles/v8.gyp b/tools/v8_gypfiles/v8.gyp index b64df82fa38253..e569fb7d30147e 100644 --- a/tools/v8_gypfiles/v8.gyp +++ b/tools/v8_gypfiles/v8.gyp @@ -59,9 +59,13 @@ "<(V8_ROOT)/src/builtins/proxy-set-prototype-of.tq", "<(V8_ROOT)/src/builtins/proxy.tq", "<(V8_ROOT)/src/builtins/reflect.tq", + "<(V8_ROOT)/src/builtins/regexp-exec.tq", + "<(V8_ROOT)/src/builtins/regexp-match-all.tq", "<(V8_ROOT)/src/builtins/regexp-match.tq", "<(V8_ROOT)/src/builtins/regexp-replace.tq", + "<(V8_ROOT)/src/builtins/regexp-search.tq", "<(V8_ROOT)/src/builtins/regexp-source.tq", + "<(V8_ROOT)/src/builtins/regexp-split.tq", "<(V8_ROOT)/src/builtins/regexp-test.tq", "<(V8_ROOT)/src/builtins/regexp.tq", "<(V8_ROOT)/src/builtins/string.tq", @@ -138,6 +142,7 @@ ], 'outputs': [ '<(torque_output_root)/torque-generated/builtin-definitions-tq.h', + '<(torque_output_root)/torque-generated/interface-descriptors-tq.inc', '<(torque_output_root)/torque-generated/field-offsets-tq.h', '<(torque_output_root)/torque-generated/class-verifiers-tq.cc', '<(torque_output_root)/torque-generated/class-verifiers-tq.h', @@ -278,16 +283,7 @@ 'type': 'none', 'toolsets': ['target'], 'hard_dependency': 1, - 'conditions': [ - # The dependency on v8_base should come from a transitive - # dependency however the Android toolchain requires libv8_base.a - # to appear before libv8_snapshot.a so it's listed explicitly. - ['v8_use_snapshot==1', { - 'dependencies': ['v8_base', 'v8_snapshot'], - }, { - 'dependencies': ['v8_base', 'v8_init', 'v8_nosnapshot'], - }], - ] + 'dependencies': ['v8_base', 'v8_snapshot'], }, # v8_maybe_snapshot { 'target_name': 'v8_init', @@ -1495,7 +1491,6 @@ 'v8_enable_i18n_support=<(v8_enable_i18n_support)', 'v8_enable_verify_predictable=<(v8_enable_verify_predictable)', 'v8_target_cpu=<(v8_target_arch)', - 'v8_use_snapshot=<(v8_use_snapshot)', 'v8_use_siphash=<(v8_use_siphash)', 'v8_enable_embedded_builtins=<(v8_enable_embedded_builtins)', 'v8_enable_verify_csa=<(v8_enable_verify_csa)', @@ -1533,9 +1528,66 @@ 'toolsets': ['host', 'target'], }], ], + 'dependencies': ['run_torque'], 'variables': { 'heapobject_files': [ - '