Chromium Code Reviews| 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..59676b2cd9f667dfd8d2bcea41a750b61a4e509c 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 unexpected control flow analysis (returns, breaks, etc |
|
sra1
2017/01/14 03:18:22
I would not call it 'unexpected'.
Perhaps say 'Use
Emily Fortuna
2017/01/17 23:33:09
Good point. Updated.
|
| + /// outside of a try block). |
| + 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); |