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

Unified Diff: runtime/vm/il_printer.cc

Issue 12540002: Implement a branch optimization pass. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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
Index: runtime/vm/il_printer.cc
diff --git a/runtime/vm/il_printer.cc b/runtime/vm/il_printer.cc
index d938145143ecc1d6ba87c6e85252de074894a778..2c921d6549fc66b3eda15e9c348828cf0b3b018e 100644
--- a/runtime/vm/il_printer.cc
+++ b/runtime/vm/il_printer.cc
@@ -40,28 +40,27 @@ void FlowGraphPrinter::PrintGraph(const char* phase, FlowGraph* flow_graph) {
}
+void FlowGraphPrinter::PrintBlock(BlockEntryInstr* block,
+ bool print_locations) {
+ // Print the block entry.
+ PrintOneInstruction(block, print_locations);
+ OS::Print("\n");
+ // And all the successors in the block.
+ for (ForwardInstructionIterator it(block); !it.Done(); it.Advance()) {
+ Instruction* current = it.Current();
+ PrintOneInstruction(current, print_locations);
+ OS::Print("\n");
+ }
+}
+
+
void FlowGraphPrinter::PrintBlocks() {
if (!function_.IsNull()) {
OS::Print("==== %s\n", function_.ToFullyQualifiedCString());
}
for (intptr_t i = 0; i < block_order_.length(); ++i) {
- // Print the block entry.
- PrintInstruction(block_order_[i]);
- // And all the successors until an exit, branch, or a block entry.
- Instruction* current = block_order_[i];
- for (ForwardInstructionIterator it(current->AsBlockEntry());
- !it.Done();
- it.Advance()) {
- current = it.Current();
- OS::Print("\n");
- PrintInstruction(current);
- }
- if (current->next() != NULL) {
- ASSERT(current->next()->IsBlockEntry());
- OS::Print(" goto %"Pd"", current->next()->AsBlockEntry()->block_id());
- }
- OS::Print("\n");
+ PrintBlock(block_order_[i], print_locations_);
}
}

Powered by Google App Engine
This is Rietveld 408576698