Skip to content

Commit

Permalink
tools: update V8 gypfiles for 9.3
Browse files Browse the repository at this point in the history
PR-URL: nodejs#39469
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
targos committed Aug 30, 2021
1 parent 2dcd79d commit 5a99954
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 33 deletions.
23 changes: 23 additions & 0 deletions tools/v8_gypfiles/features.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@
# Sets -dENABLE_GDB_JIT_INTERFACE.
'v8_enable_gdbjit%': 0,

# Sets -dENABLE_HUGEPAGE
'v8_enable_hugepage%': 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,
Expand Down Expand Up @@ -217,6 +220,13 @@
# Sets -DV8_DICT_PROPERTY_CONST_TRACKING
'v8_dict_property_const_tracking%': 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 global allocation site tracking.
'v8_allocation_site_tracking%': 1,

# Variables from v8.gni

# Enable ECMAScript Internationalization API. Enabling this feature will
Expand All @@ -232,6 +242,10 @@
# will not be available, and embedder APIs to generate WebAssembly modules
# will fail.
'v8_enable_webassembly%': 1,

# Enable advanced BigInt algorithms, costing about 10-30 KB binary size
# depending on platform.
'v8_advanced_bigint_algorithms%': 1
},

'target_defaults': {
Expand All @@ -257,6 +271,9 @@
['v8_enable_gdbjit==1', {
'defines': ['ENABLE_GDB_JIT_INTERFACE',],
}],
['v8_enable_hugepage==1', {
'defines': ['ENABLE_HUGEPAGE',],
}],
['v8_enable_minor_mc==1', {
'defines': ['ENABLE_MINOR_MC',],
}],
Expand Down Expand Up @@ -371,6 +388,12 @@
['v8_dict_property_const_tracking==1', {
'defines': ['V8_DICT_PROPERTY_CONST_TRACKING',],
}],
['v8_enable_allocation_folding==1', {
'defines': ['V8_ALLOCATION_FOLDING',],
}],
['v8_allocation_site_tracking==1', {
'defines': ['V8_ALLOCATION_SITE_TRACKING',],
}],
], # conditions
'defines': [
'V8_GYP_BUILD',
Expand Down
30 changes: 30 additions & 0 deletions tools/v8_gypfiles/toolchain.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,36 @@
},
},
}],
['OS=="android"', {
'defines': [
'V8_HAVE_TARGET_OS',
'V8_TARGET_OS_ANDROID',
]
}],
['OS=="ios"', {
'defines': [
'V8_HAVE_TARGET_OS',
'V8_TARGET_OS_IOS',
]
}],
['OS=="linux"', {
'defines': [
'V8_HAVE_TARGET_OS',
'V8_TARGET_OS_LINUX',
]
}],
['OS=="mac"', {
'defines': [
'V8_HAVE_TARGET_OS',
'V8_TARGET_OS_MACOSX',
]
}],
['OS=="win"', {
'defines': [
'V8_HAVE_TARGET_OS',
'V8_TARGET_OS_WIN',
]
}],
['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \
v8_target_arch=="ia32"', {
Expand Down
95 changes: 62 additions & 33 deletions tools/v8_gypfiles/v8.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -580,100 +580,110 @@
],
'direct_dependent_settings': {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?sources = ")',
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?sources = ")',
],
'conditions': [
['v8_enable_webassembly==1', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_enable_webassembly.*?sources \\+= ")',
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_enable_webassembly.*?sources \\+= ")',
],
}],
['v8_enable_i18n_support==1', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_enable_i18n_support.*?sources \\+= ")',
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_enable_i18n_support.*?sources \\+= ")',
],
}],
['v8_control_flow_integrity==1', {
['v8_control_flow_integrity==0', {
'sources': [
'<(V8_ROOT)/src/execution/arm64/pointer-authentication-arm64.h',
],
}, {
'sources': [
'<(V8_ROOT)/src/execution/pointer-authentication-dummy.h',
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?!v8_control_flow_integrity.*?sources \\+= ")',
],
}],
['v8_target_arch=="ia32"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_current_cpu == \\"x86.*?sources \\+= ")',
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"x86\\".*?sources \\+= ")',
],
}],
['v8_target_arch=="x64"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_current_cpu == \\"x64.*?sources \\+= ")',
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"x64\\".*?sources \\+= ")',
],
'conditions': [
['OS=="linux" or OS=="mac" or OS=="ios" or OS=="freebsd"', {
['OS=="win"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?is_linux.*?sources \\+= ")',
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"x64\\".*?is_win.*?sources \\+= ")',
],
}],
['OS=="win"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?is_win.*?sources \\+= ")',
['v8_enable_webassembly==1', {
'conditions': [
['OS=="linux" or OS=="mac" or OS=="ios" or OS=="freebsd"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"x64\\".*?v8_enable_webassembly.*?is_linux.*?sources \\+= ")',
],
}],
['OS=="win"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"x64\\".*?v8_enable_webassembly.*?is_win.*?sources \\+= ")',
],
}],
],
}],
],
}],
['v8_target_arch=="arm"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_current_cpu == \\"arm.*?sources \\+= ")',
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"arm\\".*?sources \\+= ")',
],
}],
['v8_target_arch=="arm64"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_current_cpu == \\"arm64.*?sources \\+= ")',
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"arm64\\".*?sources \\+= ")',
],
'conditions': [
['OS=="mac"', {
['v8_control_flow_integrity==1', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"arm64\\".*?v8_control_flow_integrity.*?sources \\+= ")',
],
}],
['v8_enable_webassembly==1 and OS=="mac"', {
'sources': [
"<(V8_ROOT)/src/trap-handler/handler-inside-posix.h",
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"arm64\\".*?v8_enable_webassembly.*?is_mac.*?sources \\+= ")',
],
}],
['OS=="win"', {
'sources': [
"<(V8_ROOT)/src/diagnostics/unwinding-info-win64.h"
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"arm64\\".*?is_win.*?sources \\+= ")',
],
}],
],
}],
['v8_target_arch=="mips" or v8_target_arch=="mipsel"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_current_cpu == \\"mips\\".*?sources \\+= ")',
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"mips\\".*?sources \\+= ")',
],
}],
['v8_target_arch=="mips64" or v8_target_arch=="mips64el"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_current_cpu == \\"mips64\\".*?sources \\+= ")',
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"mips64\\".*?sources \\+= ")',
],
}],
['v8_target_arch=="ppc"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_current_cpu == \\"ppc\\".*?sources \\+= ")',
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"ppc\\".*?sources \\+= ")',
],
}],
['v8_target_arch=="ppc64"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_current_cpu == \\"ppc64\\".*?sources \\+= ")',
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"ppc64\\".*?sources \\+= ")',
],
}],
['v8_target_arch=="s390x"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_current_cpu == \\"s390\\".*?sources \\+= ")',
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"s390\\".*?sources \\+= ")',
],
}],
['v8_target_arch=="riscv64"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_current_cpu == \\"riscv64\\".*?sources \\+= ")',
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"riscv64\\".*?sources \\+= ")',
],
}],
],
Expand Down Expand Up @@ -818,17 +828,26 @@
}],
['v8_target_arch=="x64"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"x64.*?sources \\+= ")',
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"x64\\".*?sources \\+= ")',
],
'conditions': [
['OS=="linux" or OS=="mac" or OS=="ios" or OS=="freebsd"', {
['OS=="win"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?is_linux.*?sources \\+= ")',
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"x64\\".*?is_win.*?sources \\+= ")',
],
}],
['OS=="win"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?is_win.*?sources \\+= ")',
['v8_enable_webassembly==1', {
'conditions': [
['OS=="linux" or OS=="mac" or OS=="ios" or OS=="freebsd"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"x64\\".*?v8_enable_webassembly.*?is_linux.*?sources \\+= ")',
],
}],
['OS=="win"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"x64\\".*?v8_enable_webassembly.*?is_win.*?sources \\+= ")',
],
}],
],
}],
],
Expand Down Expand Up @@ -1583,6 +1602,16 @@
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_source_set.\\"v8_bigint.*?sources = ")',
],
'conditions': [
['v8_advanced_bigint_algorithms==1', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_source_set.\\"v8_bigint.*?v8_advanced_bigint_algorithms.*?sources \\+= ")',
],
'defines': [
'V8_ADVANCED_BIGINT_ALGORITHMS',
],
}],
],
},
}, # v8_bigint
{
Expand Down

0 comments on commit 5a99954

Please sign in to comment.