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

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
« no previous file with comments | « pkg/compiler/lib/src/kernel/kernel_visitor.dart ('k') | pkg/compiler/lib/src/ssa/builder_kernel.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ba2f2744c90f2b5c8be6837c3c84dc772250ad32..24feb366c80413be7ff0383931c210094625d0de 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);
@@ -1911,6 +1909,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(
@@ -5054,14 +5063,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) {
@@ -5986,7 +5987,7 @@ class SsaBuilder extends ast.Visitor
* [switchCases] must be either an [Iterable] of [ast.SwitchCase] nodes or
* a [Link] or a [ast.NodeList] of [ast.SwitchCase] nodes.
* [getConstants] returns the set of constants for a switch case.
- * [isDefaultCase] returns [:true:] if the provided switch case should be
+ * [isDefaultCase] returns true if the provided switch case should be
* considered default for the created switch statement.
* [buildSwitchCase] creates the statements for the switch case.
*/
« no previous file with comments | « pkg/compiler/lib/src/kernel/kernel_visitor.dart ('k') | pkg/compiler/lib/src/ssa/builder_kernel.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698