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

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

Issue 8513004: Throw and a small fix to If. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Change diff-base Created 9 years, 1 month 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 | frog/leg/ssa/codegen.dart » ('j') | frog/leg/ssa/codegen.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/ssa/builder.dart
diff --git a/frog/leg/ssa/builder.dart b/frog/leg/ssa/builder.dart
index 94f33fbbc10e8cd22fa81aa79829d2075c28ecd3..6c9c70b8b8515cd1a8c792cd576c8aded90a0108 100644
--- a/frog/leg/ssa/builder.dart
+++ b/frog/leg/ssa/builder.dart
@@ -220,7 +220,7 @@ class SsaBuilder implements Visitor {
joinDefinitions(joinBlock, thenDefinitions, elseDefinitions);
} else if (thenBlockJoined) {
thenExitBlock.addGoto(graph, joinBlock);
- } else if (elseBlockJoined) {
+ } else if (elseBlockJoined && hasElse) {
elseExitBlock.addGoto(graph, joinBlock);
}
}
@@ -325,7 +325,10 @@ class SsaBuilder implements Visitor {
}
visitThrow(Throw node) {
- compiler.unimplemented("SsaBuilder.visitThrow");
+ visit(node.expression);
ngeoffray 2011/11/10 13:22:37 Note that expression may be null.
floitsch 2011/11/10 14:02:22 Done.
+ add(new HThrow(pop()));
+ // A throw aborts the building of the current block.
+ block = null;
}
visitTypeAnnotation(TypeAnnotation node) {
« no previous file with comments | « no previous file | frog/leg/ssa/codegen.dart » ('j') | frog/leg/ssa/codegen.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698