OLD | NEW |
1 library dart2js.cps_ir.loop_effects; | 1 library dart2js.cps_ir.loop_effects; |
2 | 2 |
3 import 'cps_ir_nodes.dart'; | 3 import 'cps_ir_nodes.dart'; |
4 import 'loop_hierarchy.dart'; | 4 import 'loop_hierarchy.dart'; |
5 import '../world.dart'; | 5 import '../world.dart'; |
6 import 'effects.dart'; | 6 import 'effects.dart'; |
7 | 7 |
8 /// Determines the side effects that may occur in each loop. | 8 /// Determines the side effects that may occur in each loop. |
9 class LoopSideEffects extends TrampolineRecursiveVisitor { | 9 class LoopSideEffects extends TrampolineRecursiveVisitor { |
10 LoopHierarchy loopHierarchy; | 10 LoopHierarchy loopHierarchy; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 push(cont); | 78 push(cont); |
79 } else { | 79 } else { |
80 // Multiple loops can be exited at once. | 80 // Multiple loops can be exited at once. |
81 // Register as an exit from the outermost loop being exited. | 81 // Register as an exit from the outermost loop being exited. |
82 Continuation inner = currentLoopHeader; | 82 Continuation inner = currentLoopHeader; |
83 Continuation outer = loopHierarchy.getEnclosingLoop(currentLoopHeader); | 83 Continuation outer = loopHierarchy.getEnclosingLoop(currentLoopHeader); |
84 while (outer != loop) { | 84 while (outer != loop) { |
85 if (inner == null) { | 85 if (inner == null) { |
86 // The shrinking reductions pass must run before any pass that relies | 86 // The shrinking reductions pass must run before any pass that relies |
87 // on computing loop side effects. | 87 // on computing loop side effects. |
88 world.compiler.reporter.internalError(null, | 88 world.compiler.reporter.internalError( |
| 89 null, |
89 'Unreachable continuations must be removed before computing ' | 90 'Unreachable continuations must be removed before computing ' |
90 'loop side effects.'); | 91 'loop side effects.'); |
91 } | 92 } |
92 inner = outer; | 93 inner = outer; |
93 outer = loopHierarchy.getEnclosingLoop(outer); | 94 outer = loopHierarchy.getEnclosingLoop(outer); |
94 } | 95 } |
95 exitContinuations[inner].add(cont); | 96 exitContinuations[inner].add(cont); |
96 } | 97 } |
97 } | 98 } |
98 } | 99 } |
OLD | NEW |