Index: BUILD.gn |
diff --git a/BUILD.gn b/BUILD.gn |
index ea2aae2c9918b2dceed7e5403aece6a3c1d71b90..fdefc52d4a358f840dd415d429de8439ee0e81bd 100644 |
--- a/BUILD.gn |
+++ b/BUILD.gn |
@@ -86,6 +86,7 @@ if (v8_enable_gdbjit == "") { |
} |
} |
+v8_generated_peephole_source = "$target_gen_dir/bytecode-peephole-table.cc" |
v8_random_seed = "314159265" |
v8_toolset_for_shell = "host" |
@@ -649,6 +650,25 @@ action("run_mksnapshot") { |
} |
} |
+action("run_mkpeephole") { |
+ visibility = [ ":*" ] # Only targets in this file can depend on this. |
+ |
+ deps = [ ":mkpeephole($v8_snapshot_toolchain)" ] |
+ |
+ outputs = [ v8_generated_peephole_source ] |
+ |
+ sources = [] |
+ |
+ script = "tools/run.py" |
+ |
+ args = [ |
+ "./" + rebase_path(get_label_info(":mkpeephole($v8_snapshot_toolchain)", |
+ "root_out_dir") + "/mkpeephole", |
+ root_build_dir), |
+ rebase_path(v8_generated_peephole_source, root_build_dir), |
+ ] |
+} |
+ |
action("v8_dump_build_config") { |
script = "tools/testrunner/utils/dump_build_config.py" |
outputs = [ |
@@ -1315,6 +1335,7 @@ v8_source_set("v8_base") { |
"src/interpreter/bytecode-label.h", |
"src/interpreter/bytecode-peephole-optimizer.cc", |
"src/interpreter/bytecode-peephole-optimizer.h", |
+ "src/interpreter/bytecode-peephole-table.h", |
"src/interpreter/bytecode-pipeline.cc", |
"src/interpreter/bytecode-pipeline.h", |
"src/interpreter/bytecode-register-allocator.cc", |
@@ -1913,6 +1934,9 @@ v8_source_set("v8_base") { |
":v8_libsampler", |
] |
+ sources += [ v8_generated_peephole_source ] |
+ deps += [ ":run_mkpeephole" ] |
+ |
if (is_win) { |
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
cflags = [ "/wd4267" ] |
@@ -2136,6 +2160,31 @@ if (current_toolchain == v8_snapshot_toolchain) { |
} |
} |
+v8_executable("mkpeephole") { |
+ # mkpeephole needs to be built for the build host so the peephole lookup |
+ # table can built during build. The table depends on the properties of |
+ # bytecodes that are described in bytecodes.{cc,h}. |
+ visibility = [ ":*" ] # Only targets in this file can depend on this. |
+ |
+ sources = [ |
+ "src/interpreter/bytecode-peephole-optimizer.h", |
+ "src/interpreter/bytecodes.cc", |
+ "src/interpreter/bytecodes.h", |
+ "src/interpreter/mkpeephole.cc", |
+ ] |
+ |
+ configs = [ |
+ ":external_config", |
+ ":internal_config", |
+ ] |
+ |
+ deps = [ |
+ ":v8_libbase", |
+ "//build/config/sanitizers:deps", |
+ "//build/win:default_exe_manifest", |
+ ] |
+} |
+ |
############################################################################### |
# Public targets |
# |