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

Unified Diff: frog/leg/ssa/optimize.dart

Issue 9421035: Support break and labeled statements. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments. Update expectations. Created 8 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 | « frog/leg/ssa/nodes.dart ('k') | frog/leg/ssa/tracer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/ssa/optimize.dart
diff --git a/frog/leg/ssa/optimize.dart b/frog/leg/ssa/optimize.dart
index ecc6815a488cc133ef7157c18bec858104702108..786cc178750d0ae520bbeb10726e26ac21bc6fc5 100644
--- a/frog/leg/ssa/optimize.dart
+++ b/frog/leg/ssa/optimize.dart
@@ -295,12 +295,19 @@ class SsaDeadPhiEliminator {
}
// Remove phis that are not live.
- for (final block in graph.blocks) {
+ // Traverse in reverse order to remove phis with no uses before the
+ // phis that they might use.
+ // TODO(lrn): Handle cyclic usages.
+ List<HBasicBlock> blocks = graph.blocks;
+ for (int i = blocks.length - 1; i >= 0; i--) {
+ HBasicBlock block = blocks[i];
HPhi current = block.phis.first;
HPhi next = null;
while (current != null) {
next = current.next;
- if (!livePhis.contains(current)) block.removePhi(current);
+ if (!livePhis.contains(current)) {
+ current.block.removePhi(current);
+ }
current = next;
}
}
« no previous file with comments | « frog/leg/ssa/nodes.dart ('k') | frog/leg/ssa/tracer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698