Skip to content

Commit bcc449d

Browse files
committedAug 30, 2021
tools: update V8 gypfiles for 9.3
PR-URL: nodejs#39469 Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 66af7e9 commit bcc449d

File tree

3 files changed

+115
-33
lines changed

3 files changed

+115
-33
lines changed
 

‎tools/v8_gypfiles/features.gypi

+23
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@
103103
# Sets -dENABLE_GDB_JIT_INTERFACE.
104104
'v8_enable_gdbjit%': 0,
105105

106+
# Sets -dENABLE_HUGEPAGE
107+
'v8_enable_hugepage%': 0,
108+
106109
# Currently set for node by common.gypi, avoiding default because of gyp file bug.
107110
# Should be turned on only for debugging.
108111
#'v8_enable_handle_zapping%': 0,
@@ -217,6 +220,13 @@
217220
# Sets -DV8_DICT_PROPERTY_CONST_TRACKING
218221
'v8_dict_property_const_tracking%': 0,
219222

223+
# Enable allocation folding globally (sets -dV8_ALLOCATION_FOLDING).
224+
# When it's disabled, the --turbo-allocation-folding runtime flag will be ignored.
225+
'v8_enable_allocation_folding%': 1,
226+
227+
# Enable global allocation site tracking.
228+
'v8_allocation_site_tracking%': 1,
229+
220230
# Variables from v8.gni
221231

222232
# Enable ECMAScript Internationalization API. Enabling this feature will
@@ -232,6 +242,10 @@
232242
# will not be available, and embedder APIs to generate WebAssembly modules
233243
# will fail.
234244
'v8_enable_webassembly%': 1,
245+
246+
# Enable advanced BigInt algorithms, costing about 10-30 KB binary size
247+
# depending on platform.
248+
'v8_advanced_bigint_algorithms%': 1
235249
},
236250

237251
'target_defaults': {
@@ -257,6 +271,9 @@
257271
['v8_enable_gdbjit==1', {
258272
'defines': ['ENABLE_GDB_JIT_INTERFACE',],
259273
}],
274+
['v8_enable_hugepage==1', {
275+
'defines': ['ENABLE_HUGEPAGE',],
276+
}],
260277
['v8_enable_minor_mc==1', {
261278
'defines': ['ENABLE_MINOR_MC',],
262279
}],
@@ -371,6 +388,12 @@
371388
['v8_dict_property_const_tracking==1', {
372389
'defines': ['V8_DICT_PROPERTY_CONST_TRACKING',],
373390
}],
391+
['v8_enable_allocation_folding==1', {
392+
'defines': ['V8_ALLOCATION_FOLDING',],
393+
}],
394+
['v8_allocation_site_tracking==1', {
395+
'defines': ['V8_ALLOCATION_SITE_TRACKING',],
396+
}],
374397
], # conditions
375398
'defines': [
376399
'V8_GYP_BUILD',

‎tools/v8_gypfiles/toolchain.gypi

+30
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,36 @@
996996
},
997997
},
998998
}],
999+
['OS=="android"', {
1000+
'defines': [
1001+
'V8_HAVE_TARGET_OS',
1002+
'V8_TARGET_OS_ANDROID',
1003+
]
1004+
}],
1005+
['OS=="ios"', {
1006+
'defines': [
1007+
'V8_HAVE_TARGET_OS',
1008+
'V8_TARGET_OS_IOS',
1009+
]
1010+
}],
1011+
['OS=="linux"', {
1012+
'defines': [
1013+
'V8_HAVE_TARGET_OS',
1014+
'V8_TARGET_OS_LINUX',
1015+
]
1016+
}],
1017+
['OS=="mac"', {
1018+
'defines': [
1019+
'V8_HAVE_TARGET_OS',
1020+
'V8_TARGET_OS_MACOSX',
1021+
]
1022+
}],
1023+
['OS=="win"', {
1024+
'defines': [
1025+
'V8_HAVE_TARGET_OS',
1026+
'V8_TARGET_OS_WIN',
1027+
]
1028+
}],
9991029
['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris" \
10001030
or OS=="netbsd" or OS=="mac" or OS=="android" or OS=="qnx") and \
10011031
v8_target_arch=="ia32"', {

‎tools/v8_gypfiles/v8.gyp

+62-33
Original file line numberDiff line numberDiff line change
@@ -580,100 +580,110 @@
580580
],
581581
'direct_dependent_settings': {
582582
'sources': [
583-
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?sources = ")',
583+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?sources = ")',
584584
],
585585
'conditions': [
586586
['v8_enable_webassembly==1', {
587587
'sources': [
588-
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_enable_webassembly.*?sources \\+= ")',
588+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_enable_webassembly.*?sources \\+= ")',
589589
],
590590
}],
591591
['v8_enable_i18n_support==1', {
592592
'sources': [
593-
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_enable_i18n_support.*?sources \\+= ")',
593+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_enable_i18n_support.*?sources \\+= ")',
594594
],
595595
}],
596-
['v8_control_flow_integrity==1', {
596+
['v8_control_flow_integrity==0', {
597597
'sources': [
598-
'<(V8_ROOT)/src/execution/arm64/pointer-authentication-arm64.h',
599-
],
600-
}, {
601-
'sources': [
602-
'<(V8_ROOT)/src/execution/pointer-authentication-dummy.h',
598+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?!v8_control_flow_integrity.*?sources \\+= ")',
603599
],
604600
}],
605601
['v8_target_arch=="ia32"', {
606602
'sources': [
607-
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_current_cpu == \\"x86.*?sources \\+= ")',
603+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"x86\\".*?sources \\+= ")',
608604
],
609605
}],
610606
['v8_target_arch=="x64"', {
611607
'sources': [
612-
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_current_cpu == \\"x64.*?sources \\+= ")',
608+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"x64\\".*?sources \\+= ")',
613609
],
614610
'conditions': [
615-
['OS=="linux" or OS=="mac" or OS=="ios" or OS=="freebsd"', {
611+
['OS=="win"', {
616612
'sources': [
617-
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?is_linux.*?sources \\+= ")',
613+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"x64\\".*?is_win.*?sources \\+= ")',
618614
],
619615
}],
620-
['OS=="win"', {
621-
'sources': [
622-
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?is_win.*?sources \\+= ")',
616+
['v8_enable_webassembly==1', {
617+
'conditions': [
618+
['OS=="linux" or OS=="mac" or OS=="ios" or OS=="freebsd"', {
619+
'sources': [
620+
'<!@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 \\+= ")',
621+
],
622+
}],
623+
['OS=="win"', {
624+
'sources': [
625+
'<!@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 \\+= ")',
626+
],
627+
}],
623628
],
624629
}],
625630
],
626631
}],
627632
['v8_target_arch=="arm"', {
628633
'sources': [
629-
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_current_cpu == \\"arm.*?sources \\+= ")',
634+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"arm\\".*?sources \\+= ")',
630635
],
631636
}],
632637
['v8_target_arch=="arm64"', {
633638
'sources': [
634-
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_current_cpu == \\"arm64.*?sources \\+= ")',
639+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"arm64\\".*?sources \\+= ")',
635640
],
636641
'conditions': [
637-
['OS=="mac"', {
642+
['v8_control_flow_integrity==1', {
643+
'sources': [
644+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"arm64\\".*?v8_control_flow_integrity.*?sources \\+= ")',
645+
],
646+
}],
647+
['v8_enable_webassembly==1 and OS=="mac"', {
638648
'sources': [
639-
"<(V8_ROOT)/src/trap-handler/handler-inside-posix.h",
649+
'<!@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 \\+= ")',
640650
],
641651
}],
642652
['OS=="win"', {
643653
'sources': [
644-
"<(V8_ROOT)/src/diagnostics/unwinding-info-win64.h"
654+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"arm64\\".*?is_win.*?sources \\+= ")',
645655
],
646656
}],
647657
],
648658
}],
649659
['v8_target_arch=="mips" or v8_target_arch=="mipsel"', {
650660
'sources': [
651-
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_current_cpu == \\"mips\\".*?sources \\+= ")',
661+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"mips\\".*?sources \\+= ")',
652662
],
653663
}],
654664
['v8_target_arch=="mips64" or v8_target_arch=="mips64el"', {
655665
'sources': [
656-
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_current_cpu == \\"mips64\\".*?sources \\+= ")',
666+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"mips64\\".*?sources \\+= ")',
657667
],
658668
}],
659669
['v8_target_arch=="ppc"', {
660670
'sources': [
661-
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_current_cpu == \\"ppc\\".*?sources \\+= ")',
671+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"ppc\\".*?sources \\+= ")',
662672
],
663673
}],
664674
['v8_target_arch=="ppc64"', {
665675
'sources': [
666-
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_current_cpu == \\"ppc64\\".*?sources \\+= ")',
676+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"ppc64\\".*?sources \\+= ")',
667677
],
668678
}],
669679
['v8_target_arch=="s390x"', {
670680
'sources': [
671-
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_current_cpu == \\"s390\\".*?sources \\+= ")',
681+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"s390\\".*?sources \\+= ")',
672682
],
673683
}],
674684
['v8_target_arch=="riscv64"', {
675685
'sources': [
676-
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_internal_headers.*?v8_current_cpu == \\"riscv64\\".*?sources \\+= ")',
686+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_current_cpu == \\"riscv64\\".*?sources \\+= ")',
677687
],
678688
}],
679689
],
@@ -818,17 +828,26 @@
818828
}],
819829
['v8_target_arch=="x64"', {
820830
'sources': [
821-
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"x64.*?sources \\+= ")',
831+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"x64\\".*?sources \\+= ")',
822832
],
823833
'conditions': [
824-
['OS=="linux" or OS=="mac" or OS=="ios" or OS=="freebsd"', {
834+
['OS=="win"', {
825835
'sources': [
826-
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?is_linux.*?sources \\+= ")',
836+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"x64\\".*?is_win.*?sources \\+= ")',
827837
],
828838
}],
829-
['OS=="win"', {
830-
'sources': [
831-
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?is_win.*?sources \\+= ")',
839+
['v8_enable_webassembly==1', {
840+
'conditions': [
841+
['OS=="linux" or OS=="mac" or OS=="ios" or OS=="freebsd"', {
842+
'sources': [
843+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"x64\\".*?v8_enable_webassembly.*?is_linux.*?sources \\+= ")',
844+
],
845+
}],
846+
['OS=="win"', {
847+
'sources': [
848+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"x64\\".*?v8_enable_webassembly.*?is_win.*?sources \\+= ")',
849+
],
850+
}],
832851
],
833852
}],
834853
],
@@ -1583,6 +1602,16 @@
15831602
'sources': [
15841603
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_source_set.\\"v8_bigint.*?sources = ")',
15851604
],
1605+
'conditions': [
1606+
['v8_advanced_bigint_algorithms==1', {
1607+
'sources': [
1608+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_source_set.\\"v8_bigint.*?v8_advanced_bigint_algorithms.*?sources \\+= ")',
1609+
],
1610+
'defines': [
1611+
'V8_ADVANCED_BIGINT_ALGORITHMS',
1612+
],
1613+
}],
1614+
],
15861615
},
15871616
}, # v8_bigint
15881617
{

0 commit comments

Comments
 (0)
Please sign in to comment.