| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 import 'package:kernel/ast.dart' as ir; | 5 import 'package:kernel/ast.dart' as ir; |
| 6 | 6 |
| 7 import '../closure.dart'; | 7 import '../closure.dart'; |
| 8 import '../common.dart'; | 8 import '../common.dart'; |
| 9 import '../common/codegen.dart' show CodegenRegistry; | 9 import '../common/codegen.dart' show CodegenRegistry; |
| 10 import '../common/names.dart'; | 10 import '../common/names.dart'; |
| (...skipping 3342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3353 | 3353 |
| 3354 // The catch block has either the finally or the exit block as | 3354 // The catch block has either the finally or the exit block as |
| 3355 // successor. | 3355 // successor. |
| 3356 endCatchBlock?.addSuccessor( | 3356 endCatchBlock?.addSuccessor( |
| 3357 startFinallyBlock != null ? startFinallyBlock : exitBlock); | 3357 startFinallyBlock != null ? startFinallyBlock : exitBlock); |
| 3358 | 3358 |
| 3359 // The finally block has the exit block as successor. | 3359 // The finally block has the exit block as successor. |
| 3360 endFinallyBlock?.addSuccessor(exitBlock); | 3360 endFinallyBlock?.addSuccessor(exitBlock); |
| 3361 | 3361 |
| 3362 // If a block inside try/catch aborts (eg with a return statement), | 3362 // If a block inside try/catch aborts (eg with a return statement), |
| 3363 // we explicitely mark this block a predecessor of the catch | 3363 // we explicitly mark this block a predecessor of the catch |
| 3364 // block and the finally block. | 3364 // block and the finally block. |
| 3365 _addExitTrySuccessor(startCatchBlock); | 3365 _addExitTrySuccessor(startCatchBlock); |
| 3366 _addExitTrySuccessor(startFinallyBlock); | 3366 _addExitTrySuccessor(startFinallyBlock); |
| 3367 } | 3367 } |
| 3368 | 3368 |
| 3369 /// Build the finally{} clause of a try/{catch}/finally statement. Note this | 3369 /// Build the finally{} clause of a try/{catch}/finally statement. Note this |
| 3370 /// does not examine the body of the try clause, only the finally portion. | 3370 /// does not examine the body of the try clause, only the finally portion. |
| 3371 void buildFinallyBlock(void buildFinalizer()) { | 3371 void buildFinallyBlock(void buildFinalizer()) { |
| 3372 kernelBuilder.localsHandler = new LocalsHandler.from(originalSavedLocals); | 3372 kernelBuilder.localsHandler = new LocalsHandler.from(originalSavedLocals); |
| 3373 startFinallyBlock = kernelBuilder.graph.addNewBlock(); | 3373 startFinallyBlock = kernelBuilder.graph.addNewBlock(); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3487 enterBlock.setBlockFlow( | 3487 enterBlock.setBlockFlow( |
| 3488 new HTryBlockInformation( | 3488 new HTryBlockInformation( |
| 3489 kernelBuilder.wrapStatementGraph(bodyGraph), | 3489 kernelBuilder.wrapStatementGraph(bodyGraph), |
| 3490 exception, | 3490 exception, |
| 3491 kernelBuilder.wrapStatementGraph(catchGraph), | 3491 kernelBuilder.wrapStatementGraph(catchGraph), |
| 3492 kernelBuilder.wrapStatementGraph(finallyGraph)), | 3492 kernelBuilder.wrapStatementGraph(finallyGraph)), |
| 3493 exitBlock); | 3493 exitBlock); |
| 3494 kernelBuilder.inTryStatement = previouslyInTryStatement; | 3494 kernelBuilder.inTryStatement = previouslyInTryStatement; |
| 3495 } | 3495 } |
| 3496 } | 3496 } |
| OLD | NEW |