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

Unified Diff: runtime/vm/flow_graph.cc

Issue 17283006: Fix a small bug in trace printing for discovered loops. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 | « runtime/vm/flow_graph.h ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph.cc
diff --git a/runtime/vm/flow_graph.cc b/runtime/vm/flow_graph.cc
index 5963f70331a16b0ea959a91307d8a8e7fe0ec88e..1003af0679a7307a7de6fa21451cc7ff5a4a2d3c 100644
--- a/runtime/vm/flow_graph.cc
+++ b/runtime/vm/flow_graph.cc
@@ -955,11 +955,9 @@ void FlowGraph::RemoveRedefinitions() {
// Find the natural loop for the back edge m->n and attach loop information
// to block n (loop header). The algorithm is described in "Advanced Compiler
// Design & Implementation" (Muchnick) p192.
-static void FindLoop(BlockEntryInstr* m,
- BlockEntryInstr* n,
- intptr_t num_blocks) {
+void FlowGraph::FindLoop(BlockEntryInstr* m, BlockEntryInstr* n) {
GrowableArray<BlockEntryInstr*> stack;
- BitVector* loop = new BitVector(num_blocks);
+ BitVector* loop = new BitVector(preorder_.length());
loop->Add(n->preorder_number());
if (n != m) {
@@ -980,7 +978,7 @@ static void FindLoop(BlockEntryInstr* m,
n->set_loop_info(loop);
if (FLAG_trace_optimization) {
for (BitVector::Iterator it(loop); !it.Done(); it.Advance()) {
- OS::Print(" B%"Pd"\n", it.Current());
+ OS::Print(" B%"Pd"\n", preorder_[it.Current()]->block_id());
}
}
}
@@ -1001,7 +999,7 @@ ZoneGrowableArray<BlockEntryInstr*>* FlowGraph::ComputeLoops() {
OS::Print("Back edge B%"Pd" -> B%"Pd"\n", pred->block_id(),
block->block_id());
}
- FindLoop(pred, block, preorder_.length());
+ FindLoop(pred, block);
loop_headers->Add(block);
}
}
« no previous file with comments | « runtime/vm/flow_graph.h ('k') | runtime/vm/flow_graph_optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698