| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library dart2js.cps_ir.loop_hierarchy; | 5 library dart2js.cps_ir.loop_hierarchy; |
| 6 | 6 |
| 7 import 'cps_fragment.dart'; |
| 7 import 'cps_ir_nodes.dart'; | 8 import 'cps_ir_nodes.dart'; |
| 8 import 'cps_fragment.dart'; | |
| 9 | 9 |
| 10 /// Determines the effective nesting of loops. | 10 /// Determines the effective nesting of loops. |
| 11 /// | 11 /// |
| 12 /// The effective nesting of loops is different from the lexical nesting, since | 12 /// The effective nesting of loops is different from the lexical nesting, since |
| 13 /// recursive continuations can generally contain all the code following | 13 /// recursive continuations can generally contain all the code following |
| 14 /// after the loop in addition to the looping code itself. | 14 /// after the loop in addition to the looping code itself. |
| 15 /// | 15 /// |
| 16 /// For example, the 'else' branch below is not effectively part of the loop: | 16 /// For example, the 'else' branch below is not effectively part of the loop: |
| 17 /// | 17 /// |
| 18 /// let rec kont x = | 18 /// let rec kont x = |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 /// surrounding the inserted fragment. | 166 /// surrounding the inserted fragment. |
| 167 void update(CpsFragment fragment, | 167 void update(CpsFragment fragment, |
| 168 {Continuation exitLoop, Continuation catchLoop}) { | 168 {Continuation exitLoop, Continuation catchLoop}) { |
| 169 if (fragment.isEmpty) return; | 169 if (fragment.isEmpty) return; |
| 170 _exitLoop = exitLoop; | 170 _exitLoop = exitLoop; |
| 171 _currentDepth = getDepth(exitLoop); | 171 _currentDepth = getDepth(exitLoop); |
| 172 _processBlock(fragment.root, catchLoop); | 172 _processBlock(fragment.root, catchLoop); |
| 173 _exitLoop = null; | 173 _exitLoop = null; |
| 174 } | 174 } |
| 175 } | 175 } |
| OLD | NEW |