Skip to content

Commit

Permalink
build,tools: update V8 gypfiles for V8 7.9
Browse files Browse the repository at this point in the history
V8 can can no longer be built without snapshot.

Backport-PR-URL: #30513
PR-URL: #30020
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
  • Loading branch information
targos authored and MylesBorins committed Nov 21, 2019
1 parent 5a1ad57 commit 277e5fa
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 62 deletions.
56 changes: 18 additions & 38 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -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',

Expand Down Expand Up @@ -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)',
Expand All @@ -130,6 +102,8 @@
}],
['OS=="mac"', {
'clang%': 1,
'obj_dir%': '<(PRODUCT_DIR)/obj.target',
'v8_base': '<(PRODUCT_DIR)/libv8_snapshot.a',
}],
],
},
Expand Down Expand Up @@ -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',
Expand Down
1 change: 0 additions & 1 deletion node.gyp
Original file line number Diff line number Diff line change
@@ -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',
Expand Down
13 changes: 2 additions & 11 deletions tools/v8_gypfiles/features.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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',],
Expand Down
76 changes: 64 additions & 12 deletions tools/v8_gypfiles/v8.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -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)',
Expand Down Expand Up @@ -1533,9 +1528,66 @@
'toolsets': ['host', 'target'],
}],
],
'dependencies': ['run_torque'],
'variables': {
'heapobject_files': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"postmortem-metadata.*?sources = ")',
'<(V8_ROOT)/src/objects/objects.h',
'<(V8_ROOT)/src/objects/objects-inl.h',
'<(V8_ROOT)/src/objects/allocation-site-inl.h',
'<(V8_ROOT)/src/objects/allocation-site.h',
'<(V8_ROOT)/src/objects/cell-inl.h',
'<(V8_ROOT)/src/objects/cell.h',
'<(V8_ROOT)/src/objects/code-inl.h',
'<(V8_ROOT)/src/objects/code.h',
'<(V8_ROOT)/src/objects/data-handler.h',
'<(V8_ROOT)/src/objects/data-handler-inl.h',
'<(V8_ROOT)/src/objects/descriptor-array.h',
'<(V8_ROOT)/src/objects/descriptor-array-inl.h',
'<(V8_ROOT)/src/objects/feedback-cell.h',
'<(V8_ROOT)/src/objects/feedback-cell-inl.h',
'<(V8_ROOT)/src/objects/fixed-array-inl.h',
'<(V8_ROOT)/src/objects/fixed-array.h',
'<(V8_ROOT)/src/objects/heap-number-inl.h',
'<(V8_ROOT)/src/objects/heap-number.h',
'<(V8_ROOT)/src/objects/heap-object-inl.h',
'<(V8_ROOT)/src/objects/heap-object.h',
'<(V8_ROOT)/src/objects/instance-type.h',
'<(V8_ROOT)/src/objects/js-array-inl.h',
'<(V8_ROOT)/src/objects/js-array.h',
'<(V8_ROOT)/src/objects/js-array-buffer-inl.h',
'<(V8_ROOT)/src/objects/js-array-buffer.h',
'<(V8_ROOT)/src/objects/js-objects-inl.h',
'<(V8_ROOT)/src/objects/js-objects.h',
'<(V8_ROOT)/src/objects/js-promise-inl.h',
'<(V8_ROOT)/src/objects/js-promise.h',
'<(V8_ROOT)/src/objects/js-regexp-inl.h',
'<(V8_ROOT)/src/objects/js-regexp.cc',
'<(V8_ROOT)/src/objects/js-regexp.h',
'<(V8_ROOT)/src/objects/js-regexp-string-iterator-inl.h',
'<(V8_ROOT)/src/objects/js-regexp-string-iterator.h',
'<(V8_ROOT)/src/objects/map.h',
'<(V8_ROOT)/src/objects/map.cc',
'<(V8_ROOT)/src/objects/map-inl.h',
'<(V8_ROOT)/src/objects/js-objects.cc',
'<(V8_ROOT)/src/objects/name.h',
'<(V8_ROOT)/src/objects/name-inl.h',
'<(V8_ROOT)/src/objects/oddball-inl.h',
'<(V8_ROOT)/src/objects/oddball.h',
'<(V8_ROOT)/src/objects/primitive-heap-object.h',
'<(V8_ROOT)/src/objects/primitive-heap-object-inl.h',
'<(V8_ROOT)/src/objects/scope-info.h',
'<(V8_ROOT)/src/objects/script.h',
'<(V8_ROOT)/src/objects/script-inl.h',
'<(V8_ROOT)/src/objects/shared-function-info.h',
'<(V8_ROOT)/src/objects/shared-function-info-inl.h',
'<(V8_ROOT)/src/objects/string.cc',
'<(V8_ROOT)/src/objects/string.h',
'<(V8_ROOT)/src/objects/string-comparator.cc',
'<(V8_ROOT)/src/objects/string-comparator.h',
'<(V8_ROOT)/src/objects/string-inl.h',
'<(V8_ROOT)/src/objects/struct.h',
'<(V8_ROOT)/src/objects/struct-inl.h',
'<(torque_output_root)/torque-generated/instance-types-tq.h',
],
},
'actions': [
Expand Down

0 comments on commit 277e5fa

Please sign in to comment.