Index: BUILD.gn |
diff --git a/BUILD.gn b/BUILD.gn |
index 24f339044f155f7760e3482fa22cf13a4c889fbf..245c63a49dfb58779441c56284724beb8cc697e1 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 = [ |
@@ -1311,6 +1331,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", |
@@ -1909,6 +1930,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" ] |
@@ -2132,6 +2156,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 |
# |