Skip to content

Commit

Permalink
tools: update V8 gypfiles for 11.1
Browse files Browse the repository at this point in the history
  • Loading branch information
targos committed Mar 28, 2023
1 parent 45dc6a3 commit 123211c
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 35 deletions.
25 changes: 20 additions & 5 deletions tools/v8_gypfiles/features.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@
# as per the --native-code-counters flag.
'v8_enable_snapshot_native_code_counters%': 0,

# Use pre-generated static root pointer values from static-roots.h.
'v8_enable_static_roots%': 0,

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

Expand Down Expand Up @@ -168,10 +171,6 @@
# Enables various testing features.
'v8_enable_test_features%': 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
# tools/gen-postmortem-metadata.py for details.
Expand Down Expand Up @@ -278,9 +277,19 @@
# Sets --DV8_LITE_MODE.
'v8_enable_lite_mode%': 0,

# Enable the Turbofan compiler.
# Sets -dV8_ENABLE_TURBOFAN
'v8_enable_turbofan%': 1,

# Enable the Maglev compiler.
# Sets -dV8_ENABLE_MAGLEV
'v8_enable_maglev%': 0,

# Include support for WebAssembly. If disabled, the 'WebAssembly' global
# will not be available, and embedder APIs to generate WebAssembly modules
# will fail.
# will fail. Also, asm.js will not be translated to WebAssembly and will be
# executed as standard JavaScript instead.
# Sets -dV8_ENABLE_WEBASSEMBLY.
'v8_enable_webassembly%': 1,

# Enable advanced BigInt algorithms, costing about 10-30 KiB binary size
Expand Down Expand Up @@ -428,6 +437,9 @@
['v8_enable_cet_shadow_stack==1', {
'defines': ['V8_ENABLE_CET_SHADOW_STACK',],
}],
['v8_enable_static_roots==1', {
'defines': ['V8_STATIC_ROOTS',],
}],
['v8_use_zlib==1', {
'defines': ['V8_USE_ZLIB',],
}],
Expand All @@ -437,6 +449,9 @@
['v8_enable_maglev==1', {
'defines': ['V8_ENABLE_MAGLEV',],
}],
['v8_enable_turbofan==1', {
'defines': ['V8_ENABLE_TURBOFAN',],
}],
['v8_enable_swiss_name_dictionary==1', {
'defines': ['V8_ENABLE_SWISS_NAME_DICTIONARY',],
}],
Expand Down
2 changes: 2 additions & 0 deletions tools/v8_gypfiles/inspector.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
'inspector_all_sources': [
'<(V8_ROOT)/include/v8-inspector.h',
'<(V8_ROOT)/include/v8-inspector-protocol.h',
'<(V8_ROOT)/src/inspector/crc32.cc',
'<(V8_ROOT)/src/inspector/crc32.h',
'<(V8_ROOT)/src/inspector/custom-preview.cc',
'<(V8_ROOT)/src/inspector/custom-preview.h',
'<(V8_ROOT)/src/inspector/injected-script.cc',
Expand Down
124 changes: 94 additions & 30 deletions tools/v8_gypfiles/v8.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
'torque_outputs_inl_inc': ['<!@pymod_do_main(ForEachFormat "<(SHARED_INTERMEDIATE_DIR)/torque-generated/%s-inl.inc" <@(torque_files_replaced))'],
'torque_outputs_cc': ['<!@pymod_do_main(ForEachFormat "<(SHARED_INTERMEDIATE_DIR)/torque-generated/%s.cc" <@(torque_files_replaced))'],
'torque_outputs_inc': ['<!@pymod_do_main(ForEachFormat "<(SHARED_INTERMEDIATE_DIR)/torque-generated/%s.inc" <@(torque_files_replaced))'],
'v8_compiler_sources': ['<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_compiler_sources = ")'],
'conditions': [
['v8_enable_i18n_support==1', {
'torque_files': [
Expand All @@ -32,9 +31,6 @@
'torque_files': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "torque_files =.*?v8_enable_webassembly.*?torque_files \\+= ")',
],
'v8_compiler_sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_compiler_sources =.*?v8_enable_webassembly.*?v8_compiler_sources \\+= ")',
],
}],
],
},
Expand Down Expand Up @@ -678,7 +674,67 @@
},
}, # v8_internal_headers
{
'target_name': 'v8_compiler_opt',
'target_name': 'v8_compiler_sources',
'type': 'none',
'toolsets': ['host', 'target'],
'direct_dependent_settings': {
'sources': ['<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_compiler_sources = ")'],
'conditions': [
['v8_target_arch=="ia32"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_compiler_sources =.*?v8_current_cpu == \\"x86\\".*?v8_compiler_sources \\+= ")',
],
}],
['v8_target_arch=="x64"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_compiler_sources =.*?v8_current_cpu == \\"x64\\".*?v8_compiler_sources \\+= ")',
],
}],
['v8_target_arch=="arm"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_compiler_sources =.*?v8_current_cpu == \\"arm\\".*?v8_compiler_sources \\+= ")',
],
}],
['v8_target_arch=="arm64"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_compiler_sources =.*?v8_current_cpu == \\"arm64\\".*?v8_compiler_sources \\+= ")',
],
}],
['v8_target_arch=="mips64" or v8_target_arch=="mips64el"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_compiler_sources =.*?v8_current_cpu == \\"mips64\\".*?v8_compiler_sources \\+= ")',
],
}],
['v8_target_arch=="ppc"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_compiler_sources =.*?v8_current_cpu == \\"ppc\\".*?v8_compiler_sources \\+= ")',
],
}],
['v8_target_arch=="ppc64"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_compiler_sources =.*?v8_current_cpu == \\"ppc64\\".*?v8_compiler_sources \\+= ")',
],
}],
['v8_target_arch=="s390x"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_compiler_sources =.*?v8_current_cpu == \\"s390x\\".*?v8_compiler_sources \\+= ")',
],
}],
['v8_target_arch=="riscv64"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_compiler_sources =.*?v8_current_cpu == \\"riscv64\\".*?v8_compiler_sources \\+= ")',
],
}],
['v8_enable_webassembly==1', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_compiler_sources =.*?v8_enable_webassembly.*?v8_compiler_sources \\+= ")',
],
}],
],
}
}, # v8_compiler_sources
{
'target_name': 'v8_compiler_for_mksnapshot_source_set',
'type': 'static_library',
'toolsets': ['host', 'target'],
'dependencies': [
Expand All @@ -690,7 +746,6 @@
'v8_libbase',
'v8_shared_internal_headers',
],
'sources': ['<@(v8_compiler_sources)'],
'conditions': [
['OS=="win"', {
'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h',
Expand All @@ -700,8 +755,13 @@
'<(_msvs_precompiled_source)',
],
}],
['v8_enable_turbofan==1', {
'dependencies': ['v8_compiler_sources'],
}, {
'sources': ['<(V8_ROOT)/src/compiler/turbofan-disabled.cc'],
}],
],
}, # v8_compiler_opt
}, # v8_compiler_for_mksnapshot_source_set
{
'target_name': 'v8_compiler',
'type': 'static_library',
Expand All @@ -716,8 +776,12 @@
'v8_shared_internal_headers',
'v8_turboshaft',
],
'sources': ['<@(v8_compiler_sources)'],
'conditions': [
['v8_enable_turbofan==1', {
'dependencies': ['v8_compiler_sources'],
}, {
'sources': ['<(V8_ROOT)/src/compiler/turbofan-disabled.cc'],
}],
['OS=="win"', {
'msvs_precompiled_header': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.h',
'msvs_precompiled_source': '<(V8_ROOT)/../../tools/msvs/pch/v8_pch.cc',
Expand Down Expand Up @@ -766,12 +830,12 @@
'v8_maybe_icu',
],
'conditions': [
['is_component_build and not v8_optimized_debug and v8_enable_fast_mksnapshot', {
['(is_component_build and not v8_optimized_debug and v8_enable_fast_mksnapshot) or v8_enable_turbofan==0', {
'dependencies': [
'v8_compiler_opt',
'v8_compiler_for_mksnapshot_source_set',
],
'export_dependent_settings': [
'v8_compiler_opt',
'v8_compiler_for_mksnapshot_source_set',
],
}, {
'dependencies': [
Expand Down Expand Up @@ -1036,7 +1100,13 @@
'dependencies': [
'v8_base_without_compiler',
'v8_compiler',
'v8_turboshaft',
],
'conditions': [
['v8_enable_turbofan==1', {
'dependencies': [
'v8_turboshaft',
],
}],
],
}, # v8_base
{
Expand Down Expand Up @@ -1195,7 +1265,6 @@
'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',
]
}],
['OS == "ios"', {
Expand Down Expand Up @@ -1287,11 +1356,6 @@
'<(V8_ROOT)/src/base/platform/platform-linux.cc'
],
}],
['_toolset=="host" and host_os=="mac"', {
'sources': [
'<(V8_ROOT)/src/base/platform/platform-macos.cc'
],
}],
['_toolset=="target"', {
'sources': [
'<(V8_ROOT)/src/base/platform/platform-qnx.cc'
Expand Down Expand Up @@ -1661,47 +1725,47 @@
'conditions': [
['_toolset == "host" and host_arch == "x64" or _toolset == "target" and target_arch=="x64"', {
'sources': [
'<(V8_ROOT)/src/heap/base/asm/x64/save_registers_asm.cc',
'<(V8_ROOT)/src/heap/base/asm/x64/push_registers_asm.cc',
],
}],
['_toolset == "host" and host_arch == "ia32" or _toolset == "target" and target_arch=="ia32"', {
'sources': [
'<(V8_ROOT)/src/heap/base/asm/ia32/save_registers_asm.cc',
'<(V8_ROOT)/src/heap/base/asm/ia32/push_registers_asm.cc',
],
}],
['_toolset == "host" and host_arch == "arm" or _toolset == "target" and target_arch=="arm"', {
'sources': [
'<(V8_ROOT)/src/heap/base/asm/arm/save_registers_asm.cc',
'<(V8_ROOT)/src/heap/base/asm/arm/push_registers_asm.cc',
],
}],
['_toolset == "host" and host_arch == "arm64" or _toolset == "target" and target_arch=="arm64"', {
'sources': [
'<(V8_ROOT)/src/heap/base/asm/arm64/save_registers_asm.cc',
'<(V8_ROOT)/src/heap/base/asm/arm64/push_registers_asm.cc',
],
}],
['_toolset == "host" and host_arch == "ppc64" or _toolset == "target" and target_arch=="ppc64"', {
'sources': [
'<(V8_ROOT)/src/heap/base/asm/ppc/save_registers_asm.cc',
'<(V8_ROOT)/src/heap/base/asm/ppc/push_registers_asm.cc',
],
}],
['_toolset == "host" and host_arch == "s390x" or _toolset == "target" and target_arch=="s390x"', {
'sources': [
'<(V8_ROOT)/src/heap/base/asm/s390/save_registers_asm.cc',
'<(V8_ROOT)/src/heap/base/asm/s390/push_registers_asm.cc',
],
}],
['_toolset == "host" and host_arch == "mips64" or _toolset == "target" and target_arch=="mips64" or _toolset == "host" and host_arch == "mips64el" or _toolset == "target" and target_arch=="mips64el"', {
'sources': [
'<(V8_ROOT)/src/heap/base/asm/mips64/save_registers_asm.cc',
'<(V8_ROOT)/src/heap/base/asm/mips64/push_registers_asm.cc',
],
}],
['_toolset == "host" and host_arch == "riscv64" or _toolset == "target" and target_arch=="riscv64"', {
'sources': [
'<(V8_ROOT)/src/heap/base/asm/riscv/save_registers_asm.cc',
'<(V8_ROOT)/src/heap/base/asm/riscv/push_registers_asm.cc',
],
}],
['_toolset == "host" and host_arch == "loong64" or _toolset == "target" and target_arch=="loong64"', {
'sources': [
'<(V8_ROOT)/src/heap/base/asm/loong64/save_registers_asm.cc',
'<(V8_ROOT)/src/heap/base/asm/loong64/push_registers_asm.cc',
],
}],
]
Expand All @@ -1710,17 +1774,17 @@
'conditions': [
['_toolset == "host" and host_arch == "x64" or _toolset == "target" and target_arch=="x64"', {
'sources': [
'<(V8_ROOT)/src/heap/base/asm/x64/save_registers_masm.asm',
'<(V8_ROOT)/src/heap/base/asm/x64/push_registers_masm.asm',
],
}],
['_toolset == "host" and host_arch == "ia32" or _toolset == "target" and target_arch=="ia32"', {
'sources': [
'<(V8_ROOT)/src/heap/base/asm/ia32/save_registers_masm.asm',
'<(V8_ROOT)/src/heap/base/asm/ia32/push_registers_masm.asm',
],
}],
['_toolset == "host" and host_arch == "arm64" or _toolset == "target" and target_arch=="arm64"', {
'sources': [
'<(V8_ROOT)/src/heap/base/asm/arm64/save_registers_masm.S',
'<(V8_ROOT)/src/heap/base/asm/arm64/push_registers_masm.S',
],
}],
],
Expand Down

0 comments on commit 123211c

Please sign in to comment.