Commit b1df16f8 authored by Tobias Tebbi's avatar Tobias Tebbi Committed by Commit Bot

[torque] refactor BUILD.gn to list torque sources in one place

Change-Id: Ibb6e10caaa4fcdb29c35baef71cf1b4faef45bc4
Reviewed-on: https://chromium-review.googlesource.com/1042389Reviewed-by: 's avatarDaniel Clifford <danno@chromium.org>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Tobias Tebbi <tebbi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53069}
parent 9c718099
...@@ -842,6 +842,18 @@ action("postmortem-metadata") { ...@@ -842,6 +842,18 @@ action("postmortem-metadata") {
rebase_path(sources, root_build_dir) rebase_path(sources, root_build_dir)
} }
torque_files = [
"src/builtins/base.tq",
"src/builtins/array.tq",
"src/builtins/typed-array.tq",
]
torque_modules = [
"base",
"array",
"typed-array",
]
action("run_torque") { action("run_torque") {
visibility = [ visibility = [
":*", ":*",
...@@ -863,32 +875,61 @@ action("run_torque") { ...@@ -863,32 +875,61 @@ action("run_torque") {
script = "tools/run.py" script = "tools/run.py"
inputs = [ sources = torque_files
"src/builtins/base.tq",
"src/builtins/array.tq",
"src/builtins/typed-array.tq",
]
outputs = [ outputs = [
"$target_gen_dir/builtin-definitions-from-dsl.h", "$target_gen_dir/torque-generated/builtin-definitions-from-dsl.h",
"$target_gen_dir/builtins-array-from-dsl-gen.cc",
"$target_gen_dir/builtins-array-from-dsl-gen.h",
"$target_gen_dir/builtins-base-from-dsl-gen.cc",
"$target_gen_dir/builtins-base-from-dsl-gen.h",
"$target_gen_dir/builtins-typed-array-from-dsl-gen.cc",
"$target_gen_dir/builtins-typed-array-from-dsl-gen.h",
] ]
foreach(module, torque_modules) {
outputs += [
"$target_gen_dir/torque-generated/builtins-$module-from-dsl-gen.cc",
"$target_gen_dir/torque-generated/builtins-$module-from-dsl-gen.h",
]
}
args = [ args = [
"./" + rebase_path(get_label_info(":torque($v8_torque_toolchain)", "./" + rebase_path(get_label_info(":torque($v8_torque_toolchain)",
"root_out_dir") + "/torque", "root_out_dir") + "/torque",
root_build_dir), root_build_dir),
"-o", "-o",
rebase_path("$target_gen_dir", root_build_dir), rebase_path("$target_gen_dir/torque-generated", root_build_dir),
rebase_path("src/builtins/base.tq", root_build_dir),
rebase_path("src/builtins/array.tq", root_build_dir),
rebase_path("src/builtins/typed-array.tq", root_build_dir),
] ]
foreach(file, torque_files) {
args += [ rebase_path(file, root_build_dir) ]
}
}
v8_source_set("torque_generated_core") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
deps = [
":run_torque",
]
sources = [
"$target_gen_dir/torque-generated/builtin-definitions-from-dsl.h",
]
configs = [ ":internal_config" ]
}
v8_source_set("torque_generated_initializers") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
deps = [
":run_torque",
]
sources = []
foreach(module, torque_modules) {
sources += [
"$target_gen_dir/torque-generated/builtins-$module-from-dsl-gen.cc",
"$target_gen_dir/torque-generated/builtins-$module-from-dsl-gen.h",
]
}
configs = [ ":internal_config" ]
} }
# Template to generate different V8 snapshots based on different runtime flags. # Template to generate different V8 snapshots based on different runtime flags.
...@@ -1200,15 +1241,11 @@ v8_source_set("v8_initializers") { ...@@ -1200,15 +1241,11 @@ v8_source_set("v8_initializers") {
] ]
deps = [ deps = [
":run_torque", ":torque_generated_initializers",
":v8_base", ":v8_base",
] ]
sources = [ sources = [
"$target_gen_dir/builtins-array-from-dsl-gen.cc",
"$target_gen_dir/builtins-base-from-dsl-gen.cc",
"$target_gen_dir/builtins-typed-array-from-dsl-gen.cc",
### gcmole(all) ### ### gcmole(all) ###
"src/builtins/builtins-arguments-gen.cc", "src/builtins/builtins-arguments-gen.cc",
"src/builtins/builtins-arguments-gen.h", "src/builtins/builtins-arguments-gen.h",
...@@ -1389,7 +1426,6 @@ v8_source_set("v8_base") { ...@@ -1389,7 +1426,6 @@ v8_source_set("v8_base") {
split_count = 2 split_count = 2
sources = [ sources = [
"$target_gen_dir/builtin-definitions-from-dsl.h",
"//base/trace_event/common/trace_event_common.h", "//base/trace_event/common/trace_event_common.h",
### gcmole(all) ### ### gcmole(all) ###
...@@ -2699,7 +2735,7 @@ v8_source_set("v8_base") { ...@@ -2699,7 +2735,7 @@ v8_source_set("v8_base") {
defines = [] defines = []
deps = [ deps = [
":run_torque", ":torque_generated_core",
":v8_headers", ":v8_headers",
":v8_libbase", ":v8_libbase",
":v8_libsampler", ":v8_libsampler",
...@@ -3450,7 +3486,7 @@ v8_source_set("wasm_module_runner") { ...@@ -3450,7 +3486,7 @@ v8_source_set("wasm_module_runner") {
] ]
deps = [ deps = [
":run_torque", ":torque_generated_core",
] ]
configs = [ configs = [
...@@ -3527,7 +3563,7 @@ v8_source_set("lib_wasm_fuzzer_common") { ...@@ -3527,7 +3563,7 @@ v8_source_set("lib_wasm_fuzzer_common") {
] ]
deps = [ deps = [
":run_torque", ":torque_generated_core",
] ]
configs = [ configs = [
......
...@@ -27,7 +27,8 @@ include_rules = [ ...@@ -27,7 +27,8 @@ include_rules = [
"+src/trap-handler/trap-handler.h", "+src/trap-handler/trap-handler.h",
"+testing/gtest/include/gtest/gtest_prod.h", "+testing/gtest/include/gtest/gtest_prod.h",
"-src/libplatform", "-src/libplatform",
"-include/libplatform" "-include/libplatform",
"+torque-generated"
] ]
specific_include_rules = { specific_include_rules = {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#ifndef V8_BUILTINS_BUILTINS_ARRAY_GEN_H_ #ifndef V8_BUILTINS_BUILTINS_ARRAY_GEN_H_
#define V8_BUILTINS_BUILTINS_ARRAY_GEN_H_ #define V8_BUILTINS_BUILTINS_ARRAY_GEN_H_
#include "./builtins-base-from-dsl-gen.h" #include "torque-generated/builtins-base-from-dsl-gen.h"
namespace v8 { namespace v8 {
namespace internal { namespace internal {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#define V8_BUILTINS_BUILTINS_DEFINITIONS_H_ #define V8_BUILTINS_BUILTINS_DEFINITIONS_H_
// include generated header // include generated header
#include "builtin-definitions-from-dsl.h" //NOLINT #include "torque-generated/builtin-definitions-from-dsl.h"
namespace v8 { namespace v8 {
namespace internal { namespace internal {
......
...@@ -23,13 +23,7 @@ group("v8_run_gcmole") { ...@@ -23,13 +23,7 @@ group("v8_run_gcmole") {
"../../testing/gtest/include/gtest/gtest_prod.h", "../../testing/gtest/include/gtest/gtest_prod.h",
"../../third_party/googletest/src/googletest/include/gtest/gtest_prod.h", "../../third_party/googletest/src/googletest/include/gtest/gtest_prod.h",
"../../third_party/icu/source/", "../../third_party/icu/source/",
"$target_gen_dir/../../builtin-definitions-from-dsl.h", "$target_gen_dir/../../torque-generated/",
"$target_gen_dir/../../builtins-array-from-dsl-gen.cc",
"$target_gen_dir/../../builtins-array-from-dsl-gen.h",
"$target_gen_dir/../../builtins-base-from-dsl-gen.cc",
"$target_gen_dir/../../builtins-base-from-dsl-gen.h",
"$target_gen_dir/../../builtins-typed-array-from-dsl-gen.cc",
"$target_gen_dir/../../builtins-typed-array-from-dsl-gen.h",
] ]
deps = [ deps = [
......
...@@ -18,7 +18,7 @@ BASE_PATH = os.path.dirname(os.path.dirname(GCMOLE_PATH)) ...@@ -18,7 +18,7 @@ BASE_PATH = os.path.dirname(os.path.dirname(GCMOLE_PATH))
assert len(sys.argv) == 2 assert len(sys.argv) == 2
if not os.path.isfile("out/Release/gen/builtin-definitions-from-dsl.h"): if not os.path.isfile("out/Release/gen/torque-generated/builtin-definitions-from-dsl.h"):
print "Expected generated headers in out/Release/gen." print "Expected generated headers in out/Release/gen."
print "Either build v8 in out/Release or change gcmole.lua:115" print "Either build v8 in out/Release or change gcmole.lua:115"
sys.exit(-1) sys.exit(-1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment