| 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 '../common.dart'; | 5 import '../common.dart'; |
| 6 import '../elements/jumps.dart'; | 6 import '../elements/jumps.dart'; |
| 7 import '../tree/tree.dart' as ast; | 7 import '../tree/tree.dart' as ast; |
| 8 | 8 |
| 9 import 'graph_builder.dart'; | 9 import 'graph_builder.dart'; |
| 10 import 'locals_handler.dart'; | 10 import 'locals_handler.dart'; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 } | 92 } |
| 93 | 93 |
| 94 void generateContinue([LabelDefinition label]) { | 94 void generateContinue([LabelDefinition label]) { |
| 95 HInstruction continueInstruction; | 95 HInstruction continueInstruction; |
| 96 if (label == null) { | 96 if (label == null) { |
| 97 continueInstruction = new HContinue(target); | 97 continueInstruction = new HContinue(target); |
| 98 } else { | 98 } else { |
| 99 continueInstruction = new HContinue.toLabel(label); | 99 continueInstruction = new HContinue.toLabel(label); |
| 100 // Switch case continue statements must be handled by the | 100 // Switch case continue statements must be handled by the |
| 101 // [SwitchCaseJumpHandler]. | 101 // [SwitchCaseJumpHandler]. |
| 102 assert(label.target.statement is! ast.SwitchCase); | 102 assert(!label.target.isSwitchCase); |
| 103 } | 103 } |
| 104 LocalsHandler locals = new LocalsHandler.from(builder.localsHandler); | 104 LocalsHandler locals = new LocalsHandler.from(builder.localsHandler); |
| 105 builder.close(continueInstruction); | 105 builder.close(continueInstruction); |
| 106 jumps.add(new _JumpHandlerEntry(continueInstruction, locals)); | 106 jumps.add(new _JumpHandlerEntry(continueInstruction, locals)); |
| 107 } | 107 } |
| 108 | 108 |
| 109 void forEachBreak(Function action) { | 109 void forEachBreak(Function action) { |
| 110 for (_JumpHandlerEntry entry in jumps) { | 110 for (_JumpHandlerEntry entry in jumps) { |
| 111 if (entry.isBreak()) action(entry.jumpInstruction, entry.locals); | 111 if (entry.isBreak()) action(entry.jumpInstruction, entry.locals); |
| 112 } | 112 } |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 targetIndexMap[continueTarget] = switchIndex; | 231 targetIndexMap[continueTarget] = switchIndex; |
| 232 assert(builder.jumpTargets[continueTarget] == null); | 232 assert(builder.jumpTargets[continueTarget] == null); |
| 233 builder.jumpTargets[continueTarget] = this; | 233 builder.jumpTargets[continueTarget] = this; |
| 234 } | 234 } |
| 235 } | 235 } |
| 236 } | 236 } |
| 237 switchIndex++; | 237 switchIndex++; |
| 238 } | 238 } |
| 239 } | 239 } |
| 240 } | 240 } |
| OLD | NEW |