Skip to content

Commit

Permalink
tools: update V8 gypfiles for 10.1
Browse files Browse the repository at this point in the history
PR-URL: #42657
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
  • Loading branch information
targos committed Apr 12, 2022
1 parent 62e6275 commit 40bc080
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 28 deletions.
1 change: 1 addition & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,7 @@ def configure_library(lib, output, pkgname=None):

def configure_v8(o):
o['variables']['v8_enable_webassembly'] = 1
o['variables']['v8_enable_javascript_promise_hooks'] = 1
o['variables']['v8_enable_lite_mode'] = 1 if options.v8_lite_mode else 0
o['variables']['v8_enable_gdbjit'] = 1 if options.gdb else 0
o['variables']['v8_no_strict_aliasing'] = 1 # Work around compiler bugs.
Expand Down
68 changes: 52 additions & 16 deletions tools/v8_gypfiles/features.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@
# Enables various testing features.
'v8_enable_test_features%': 0,

# Enables raw heap snapshots containing internals. Used for debugging memory
# on platform and embedder level.
'v8_enable_raw_heap_snapshots%': 0,
# Enable the Maglev compiler.
# Sets -dV8_ENABLE_MAGLEV
'v8_enable_maglev%': 0,

# With post mortem support enabled, metadata is embedded into libv8 that
# describes various parameters of the VM for use by debuggers. See
Expand All @@ -179,9 +179,6 @@
# Controls the threshold for on-heap/off-heap Typed Arrays.
'v8_typed_array_max_size_in_heap%': 64,

# Enable minor mark compact.
'v8_enable_minor_mc%': 1,

# Enable lazy source positions by default.
'v8_enable_lazy_source_positions%': 1,

Expand Down Expand Up @@ -217,26 +214,50 @@
# Sets -DV8_COMPRESS_ZONES.
'v8_enable_zone_compression%': 0,

# Enable the experimental V8 sandbox.
# Sets -DV8_SANDBOX.
'v8_enable_sandbox%': 0,

# Enable external pointer sandboxing. Requires v8_enable_sandbox.
# Sets -DV8_SANDBOXED_EXTERNAL_POINRTERS.
'v8_enable_sandboxed_external_pointers%': 0,

# Enable sandboxed pointers. Requires v8_enable_sandbox.
# Sets -DV8_SANDBOXED_POINTERS.
'v8_enable_sandboxed_pointers%': 0,

# Experimental feature for collecting per-class zone memory stats.
# Requires use_rtti = true
'v8_enable_precise_zone_stats%': 0,

# Experimental feature that uses SwissNameDictionary instead of NameDictionary
# as the backing store for all dictionary mode objects.
'v8_enable_swiss_name_dictionary%': 0,

# Experimental feature for tracking constness of properties in non-global
# dictionaries. Enabling this also always keeps prototypes in dict mode,
# meaning that they are not switched to fast mode.
# Sets -DV8_DICT_PROPERTY_CONST_TRACKING
'v8_dict_property_const_tracking%': 0,

# Allow for JS promise hooks (instead of just C++).
'v8_enable_javascript_promise_hooks%': 0,

# Enable allocation folding globally (sets -dV8_ALLOCATION_FOLDING).
# When it's disabled, the --turbo-allocation-folding runtime flag will be ignored.
'v8_enable_allocation_folding%': 1,

# Enable runtime verification of heap snapshots produced for devtools.
'v8_enable_heap_snapshot_verify%': 0,

# Enable global allocation site tracking.
'v8_allocation_site_tracking%': 1,

'v8_scriptormodule_legacy_lifetime%': 1,

'v8_include_receiver_in_argc%': 1,
# Change code emission and runtime features to be CET shadow-stack compliant
# (incomplete and experimental).
'v8_enable_cet_shadow_stack%': 0,

# Variables from v8.gni

Expand Down Expand Up @@ -270,9 +291,6 @@
['v8_promise_internal_field_count!=0', {
'defines': ['V8_PROMISE_INTERNAL_FIELD_COUNT=<(v8_promise_internal_field_count)'],
}],
['v8_enable_raw_heap_snapshots==1', {
'defines': ['V8_ENABLE_RAW_HEAP_SNAPSHOTS',],
}],
['v8_enable_future==1', {
'defines': ['V8_ENABLE_FUTURE',],
}],
Expand All @@ -285,9 +303,6 @@
['v8_enable_hugepage==1', {
'defines': ['ENABLE_HUGEPAGE',],
}],
['v8_enable_minor_mc==1', {
'defines': ['ENABLE_MINOR_MC',],
}],
['v8_enable_pointer_compression==1', {
'defines': [
'V8_COMPRESS_POINTERS',
Expand All @@ -303,6 +318,15 @@
['v8_enable_zone_compression==1', {
'defines': ['V8_COMPRESS_ZONES',],
}],
['v8_enable_sandbox==1', {
'defines': ['V8_SANDBOX',],
}],
['v8_enable_sandboxed_pointers==1', {
'defines': ['V8_SANDBOXED_POINTERS',],
}],
['v8_enable_sandboxed_external_pointers==1', {
'defines': ['V8_SANDBOXED_EXTERNAL_POINTERS',],
}],
['v8_enable_object_print==1', {
'defines': ['OBJECT_PRINT',],
}],
Expand Down Expand Up @@ -348,6 +372,9 @@
# ['v8_enable_handle_zapping==1', {
# 'defines': ['ENABLE_HANDLE_ZAPPING',],
# }],
['v8_enable_heap_snapshot_verify==1', {
'defines': ['V8_ENABLE_HEAP_SNAPSHOT_VERIFY',],
}],
['v8_enable_snapshot_native_code_counters==1', {
'defines': ['V8_SNAPSHOT_NATIVE_CODE_COUNTERS',],
}],
Expand Down Expand Up @@ -390,9 +417,18 @@
['v8_control_flow_integrity==1', {
'defines': ['V8_ENABLE_CONTROL_FLOW_INTEGRITY',],
}],
['v8_enable_cet_shadow_stack==1', {
'defines': ['V8_ENABLE_CET_SHADOW_STACK',],
}],
['v8_enable_precise_zone_stats==1', {
'defines': ['V8_ENABLE_PRECISE_ZONE_STATS',],
}],
['v8_enable_maglev==1', {
'defines': ['V8_ENABLE_MAGLEV',],
}],
['v8_enable_swiss_name_dictionary==1', {
'defines': ['V8_ENABLE_SWISS_NAME_DICTIONARY',],
}],
['v8_enable_system_instrumentation==1', {
'defines': ['V8_ENABLE_SYSTEM_INSTRUMENTATION',],
}],
Expand All @@ -402,6 +438,9 @@
['v8_dict_property_const_tracking==1', {
'defines': ['V8_DICT_PROPERTY_CONST_TRACKING',],
}],
['v8_enable_javascript_promise_hooks==1', {
'defines': ['V8_ENABLE_JAVASCRIPT_PROMISE_HOOKS',],
}],
['v8_enable_allocation_folding==1', {
'defines': ['V8_ALLOCATION_FOLDING',],
}],
Expand All @@ -414,9 +453,6 @@
['v8_advanced_bigint_algorithms==1', {
'defines': ['V8_ADVANCED_BIGINT_ALGORITHMS',],
}],
['v8_include_receiver_in_argc==1', {
'defines': ['V8_INCLUDE_RECEIVER_IN_ARGC',],
}],
], # conditions
'defines': [
'V8_GYP_BUILD',
Expand Down
2 changes: 1 addition & 1 deletion tools/v8_gypfiles/inspector.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@
'<(inspector_protocol_path)/crdtp/protocol_core.h',
'<(inspector_protocol_path)/crdtp/serializable.cc',
'<(inspector_protocol_path)/crdtp/serializable.h',
'<(inspector_protocol_path)/crdtp/serializer_traits.h',
'<(inspector_protocol_path)/crdtp/span.cc',
'<(inspector_protocol_path)/crdtp/span.h',
'<(inspector_protocol_path)/crdtp/status.cc',
Expand Down Expand Up @@ -166,6 +165,7 @@
'--jinja_dir', '<(V8_ROOT)/third_party',
'--output_base', '<(inspector_generated_output_root)/src/inspector',
'--config', '<(inspector_path)/inspector_protocol_config.json',
'--config_value', 'protocol.path=<(v8_inspector_js_protocol)',
'--inspector_protocol_dir', '<(inspector_protocol_path)',
],
'message': 'Generating inspector protocol sources from protocol json',
Expand Down
2 changes: 1 addition & 1 deletion tools/v8_gypfiles/toolchain.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -1008,7 +1008,7 @@
['OS=="mac"', {
'defines': [
'V8_HAVE_TARGET_OS',
'V8_TARGET_OS_MACOSX',
'V8_TARGET_OS_MACOS',
]
}],
['OS=="win"', {
Expand Down
40 changes: 30 additions & 10 deletions tools/v8_gypfiles/v8.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@
'toolsets': ['host', 'target'],
'dependencies': [
'v8_config_headers',
'cppgc_headers',
'v8_heap_base_headers',
'v8_version',
],
'direct_dependent_settings': {
Expand Down Expand Up @@ -529,7 +529,7 @@
'v8_headers',
'v8_maybe_icu',
'v8_shared_internal_headers',
'cppgc_headers',
'v8_heap_base_headers',
'generate_bytecode_builtins_list',
'run_torque',
'v8_libbase',
Expand All @@ -539,6 +539,11 @@
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?sources = ")',
],
'conditions': [
['v8_enable_maglev==1', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_enable_maglev.*?sources \\+= ")',
],
}],
['v8_enable_webassembly==1', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_enable_webassembly.*?sources \\+= ")',
Expand All @@ -554,6 +559,11 @@
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?!v8_control_flow_integrity.*?sources \\+= ")',
],
}],
['v8_enable_heap_snapshot_verify==1', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_enable_heap_snapshot_verify.*?sources \\+= ")',
],
}],
['v8_target_arch=="ia32"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"x86\\".*?sources \\+= ")',
Expand Down Expand Up @@ -745,8 +755,8 @@
'dependencies': [
'torque_generated_definitions',
'v8_bigint',
'v8_cppgc_shared',
'v8_headers',
'v8_heap_base',
'v8_libbase',
'v8_shared_internal_headers',
'v8_version',
Expand Down Expand Up @@ -779,11 +789,21 @@
'<(V8_ROOT)/src/heap/third-party/heap-api-stub.cc',
],
}],
['v8_enable_maglev==1', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_enable_maglev.*?sources \\+= ")',
],
}],
['v8_enable_webassembly==1', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_enable_webassembly.*?sources \\+= ")',
],
}],
['v8_enable_heap_snapshot_verify==1', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_enable_heap_snapshot_verify.*?sources \\+= ")',
],
}],
['v8_target_arch=="ia32"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"x86.*?sources \\+= ")',
Expand Down Expand Up @@ -1128,6 +1148,7 @@
['OS == "mac" or OS == "ios"', {
'sources': [
'<(V8_ROOT)/src/base/debug/stack_trace_posix.cc',
'<(V8_ROOT)/src/base/platform/platform-darwin.cc',
'<(V8_ROOT)/src/base/platform/platform-macos.cc',
]
}],
Expand Down Expand Up @@ -1525,15 +1546,15 @@
],
}, # run_gen-regexp-special-case
{
'target_name': 'cppgc_headers',
'target_name': 'v8_heap_base_headers',
'type': 'none',
'toolsets': ['host', 'target'],
'direct_dependent_settings': {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"cppgc_headers.*?sources = ")',
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_source_set.\\"v8_heap_base_headers.*?sources = ")',
],
},
}, # cppgc_headers
}, # v8_heap_base_headers
{
'target_name': 'cppgc_base',
'type': 'none',
Expand Down Expand Up @@ -1562,15 +1583,14 @@
},
}, # v8_bigint
{
'target_name': 'v8_cppgc_shared',
'target_name': 'v8_heap_base',
'type': 'none',
'toolsets': ['host', 'target'],
'direct_dependent_settings': {
'sources': [
'<(V8_ROOT)/src/heap/base/active-system-pages.cc',
'<(V8_ROOT)/src/heap/base/stack.cc',
'<(V8_ROOT)/src/heap/base/stack.h',
'<(V8_ROOT)/src/heap/base/worklist.cc',
'<(V8_ROOT)/src/heap/base/worklist.h',
],
'conditions': [
['enable_lto=="true"', {
Expand Down Expand Up @@ -1651,7 +1671,7 @@
}],
],
},
}, # v8_cppgc_shared
}, # v8_heap_base

###############################################################################
# Public targets
Expand Down

0 comments on commit 40bc080

Please sign in to comment.