Skip to content

Commit

Permalink
tools: sync gypfiles with V8 7.7
Browse files Browse the repository at this point in the history
Co-authored-by: Ujjwal Sharma <usharma1998@gmail.com>

Backport-PR-URL: #29241
PR-URL: #28918
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
targos committed Sep 19, 2019
1 parent 60efc5f commit 027dcff
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 76 deletions.
2 changes: 1 addition & 1 deletion src/inspector/node_inspector.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
{
'action_name': 'concatenate_protocols',
'inputs': [
'../../deps/v8/src/inspector/js_protocol.pdl',
'../../deps/v8/include/js_protocol.pdl',
'<(SHARED_INTERMEDIATE_DIR)/src/node_protocol.json',
],
'outputs': [
Expand Down
7 changes: 7 additions & 0 deletions tools/v8_gypfiles/ForEachReplace.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Copyright (c) 2019 Ujjwal Sharma <usharma1998@gmail>. All rights reserved.
# Use of this source code is governed by an MIT-style license.

def DoMain(args):
old = args.pop(0)
new = args.pop(0)
return ' '.join(a.replace(old, new) for a in args)
1 change: 1 addition & 0 deletions tools/v8_gypfiles/features.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
'defines': [
'V8_ENABLE_ALLOCATION_TIMEOUT',
'V8_ENABLE_FORCE_SLOW_PATH',
'V8_ENABLE_DOUBLE_CONST_STORE_CHECK',
],
}],
['v8_enable_v8_checks==1', {
Expand Down
39 changes: 33 additions & 6 deletions tools/v8_gypfiles/inspector.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,31 @@
# found in the LICENSE file.

{
'includes': [
'../../deps/v8/third_party/inspector_protocol/inspector_protocol.gypi',
],
'variables': {
'inspector_protocol_path': '<(V8_ROOT)/third_party/inspector_protocol',
'inspector_protocol_files': [
'<(inspector_protocol_path)/lib/base_string_adapter_cc.template',
'<(inspector_protocol_path)/lib/base_string_adapter_h.template',
'<(inspector_protocol_path)/lib/DispatcherBase_cpp.template',
'<(inspector_protocol_path)/lib/DispatcherBase_h.template',
'<(inspector_protocol_path)/lib/ErrorSupport_cpp.template',
'<(inspector_protocol_path)/lib/ErrorSupport_h.template',
'<(inspector_protocol_path)/lib/Forward_h.template',
'<(inspector_protocol_path)/lib/FrontendChannel_h.template',
'<(inspector_protocol_path)/lib/Object_cpp.template',
'<(inspector_protocol_path)/lib/Object_h.template',
'<(inspector_protocol_path)/lib/Parser_cpp.template',
'<(inspector_protocol_path)/lib/Parser_h.template',
'<(inspector_protocol_path)/lib/Protocol_cpp.template',
'<(inspector_protocol_path)/lib/ValueConversions_h.template',
'<(inspector_protocol_path)/lib/Values_cpp.template',
'<(inspector_protocol_path)/lib/Values_h.template',
'<(inspector_protocol_path)/templates/Exported_h.template',
'<(inspector_protocol_path)/templates/Imported_h.template',
'<(inspector_protocol_path)/templates/TypeBuilder_cpp.template',
'<(inspector_protocol_path)/templates/TypeBuilder_h.template',
'<(inspector_protocol_path)/code_generator.py',
],
'inspector_path': '<(V8_ROOT)/src/inspector',
'inspector_generated_output_root': '<(SHARED_INTERMEDIATE_DIR)/inspector-generated-output-root',
'inspector_generated_sources': [
Expand Down Expand Up @@ -92,16 +112,22 @@
# Flat merge `third_party/inspector_protocol:encoding`
'<(inspector_protocol_path)/encoding/encoding.cc',
'<(inspector_protocol_path)/encoding/encoding.h',
]
# Flat merge `third_party/inspector_protocol:bindings`
'<(inspector_protocol_path)/bindings/bindings.cc',
'<(inspector_protocol_path)/bindings/bindings.h',

],
'v8_inspector_js_protocol': '<(V8_ROOT)/include/js_protocol.pdl',
},
'include_dirs': [
'<(inspector_generated_output_root)',
'<(inspector_protocol_path)',
],
'actions': [
{
'action_name': 'protocol_compatibility',
'inputs': [
'<(inspector_path)/js_protocol.pdl',
'<(v8_inspector_js_protocol)',
],
'outputs': [
'<@(inspector_generated_output_root)/src/js_protocol.stamp',
Expand All @@ -117,7 +143,7 @@
{
'action_name': 'protocol_generated_sources',
'inputs': [
'<(inspector_path)/js_protocol.pdl',
'<(v8_inspector_js_protocol)',
'<(inspector_path)/inspector_protocol_config.json',
'<@(inspector_protocol_files)',
],
Expand All @@ -131,6 +157,7 @@
'--jinja_dir', '<(V8_ROOT)/third_party',
'--output_base', '<(inspector_generated_output_root)/src/inspector',
'--config', '<(inspector_path)/inspector_protocol_config.json',
'--inspector_protocol_dir', '<(inspector_protocol_path)',
],
'message': 'Generating inspector protocol sources from protocol json',
},
Expand Down
85 changes: 16 additions & 69 deletions tools/v8_gypfiles/v8.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"<(V8_ROOT)/src/builtins/array-unshift.tq",
"<(V8_ROOT)/src/builtins/array.tq",
"<(V8_ROOT)/src/builtins/base.tq",
"<(V8_ROOT)/src/builtins/bigint.tq",
"<(V8_ROOT)/src/builtins/boolean.tq",
"<(V8_ROOT)/src/builtins/collections.tq",
"<(V8_ROOT)/src/builtins/data-view.tq",
Expand All @@ -44,13 +45,20 @@
"<(V8_ROOT)/src/builtins/iterator.tq",
"<(V8_ROOT)/src/builtins/math.tq",
"<(V8_ROOT)/src/builtins/object-fromentries.tq",
"<(V8_ROOT)/src/builtins/object.tq",
"<(V8_ROOT)/src/builtins/proxy-constructor.tq",
"<(V8_ROOT)/src/builtins/proxy-delete-property.tq",
"<(V8_ROOT)/src/builtins/proxy-get-property.tq",
"<(V8_ROOT)/src/builtins/proxy-get-prototype-of.tq",
"<(V8_ROOT)/src/builtins/proxy-has-property.tq",
"<(V8_ROOT)/src/builtins/proxy-is-extensible.tq",
"<(V8_ROOT)/src/builtins/proxy-prevent-extensions.tq",
"<(V8_ROOT)/src/builtins/proxy-revocable.tq",
"<(V8_ROOT)/src/builtins/proxy-revoke.tq",
"<(V8_ROOT)/src/builtins/proxy-set-property.tq",
"<(V8_ROOT)/src/builtins/proxy-set-prototype-of.tq",
"<(V8_ROOT)/src/builtins/proxy.tq",
"<(V8_ROOT)/src/builtins/reflect.tq",
"<(V8_ROOT)/src/builtins/regexp-replace.tq",
"<(V8_ROOT)/src/builtins/regexp.tq",
"<(V8_ROOT)/src/builtins/string.tq",
Expand All @@ -74,66 +82,12 @@
"<(V8_ROOT)/src/builtins/typed-array-subarray.tq",
"<(V8_ROOT)/src/builtins/typed-array.tq",
"<(V8_ROOT)/third_party/v8/builtins/array-sort.tq",
],
'torque_namespaces': [
"arguments",
"array",
"array-copywithin",
"array-filter",
"array-find",
"array-findindex",
"array-foreach",
"array-join",
"array-map",
"array-of",
"array-reverse",
"array-shift",
"array-slice",
"array-splice",
"array-unshift",
"array-lastindexof",
"base",
"boolean",
"collections",
"data-view",
"extras-utils",
"growable-fixed-array",
"internal-coverage",
"iterator",
"math",
"object",
"proxy",
"regexp",
"regexp-replace",
"string",
"string-html",
"string-iterator",
"string-repeat",
"string-slice",
"string-substring",
"typed-array",
"typed-array-createtypedarray",
"typed-array-every",
"typed-array-filter",
"typed-array-find",
"typed-array-findindex",
"typed-array-foreach",
"typed-array-reduce",
"typed-array-reduceright",
"typed-array-slice",
"typed-array-some",
"typed-array-subarray",
"<(V8_ROOT)/test/torque/test-torque.tq",
],
'torque_output_root': '<(SHARED_INTERMEDIATE_DIR)/torque-output-root',
# Since there is no foreach in GYP we use `ForEachFormat` to unroll the following:
# foreach(namespace, torque_namespaces) {
# outputs += [
# "$target_gen_dir/torque-generated/builtins-$namespace-gen-tq.cc",
# "$target_gen_dir/torque-generated/builtins-$namespace-gen-tq.h",
# ]
# }
'torque_outputs': ['<!@pymod_do_main(ForEachFormat "<(torque_output_root)/torque-generated/builtins-%s-gen-tq.cc" <@(torque_namespaces))'],
'torque_outputs+': ['<!@pymod_do_main(ForEachFormat "<(torque_output_root)/torque-generated/builtins-%s-gen-tq.h" <@(torque_namespaces))'],
'torque_files_replaced': ['<!@pymod_do_main(ForEachReplace ".tq" "-tq-csa" <@(torque_files))'],
'torque_outputs': ['<!@pymod_do_main(ForEachFormat "<(torque_output_root)/torque-generated/%s.cc" <@(torque_files_replaced))'],
'torque_outputs+': ['<!@pymod_do_main(ForEachFormat "<(torque_output_root)/torque-generated/%s.h" <@(torque_files_replaced))'],
'v8_compiler_sources': ['<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_compiler_sources = ")'],

'conditions': [
Expand Down Expand Up @@ -182,11 +136,13 @@
'<(torque_output_root)/torque-generated/exported-macros-assembler-tq.cc',
'<(torque_output_root)/torque-generated/exported-macros-assembler-tq.h',
'<(torque_output_root)/torque-generated/csa-types-tq.h',
'<(torque_output_root)/torque-generated/instance-types-tq.h',
'<@(torque_outputs)',
],
'action': [
'<@(_inputs)',
'-o', '<(torque_output_root)/torque-generated'
'-o', '<(torque_output_root)/torque-generated',
'-v8-root', '<(V8_ROOT)'
],
},
],
Expand Down Expand Up @@ -1237,16 +1193,7 @@
'sources': [
'<(V8_ROOT)/src/libplatform/tracing/json-trace-event-listener.cc',
'<(V8_ROOT)/src/libplatform/tracing/json-trace-event-listener.h',
'<(V8_ROOT)/src/libplatform/tracing/perfetto-consumer.cc',
'<(V8_ROOT)/src/libplatform/tracing/perfetto-consumer.h',
'<(V8_ROOT)/src/libplatform/tracing/perfetto-producer.cc',
'<(V8_ROOT)/src/libplatform/tracing/perfetto-producer.h',
'<(V8_ROOT)/src/libplatform/tracing/perfetto-shared-memory.cc',
'<(V8_ROOT)/src/libplatform/tracing/perfetto-shared-memory.h',
'<(V8_ROOT)/src/libplatform/tracing/perfetto-tasks.cc',
'<(V8_ROOT)/src/libplatform/tracing/perfetto-tasks.h',
'<(V8_ROOT)/src/libplatform/tracing/perfetto-tracing-controller.cc',
'<(V8_ROOT)/src/libplatform/tracing/perfetto-tracing-controller.h',
'<(V8_ROOT)/src/libplatform/tracing/trace-event-listener.cc',
'<(V8_ROOT)/src/libplatform/tracing/trace-event-listener.h',
],
'dependencies': [
Expand Down

0 comments on commit 027dcff

Please sign in to comment.