Skip to content

Commit

Permalink
deps: sync V8 gypfiles with 7.4
Browse files Browse the repository at this point in the history
Normalized boolean options in the gypfiles for consistency both
internally and with the V8 GN config.

Co-authored-by: Michaël Zasso <targos@protonmail.com>

PR-URL: #26685
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
  • Loading branch information
ryzokuken authored and refack committed Mar 28, 2019
1 parent 7df9e77 commit cc75ba3
Show file tree
Hide file tree
Showing 11 changed files with 277 additions and 126 deletions.
17 changes: 4 additions & 13 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
##### V8 defaults for Node.js #####

# Old time default, now explicitly stated.
'v8_use_snapshot': 'true',
'v8_use_snapshot': 1,

# Turn on SipHash for hash seed generation, addresses HashWick
'v8_use_siphash': 'true',
Expand All @@ -58,21 +58,12 @@
# Enable disassembler for `--print-code` v8 options
'v8_enable_disassembler': 1,

# Don't bake anything extra into the snapshot.
'v8_use_external_startup_data': 0,

# https://github.com/nodejs/node/pull/22920/files#r222779926
'v8_enable_handle_zapping': 0,

# Disable V8 untrusted code mitigations.
# See https://github.com/v8/v8/wiki/Untrusted-code-mitigations
'v8_untrusted_code_mitigations': 'false',

# Still WIP in V8 7.1
'v8_enable_pointer_compression': 'false',

# New in V8 7.1
'v8_enable_embedded_builtins': 'true',
'v8_untrusted_code_mitigations': 0,

# This is more of a V8 dev setting
# https://github.com/nodejs/node/pull/22920/files#r222779926
Expand Down Expand Up @@ -102,12 +93,12 @@
}],
['OS == "win"', {
'os_posix': 0,
'v8_postmortem_support%': 'false',
'v8_postmortem_support%': 0,
'obj_dir': '<(PRODUCT_DIR)/obj',
'v8_base': '<(PRODUCT_DIR)/lib/v8_libbase.lib',
}, {
'os_posix': 1,
'v8_postmortem_support%': 'true',
'v8_postmortem_support%': 1,
}],
['OS == "mac"', {
'obj_dir%': '<(PRODUCT_DIR)/obj.target',
Expand Down
4 changes: 2 additions & 2 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1124,8 +1124,8 @@ def configure_v8(o):
o['variables']['v8_optimized_debug'] = 0 if options.v8_non_optimized_debug else 1
o['variables']['v8_random_seed'] = 0 # Use a random seed for hash tables.
o['variables']['v8_promise_internal_field_count'] = 1 # Add internal field to promises for async hooks.
o['variables']['v8_use_snapshot'] = 'false' if options.without_snapshot else 'true'
o['variables']['v8_use_siphash'] = 'false' if options.without_siphash else 'true'
o['variables']['v8_use_siphash'] = 0 if options.without_siphash else 1
o['variables']['v8_use_snapshot'] = 0 if options.without_snapshot else 1
o['variables']['v8_trace_maps'] = 1 if options.trace_maps else 0
o['variables']['node_use_v8_platform'] = b(not options.without_v8_platform)
o['variables']['node_use_bundled_v8'] = b(not options.without_bundled_v8)
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/gypfiles/d8.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
}],
[ 'component!="shared_library"', {
'conditions': [
[ 'v8_postmortem_support=="true"', {
[ 'v8_postmortem_support==1', {
'xcode_settings': {
'OTHER_LDFLAGS': [
'-Wl,-force_load,<(PRODUCT_DIR)/libv8_base.a'
Expand Down
215 changes: 131 additions & 84 deletions deps/v8/gypfiles/features.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -42,91 +42,121 @@
}],
],

# Allows the embedder to add a custom suffix to the version string.
'v8_embedder_string%': '',

'v8_enable_disassembler%': 0,

'v8_promise_internal_field_count%': 0,

'v8_enable_gdbjit%': 0,
# Variables from BUILD.gn

# Enable code-generation-time checking of types in the CodeStubAssembler.
'v8_enable_verify_csa%': 0,
# Set to 1 to enable DCHECKs in release builds.
'dcheck_always_on%': 0,

'v8_object_print%': 0,
# Sets -DV8_ENABLE_FUTURE.
'v8_enable_future%': 0,

# Lite mode disables a number of performance optimizations to reduce memory
# at the cost of performance.
# Sets --DV8_LITE_MODE.
'v8_enable_lite_mode%': 0,

# Sets -DVERIFY_HEAP.
'v8_enable_verify_heap%': 0,

'v8_trace_maps%': 0,
# Sets -DVERIFY_PREDICTABLE
'v8_enable_verify_predictable%': 0,

# Enable the snapshot feature, for fast context creation.
# http://v8project.blogspot.com/2015/09/custom-startup-snapshots.html
'v8_use_snapshot%': 'true',
# Enable compiler warnings when using V8_DEPRECATED apis.
'v8_deprecation_warnings%': 0,

'v8_enable_verify_predictable%': 0,
# Enable compiler warnings when using V8_DEPRECATE_SOON apis.
'v8_imminent_deprecation_warnings%': 0,

# With post mortem support enabled, metadata is embedded into libv8 that
# describes various parameters of the VM for use by debuggers. See
# tools/gen-postmortem-metadata.py for details.
'v8_postmortem_support%': 'false',
# Allows the embedder to add a custom suffix to the version string.
'v8_embedder_string%': '',

# Use Siphash as added protection against hash flooding attacks.
'v8_use_siphash%': 'false',
# Sets -dENABLE_DISASSEMBLER.
'v8_enable_disassembler%': 0,

# Interpreted regexp engine exists as platform-independent alternative
# based where the regular expression is compiled to a bytecode.
'v8_interpreted_regexp%': 0,
# Sets the number of internal fields on promise objects.
'v8_promise_internal_field_count%': 0,

# Enable ECMAScript Internationalization API. Enabling this feature will
# add a dependency on the ICU library.
'v8_enable_i18n_support%': 1,
# Sets -dENABLE_GDB_JIT_INTERFACE.
'v8_enable_gdbjit%': 0,

# Enable compiler warnings when using V8_DEPRECATED apis.
'v8_deprecation_warnings%': 0,
# Sets -dENABLE_VTUNE_JIT_INTERFACE.
'v8_enable_vtunejit%': 0,

# Enable compiler warnings when using V8_DEPRECATE_SOON apis.
'v8_imminent_deprecation_warnings%': 0,
# Currently set for node by common.gypi, avoiding default because of gyp file bug.
# Should be turned on only for debugging.
#'v8_enable_handle_zapping%': 0,

# Set to 1 to enable DCHECKs in release builds.
'dcheck_always_on%': 0,
# Enable fast mksnapshot runs.
'v8_enable_fast_mksnapshot%': 0,

# Enable/disable JavaScript API accessors.
'v8_js_accessors%': 0,
# Enable embedded builtins.
'v8_enable_embedded_builtins%': 1,

# Temporary flag to allow embedders to update their microtasks scopes.
'v8_check_microtasks_scopes_consistency%': 'false',
# Enable code comments for builtins in the snapshot (impacts performance).
'v8_enable_snapshot_code_comments%': 0,

# Enable concurrent marking.
# Enable code-generation-time checking of types in the CodeStubAssembler.
'v8_enable_verify_csa%': 0,

# Enable pointer compression (sets -dV8_COMPRESS_POINTERS).
'v8_enable_pointer_compression%': 0,
'v8_enable_31bit_smis_on_64bit_arch%': 0,

# Sets -dOBJECT_PRINT.
'v8_enable_object_print%': 0,

# Sets -dV8_TRACE_MAPS.
'v8_enable_trace_maps%': 0,

# Sets -dV8_ENABLE_CHECKS.
'v8_enable_v8_checks%': 0,

# Sets -dV8_TRACE_IGNITION.
'v8_enable_trace_ignition%': 0,

# Sets -dV8_TRACE_FEEDBACK_UPDATES.
'v8_enable_trace_feedback_updates%': 0,

# Sets -dV8_CONCURRENT_MARKING
'v8_enable_concurrent_marking%': 1,

# Enables various testing features.
'v8_enable_test_features%': 0,

# With post mortem support enabled, metadata is embedded into libv8 that
# describes various parameters of the VM for use by debuggers. See
# tools/gen-postmortem-metadata.py for details.
'v8_postmortem_support%': 0,

# Use Siphash as added protection against hash flooding attacks.
'v8_use_siphash%': 0,

# Controls the threshold for on-heap/off-heap Typed Arrays.
'v8_typed_array_max_size_in_heap%': 64,

# Temporary flag to allow embedders to update their microtasks scopes
# while rolling in a new version of V8.
'v8_check_microtasks_scopes_consistency%': 0,

# Enable mitigations for executing untrusted code.
'v8_untrusted_code_mitigations%': 'true',
'v8_untrusted_code_mitigations%': 1,

# Currently set for node by common.gypi, avoiding default because of gyp file bug.
# Should be turned on only for debugging.
#'v8_enable_handle_zapping%': 0,
# Enable minor mark compact.
'v8_enable_minor_mc%': 1,

'v8_enable_pointer_compression%': 'false',
'v8_enable_31bit_smis_on_64bit_arch%': 'false',
# Variables from v8.gni

'v8_enable_embedded_builtins%': 'true',
# Enable the snapshot feature, for fast context creation.
# http://v8project.blogspot.com/2015/09/custom-startup-snapshots.html
'v8_use_snapshot%': 1,

# Enable code comments for builtins in the snapshot (impacts performance).
'v8_enable_snapshot_code_comments%': 'false',
# Use external files for startup data blobs:
# the JS builtins sources and the start snapshot.
'v8_use_external_startup_data%': 0,

'v8_enable_fast_mksnapshot%': 0,
# Enable ECMAScript Internationalization API. Enabling this feature will
# add a dependency on the ICU library.
'v8_enable_i18n_support%': 1,
},

'target_defaults': {
Expand All @@ -140,37 +170,56 @@
['v8_promise_internal_field_count!=0', {
'defines': ['V8_PROMISE_INTERNAL_FIELD_COUNT=<(v8_promise_internal_field_count)'],
}],
['v8_enable_future==1', {
'defines': ['V8_ENABLE_FUTURE',],
}],
['v8_enable_lite_mode==1', {
'defines': [
'V8_LITE_MODE',

# TODO(v8:7777): Remove the define once the --jitless runtime flag does everything we need.
'V8_JITLESS_MODE',
],
}],
['v8_enable_gdbjit==1', {
'defines': ['ENABLE_GDB_JIT_INTERFACE',],
}],
['v8_enable_verify_csa==1', {
'defines': ['ENABLE_VERIFY_CSA',],
['v8_enable_vtunejit==1', {
'defines': ['ENABLE_VTUNE_JIT_INTERFACE',],
}],
['v8_object_print==1', {
['v8_enable_minor_mc==1', {
'defines': ['ENABLE_MINOR_MC',],
}],
['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',],
}],
['v8_enable_object_print==1', {
'defines': ['OBJECT_PRINT',],
}],
['v8_enable_verify_heap==1', {
'defines': ['VERIFY_HEAP',],
}],
['v8_trace_maps==1', {
['v8_enable_verify_predictable==1', {
'defines': ['VERIFY_PREDICTABLE',],
}],
['v8_enable_trace_maps==1', {
'defines': ['V8_TRACE_MAPS',],
}],
['v8_enable_test_features==1', {
'defines': ['V8_ENABLE_ALLOCATION_TIMEOUT', 'V8_ENABLE_FORCE_SLOW_PATH'],
['v8_enable_trace_ignition==1', {
'defines': ['V8_TRACE_IGNITION',],
}],
['v8_enable_verify_predictable==1', {
'defines': ['VERIFY_PREDICTABLE',],
['v8_enable_trace_feedback_updates==1', {
'defines': ['V8_TRACE_FEEDBACK_UPDATES',],
}],
['v8_enable_test_features==1', {
'defines': [
'V8_ENABLE_ALLOCATION_TIMEOUT',
'V8_ENABLE_FORCE_SLOW_PATH',
],
}],
['v8_interpreted_regexp==1 or v8_enable_lite_mode==1', {
'defines': ['V8_INTERPRETED_REGEXP',],
['v8_enable_v8_checks==1', {
'defines': ['V8_ENABLE_CHECKS',],
}],
['v8_deprecation_warnings==1', {
'defines': ['V8_DEPRECATION_WARNINGS',],
Expand All @@ -185,38 +234,36 @@
['v8_enable_i18n_support==1', {
'defines': ['V8_INTL_SUPPORT',],
}],
['v8_use_snapshot=="true" and v8_use_external_startup_data==1', {
'defines': ['V8_USE_EXTERNAL_STARTUP_DATA',],
# Refs: https://github.com/nodejs/node/pull/23801
# ['v8_enable_handle_zapping==1', {
# 'defines': ['ENABLE_HANDLE_ZAPPING',],
# }],
['v8_use_snapshot==1', {
'defines': ['V8_USE_SNAPSHOT',],
}],
['v8_use_siphash=="true"', {
'defines': ['V8_USE_SIPHASH',],
['v8_use_external_startup_data==1', {
'defines': ['V8_USE_EXTERNAL_STARTUP_DATA',],
}],
['dcheck_always_on!=0', {
'defines': ['DEBUG',],
['v8_enable_concurrent_marking==1', {
'defines': ['V8_CONCURRENT_MARKING',],
}],
['v8_check_microtasks_scopes_consistency=="true"', {
['v8_check_microtasks_scopes_consistency==1', {
'defines': ['V8_CHECK_MICROTASKS_SCOPES_CONSISTENCY',],
}],
['v8_enable_concurrent_marking==1', {
'defines': ['V8_CONCURRENT_MARKING',],
['v8_enable_embedded_builtins==1', {
'defines': ['V8_EMBEDDED_BUILTINS',],
}],
['v8_untrusted_code_mitigations=="false"', {
'defines': ['DISABLE_UNTRUSTED_CODE_MITIGATIONS',],
['v8_use_siphash==1', {
'defines': ['V8_USE_SIPHASH',],
}],
# Refs: https://github.com/nodejs/node/pull/23801
# ['v8_enable_handle_zapping==1', {
# 'defines': ['ENABLE_HANDLE_ZAPPING',],
# }],
['v8_enable_pointer_compression=="true"', {
'defines': ['V8_COMPRESS_POINTERS',],
['dcheck_always_on!=0', {
'defines': ['DEBUG',],
}],
['v8_enable_31bit_smis_on_64bit_arch=="true"', {
'defines': ['V8_31BIT_SMIS_ON_64BIT_ARCH',],
['v8_enable_verify_csa==1', {
'defines': ['ENABLE_VERIFY_CSA',],
}],
['v8_enable_embedded_builtins=="true"', {
'defines': [
'V8_EMBEDDED_BUILTINS',
],
['v8_untrusted_code_mitigations==0', {
'defines': ['DISABLE_UNTRUSTED_CODE_MITIGATIONS',],
}],
], # conditions
'defines': [
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/gypfiles/standalone.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
'v8_enable_i18n_support%': 1,
'v8_deprecation_warnings': 1,
'v8_imminent_deprecation_warnings': 1,
'v8_check_microtasks_scopes_consistency': 'true',
'v8_check_microtasks_scopes_consistency': 1,
'msvs_multi_core_compile%': '1',
'mac_deployment_target%': '10.7',
'release_extra_cflags%': '',
Expand Down
Loading

0 comments on commit cc75ba3

Please sign in to comment.