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

Unified Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 2637483002: Implement switch statement, without the "complex switch statement" (aka switch statement with conti… (Closed)
Patch Set: . Created 3 years, 11 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: pkg/compiler/lib/src/ssa/builder.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index 7cf54fcae9474145a3e946a4463e4404f7c00a54..b08b3186bc789f1c946a002814dc8a2dda4dd73b 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -668,8 +668,6 @@ class SsaBuilder extends ast.Visitor
Local returnLocal;
ResolutionDartType returnType;
- bool inTryStatement = false;
-
ConstantValue getConstantForNode(ast.Node node) {
ConstantValue constantValue =
backend.constants.getConstantValueForNode(node, elements);
@@ -1910,6 +1908,17 @@ class SsaBuilder extends ast.Visitor
}
}
+ void handleIf(
+ {ast.Node node,
+ void visitCondition(),
+ void visitThen(),
+ void visitElse(),
+ SourceInformation sourceInformation}) {
+ SsaBranchBuilder branchBuilder = new SsaBranchBuilder(this, compiler, node);
+ branchBuilder.handleIf(visitCondition, visitThen, visitElse,
+ sourceInformation: sourceInformation);
+ }
+
visitIf(ast.If node) {
assert(isReachable);
handleIf(
@@ -5053,14 +5062,6 @@ class SsaBuilder extends ast.Visitor
dup();
}
- void handleInTryStatement() {
- if (!inTryStatement) return;
- HBasicBlock block = close(new HExitTry());
- HBasicBlock newBlock = graph.addNewBlock();
- block.addSuccessor(newBlock);
- open(newBlock);
- }
-
visitRethrow(ast.Rethrow node) {
HInstruction exception = rethrowableException;
if (exception == null) {

Powered by Google App Engine
This is Rietveld 408576698