| Index: pkg/compiler/lib/src/ssa/graph_builder.dart
|
| diff --git a/pkg/compiler/lib/src/ssa/graph_builder.dart b/pkg/compiler/lib/src/ssa/graph_builder.dart
|
| index 8948546d14300a70abb9800e664b38ee9c95967b..57ae855691ac0211357ea9cd1b33fce465c2d3d3 100644
|
| --- a/pkg/compiler/lib/src/ssa/graph_builder.dart
|
| +++ b/pkg/compiler/lib/src/ssa/graph_builder.dart
|
| @@ -35,6 +35,11 @@ abstract class GraphBuilder {
|
| /// A reference to the compiler.
|
| Compiler compiler;
|
|
|
| + /// True if the builder is processing nodes inside a try statement. This is
|
| + /// important for generating control flow out of a try block like returns or
|
| + /// breaks.
|
| + bool inTryStatement = false;
|
| +
|
| /// The JavaScript backend we are targeting in this compilation.
|
| JavaScriptBackend get backend;
|
|
|
| @@ -180,17 +185,6 @@ abstract class GraphBuilder {
|
| return result;
|
| }
|
|
|
| - 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);
|
| - }
|
| -
|
| HSubGraphBlockInformation wrapStatementGraph(SubGraph statements) {
|
| if (statements == null) return null;
|
| return new HSubGraphBlockInformation(statements);
|
| @@ -237,6 +231,16 @@ abstract class GraphBuilder {
|
| return callSetRuntimeTypeInfo(typeInfo, newObject);
|
| }
|
|
|
| + /// Called when control flow is about to change, in which case we need to
|
| + /// specify special successors if we are already in a try/catch/finally block.
|
| + void handleInTryStatement() {
|
| + if (!inTryStatement) return;
|
| + HBasicBlock block = close(new HExitTry());
|
| + HBasicBlock newBlock = graph.addNewBlock();
|
| + block.addSuccessor(newBlock);
|
| + open(newBlock);
|
| + }
|
| +
|
| HInstruction callSetRuntimeTypeInfo(
|
| HInstruction typeInfo, HInstruction newObject);
|
|
|
|
|