Skip to content

Commit

Permalink
build,deps: refactor and fix v8.gyp
Browse files Browse the repository at this point in the history
* Make inspector.gypi and v8_external_snapshot.gypi includible targets.
* Make `v8_dump_build_config` an action
* Better separate `js2c` and `natives_blob`
* process action outputs as sources
* trigger v8.gyp:postmortem-metadata from v8.gyp

PR-URL: #23182
Refs: #23156
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
  • Loading branch information
refack authored and targos committed Oct 4, 2018
1 parent 51f0060 commit 9800fd7
Show file tree
Hide file tree
Showing 8 changed files with 472 additions and 505 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

# Reset this number to 0 on major V8 upgrades.
# Increment by one for each non-official patch applied to deps/v8.
'v8_embedder_string': '-node.2',
'v8_embedder_string': '-node.3',

# Enable disassembler for `--print-code` v8 options
'v8_enable_disassembler': 1,
Expand Down
43 changes: 16 additions & 27 deletions deps/v8/gypfiles/features.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,16 @@

{
'variables': {
'variables': {
'v8_target_arch%': '<(target_arch)',
},
'v8_target_arch%': '<(target_arch)',

# Emulate GN variables
'conditions': [
['OS=="android"', { # GYP reverts OS to linux so use `-D OS=android`
'is_android': 1,
}, {
'is_android': 0,
}],
],

# Allows the embedder to add a custom suffix to the version string.
'v8_embedder_string%': '',
Expand Down Expand Up @@ -95,6 +102,8 @@

# Enable mitigations for executing untrusted code.
'v8_untrusted_code_mitigations%': 'true',

'v8_enable_handle_zapping%': 1,
},
'target_defaults': {
'conditions': [
Expand All @@ -105,7 +114,7 @@
'defines': ['ENABLE_DISASSEMBLER',],
}],
['v8_promise_internal_field_count!=0', {
'defines': ['V8_PROMISE_INTERNAL_FIELD_COUNT','v8_promise_internal_field_count'],
'defines': ['V8_PROMISE_INTERNAL_FIELD_COUNT=<(v8_promise_internal_field_count)'],
}],
['v8_enable_gdbjit==1', {
'defines': ['ENABLE_GDB_JIT_INTERFACE',],
Expand Down Expand Up @@ -155,30 +164,10 @@
['v8_untrusted_code_mitigations=="false"', {
'defines': ['DISABLE_UNTRUSTED_CODE_MITIGATIONS',],
}],
['v8_enable_handle_zapping==1', {
'defines': ['ENABLE_HANDLE_ZAPPING',],
}],
], # conditions
'configurations': {
'DebugBaseCommon': {
'abstract': 1,
'variables': {
'v8_enable_handle_zapping%': 1,
},
'conditions': [
['v8_enable_handle_zapping==1', {
'defines': ['ENABLE_HANDLE_ZAPPING',],
}],
],
}, # Debug
'Release': {
'variables': {
'v8_enable_handle_zapping%': 1,
},
'conditions': [
['v8_enable_handle_zapping==1', {
'defines': ['ENABLE_HANDLE_ZAPPING',],
}],
], # conditions
}, # Release
}, # configurations
'defines': [
'V8_GYP_BUILD',
'V8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=<(v8_typed_array_max_size_in_heap)',
Expand Down
89 changes: 0 additions & 89 deletions deps/v8/gypfiles/inspector.gyp

This file was deleted.

66 changes: 63 additions & 3 deletions deps/v8/gypfiles/inspector.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

{
'variables': {
'protocol_path': '../third_party/inspector_protocol',
'inspector_path': '../src/inspector',

'inspector_generated_sources': [
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Forward.h',
'<(SHARED_INTERMEDIATE_DIR)/src/inspector/protocol/Protocol.cpp',
Expand All @@ -29,8 +32,6 @@
'inspector_generated_injected_script': '<(SHARED_INTERMEDIATE_DIR)/src/inspector/injected-script-source.h',

'inspector_all_sources': [
'<@(inspector_generated_sources)',
'<(inspector_generated_injected_script)',
'../include/v8-inspector.h',
'../include/v8-inspector-protocol.h',
'../src/inspector/injected-script.cc',
Expand Down Expand Up @@ -86,5 +87,64 @@
'../src/inspector/wasm-translation.cc',
'../src/inspector/wasm-translation.h',
]
}
},
'includes': [
'../third_party/inspector_protocol/inspector_protocol.gypi',
],
'actions': [
{
'action_name': 'protocol_compatibility',
'inputs': [
'<(inspector_path)/js_protocol.json',
],
'outputs': [
'<@(SHARED_INTERMEDIATE_DIR)/src/js_protocol.stamp',
],
'action': [
'python',
'<(protocol_path)/CheckProtocolCompatibility.py',
'--stamp', '<@(_outputs)',
'<(inspector_path)/js_protocol.json',
],
'message': 'Checking inspector protocol compatibility',
},
{
'action_name': 'protocol_generated_sources',
'inputs': [
'<(inspector_path)/js_protocol.json',
'<(inspector_path)/inspector_protocol_config.json',
'<@(inspector_protocol_files)',
],
'outputs': [
'<@(inspector_generated_sources)',
],
'process_outputs_as_sources': 1,
'action': [
'python',
'<(protocol_path)/CodeGenerator.py',
'--jinja_dir', '../third_party',
'--output_base', '<(SHARED_INTERMEDIATE_DIR)/src/inspector',
'--config', '<(inspector_path)/inspector_protocol_config.json',
],
'message': 'Generating inspector protocol sources from protocol json',
},
{
'action_name': 'convert_js_to_cpp_char_array',
'inputs': [
'<(inspector_path)/build/xxd.py',
'<(inspector_injected_script_source)',
],
'outputs': [
'<(inspector_generated_injected_script)',
],
'process_outputs_as_sources': 1,
'action': [
'python',
'<(inspector_path)/build/xxd.py',
'InjectedScriptSource_js',
'<(inspector_path)/injected-script-source.js',
'<@(_outputs)'
],
},
],
}
19 changes: 19 additions & 0 deletions deps/v8/gypfiles/toolchain.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -1425,5 +1425,24 @@
}],
],
}, # configurations
'msvs_disabled_warnings': [
4245, # Conversion with signed/unsigned mismatch.
4267, # Conversion with possible loss of data.
4324, # Padding structure due to alignment.
4701, # Potentially uninitialized local variable.
4702, # Unreachable code.
4703, # Potentially uninitialized local pointer variable.
4709, # Comma operator within array index expr (bugged).
4714, # Function marked forceinline not inlined.

# MSVC assumes that control can get past an exhaustive switch and then
# warns if there's no return there (see https://crbug.com/v8/7658)
4715, # Not all control paths return a value.

4718, # Recursive call has no side-effect.
4723, # https://crbug.com/v8/7771
4724, # https://crbug.com/v8/7771
4800, # Forcing value to bool.
],
}, # target_defaults
}
Loading

0 comments on commit 9800fd7

Please sign in to comment.