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

Unified Diff: runtime/vm/flow_graph_type_propagator.cc

Issue 12317007: Remove two more places where we computed use lists and add verification. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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_inliner.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_type_propagator.cc
diff --git a/runtime/vm/flow_graph_type_propagator.cc b/runtime/vm/flow_graph_type_propagator.cc
index 595a94e785322b192848918fdf7c41182e245b26..d16e382f1076a0752d7af6b197d037f75583a2be 100644
--- a/runtime/vm/flow_graph_type_propagator.cc
+++ b/runtime/vm/flow_graph_type_propagator.cc
@@ -6,6 +6,7 @@
#include "vm/cha.h"
#include "vm/bit_vector.h"
+#include "vm/il_printer.h"
namespace dart {
@@ -28,19 +29,26 @@ FlowGraphTypePropagator::FlowGraphTypePropagator(FlowGraph* flow_graph)
void FlowGraphTypePropagator::Propagate() {
- // Walk dominator tree and propagate reaching types to all Values.
- // Collect all phis for a fix point iteration.
+ if (FLAG_trace_type_propagation) {
+ OS::Print("Before type propagation:\n");
+ FlowGraphPrinter printer(*flow_graph_);
+ printer.PrintBlocks();
+ }
+
+ // Walk the dominator tree and propagate reaching types to all Values.
+ // Collect all phis for a fixed point iteration.
PropagateRecursive(flow_graph_->graph_entry());
#ifdef DEBUG
- // Initially work-list contains only phis.
+ // Initially the worklist contains only phis.
for (intptr_t i = 0; i < worklist_.length(); i++) {
ASSERT(worklist_[i]->IsPhi());
ASSERT(worklist_[i]->Type()->IsNone());
}
#endif
- // Iterate until fix point is reached updating types of definitions.
+ // Iterate until a fixed point is reached, updating the types of
+ // definitions.
while (!worklist_.is_empty()) {
Definition* def = RemoveLastFromWorklist();
if (FLAG_trace_type_propagation) {
@@ -62,6 +70,12 @@ void FlowGraphTypePropagator::Propagate() {
}
}
}
+
+ if (FLAG_trace_type_propagation) {
+ OS::Print("After type propagation:\n");
+ FlowGraphPrinter printer(*flow_graph_);
+ printer.PrintBlocks();
+ }
}
« no previous file with comments | « runtime/vm/flow_graph_inliner.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698