Skip to content

Commit

Permalink
tools: update V8 gypfiles for 9.2
Browse files Browse the repository at this point in the history
Backport-PR-URL: #39470
PR-URL: #38990
Reviewed-By: Jiawen Geng <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Robert Nagy <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
  • Loading branch information
targos authored and BethGriggs committed Jul 29, 2021
1 parent 7f7cb8b commit 5fe74aa
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 22 deletions.
16 changes: 9 additions & 7 deletions tools/v8_gypfiles/features.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@
}, {
'is_component_build': 0,
}],
['OS == "win" or OS == "mac"', {
# Sets -DSYSTEM_INSTRUMENTATION. Enables OS-dependent event tracing
'v8_enable_system_instrumentation': 1,
}, {
'v8_enable_system_instrumentation': 0,
}],
],
'is_debug%': 0,

Expand Down Expand Up @@ -160,10 +166,6 @@
# 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%': 1,

Expand Down Expand Up @@ -327,9 +329,6 @@
['v8_enable_lazy_source_positions==1', {
'defines': ['V8_ENABLE_LAZY_SOURCE_POSITIONS',],
}],
['v8_check_microtasks_scopes_consistency==1', {
'defines': ['V8_CHECK_MICROTASKS_SCOPES_CONSISTENCY',],
}],
['v8_use_siphash==1', {
'defines': ['V8_USE_SIPHASH',],
}],
Expand Down Expand Up @@ -360,6 +359,9 @@
['v8_enable_precise_zone_stats==1', {
'defines': ['V8_ENABLE_PRECISE_ZONE_STATS',],
}],
['v8_enable_system_instrumentation==1', {
'defines': ['V8_ENABLE_SYSTEM_INSTRUMENTATION',],
}],
['v8_enable_webassembly==1', {
'defines': ['V8_ENABLE_WEBASSEMBLY',],
}],
Expand Down
56 changes: 41 additions & 15 deletions tools/v8_gypfiles/v8.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,11 @@
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"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 \\+= ")',
],
}],
],
},
}, # v8_internal_headers
Expand Down Expand Up @@ -856,11 +861,6 @@
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"mips\\".*?sources \\+= ")',
],
}],
['v8_target_arch=="riscv64"', {
'sources': [ ### gcmole(arch:riscv64) ###
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"riscv64.*?sources \+= ")',
],
}],
['v8_target_arch=="mips64" or v8_target_arch=="mips64el"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"mips64\\".*?sources \\+= ")',
Expand All @@ -881,6 +881,11 @@
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"s390\\".*?sources \\+= ")',
],
}],
['v8_target_arch=="riscv64"', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_current_cpu == \\"riscv64\\".*?sources \\+= ")',
],
}],
['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 All @@ -895,6 +900,13 @@
'ObjectFile': '$(IntDir)%(Extension)\\',
},
},
'conditions': [
['v8_enable_system_instrumentation==1', {
'sources': [
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?is_win.*?v8_enable_system_instrumentation.*?sources \\+= ")',
],
}],
],
}],
['component=="shared_library"', {
'defines': [
Expand Down Expand Up @@ -1133,9 +1145,11 @@
'<(V8_ROOT)/src/base/platform/platform-win32.cc',
'<(V8_ROOT)/src/base/win32-headers.h',
],
'conditions': [['target_arch == "arm64"', {
'defines': ['_WIN32_WINNT=0x0602'], # For GetCurrentThreadStackLimits on Windows on Arm
}]],
'conditions': [
['target_arch == "arm64"', {
'defines': ['_WIN32_WINNT=0x0602'], # For GetCurrentThreadStackLimits on Windows on Arm
}],
],
'defines': ['_CRT_RAND_S'], # for rand_s()
'direct_dependent_settings': {
'msvs_settings': {
Expand All @@ -1147,6 +1161,17 @@
]
}
},
'conditions': [
['v8_enable_system_instrumentation==1', {
'msvs_settings': {
'VCLinkerTool': {
'AdditionalDependencies': [
'advapi32.lib',
],
},
},
}],
],
},
}],
['target_arch == "mips" or OS == "mips64"', {
Expand Down Expand Up @@ -1288,8 +1313,6 @@
'<(V8_ROOT)/src/libplatform/delayed-task-queue.h',
'<(V8_ROOT)/src/libplatform/task-queue.cc',
'<(V8_ROOT)/src/libplatform/task-queue.h',
'<(V8_ROOT)/src/libplatform/tracing/recorder-default.cc',
'<(V8_ROOT)/src/libplatform/tracing/recorder.h',
'<(V8_ROOT)/src/libplatform/tracing/trace-buffer.cc',
'<(V8_ROOT)/src/libplatform/tracing/trace-buffer.h',
'<(V8_ROOT)/src/libplatform/tracing/trace-config.cc',
Expand All @@ -1313,7 +1336,6 @@
['v8_use_perfetto==1', {
'sources!': [
'<(V8_ROOT)/base/trace_event/common/trace_event_common.h',
'<(V8_ROOT)/src/libplatform/tracing/recorder-default.cc',
'<(V8_ROOT)/src/libplatform/tracing/trace-buffer.cc',
'<(V8_ROOT)/src/libplatform/tracing/trace-buffer.h',
'<(V8_ROOT)/src/libplatform/tracing/trace-object.cc',
Expand All @@ -1329,14 +1351,18 @@
'<(V8_ROOT)/third_party/perfetto/protos/perfetto/trace:lite',
],
}],
['v8_use_perfetto==0 and is_win', {
'sources!': [
'<(V8_ROOT)/src/libplatform/tracing/recorder-default.cc',
],
['v8_enable_system_instrumentation==1 and is_win', {
'sources': [
'<(V8_ROOT)/src/libplatform/tracing/recorder.h',
'<(V8_ROOT)/src/libplatform/tracing/recorder-win.cc',
],
}],
['v8_enable_system_instrumentation==1 and OS=="mac"', {
'sources': [
'<(V8_ROOT)/src/libplatform/tracing/recorder.h',
'<(V8_ROOT)/src/libplatform/tracing/recorder-mac.cc',
],
}],
],
'direct_dependent_settings': {
'include_dirs': [
Expand Down

0 comments on commit 5fe74aa

Please sign in to comment.