Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Unified Diff: runtime/bin/BUILD.gn

Issue 2901163002: Use assembly instead of C array literals to link the core snapshot into the VM. (Closed)
Patch Set: . Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/bin/main.cc » ('j') | runtime/bin/main.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/BUILD.gn
diff --git a/runtime/bin/BUILD.gn b/runtime/bin/BUILD.gn
index cde7664bd959f2fb159d3f1421e6a6371bff1fbc..d695f1ad91431376e7af3b1857fbdededcf73913 100644
--- a/runtime/bin/BUILD.gn
+++ b/runtime/bin/BUILD.gn
@@ -489,43 +489,81 @@ action("generate_snapshot_bin") {
]
}
-action("generate_snapshot_file") {
+template("bin_to_assembly") {
zra 2017/05/24 16:20:24 Please add comment describing what this does, and
rmacnak 2017/05/24 19:26:45 Done.
+ action(target_name) {
+ deps = invoker.deps
zra 2017/05/24 16:20:24 Assert that this is defined.
+ script = "../tools/bin_to_assembly.py"
+ args = [
+ "--input",
+ rebase_path(invoker.input),
zra 2017/05/24 16:20:24 ditto
+ "--output",
+ rebase_path(invoker.output),
zra 2017/05/24 16:20:24 ditto
+ "--symbol_name",
+ invoker.symbol,
zra 2017/05/24 16:20:24 ditto
+ "--target_os",
+ target_os,
+ ]
+ if (invoker.executable) {
zra 2017/05/24 16:20:24 ditto
+ args += [ "--executable" ]
+ }
+ inputs = [
+ script,
+ invoker.input,
+ ]
+ outputs = [
+ invoker.output,
+ ]
+ }
+}
+
+bin_to_assembly("vm_snapshot_data_assembly") {
deps = [
":generate_snapshot_bin",
]
+ input = "$target_gen_dir/vm_isolate_snapshot.bin"
+ output = "$target_gen_dir/vm_snapshot_data.S"
+ symbol = "kDartVmSnapshotData"
+ executable = false
+}
- snapshot_in_cc_file = "snapshot_in.cc"
- inputs = [
- "../tools/create_snapshot_file.py",
- snapshot_in_cc_file,
- "$target_gen_dir/vm_isolate_snapshot.bin",
- "$target_gen_dir/isolate_snapshot.bin",
- ]
- output = "$root_gen_dir/dart_snapshot.cc"
- outputs = [
- output,
- ]
+bin_to_assembly("vm_snapshot_instructions_assembly") {
+ deps = []
+ input = "../tools/empty.bin"
+ output = "$target_gen_dir/vm_snapshot_instructions.S"
+ symbol = "kDartVmSnapshotInstructions"
+ executable = true
+}
- script = "../tools/create_snapshot_file.py"
- args = [
- "--vm_input_bin",
- rebase_path("$target_gen_dir/vm_isolate_snapshot.bin"),
- "--input_bin",
- rebase_path("$target_gen_dir/isolate_snapshot.bin"),
- "--input_cc",
- rebase_path(snapshot_in_cc_file),
- "--output",
- rebase_path(output),
+bin_to_assembly("isolate_snapshot_data_assembly") {
+ deps = [
+ ":generate_snapshot_bin",
]
+ input = "$target_gen_dir/isolate_snapshot.bin"
+ output = "$target_gen_dir/isolate_snapshot_data.S"
+ symbol = "kDartCoreIsolateSnapshotData"
+ executable = false
}
-source_set("dart_snapshot_cc") {
- sources = [
- "$root_gen_dir/dart_snapshot.cc",
- ]
+bin_to_assembly("isolate_snapshot_instructions_assembly") {
+ deps = []
+ input = "../tools/empty.bin"
+ output = "$target_gen_dir/isolate_snapshot_instructions.S"
+ symbol = "kDartCoreIsolateSnapshotInstructions"
+ executable = true
+}
+source_set("dart_snapshot_cc") {
deps = [
- ":generate_snapshot_file",
+ ":isolate_snapshot_data_assembly",
+ ":isolate_snapshot_instructions_assembly",
+ ":vm_snapshot_data_assembly",
+ ":vm_snapshot_instructions_assembly",
+ ]
+ sources = [
+ "$target_gen_dir/isolate_snapshot_data.S",
+ "$target_gen_dir/isolate_snapshot_instructions.S",
+ "$target_gen_dir/vm_snapshot_data.S",
+ "$target_gen_dir/vm_snapshot_instructions.S",
]
}
« no previous file with comments | « no previous file | runtime/bin/main.cc » ('j') | runtime/bin/main.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698