| 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/elements.dart'; | 6 import '../elements/elements.dart'; |
| 7 import '../tree/tree.dart' as ast; | 7 import '../tree/tree.dart' as ast; |
| 8 | 8 |
| 9 import 'builder.dart'; | 9 import 'builder.dart'; |
| 10 import 'graph_builder.dart'; | 10 import 'graph_builder.dart'; |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 void generateContinue([LabelDefinition label]) { | 204 void generateContinue([LabelDefinition label]) { |
| 205 if (isContinueToSwitchCase(label)) { | 205 if (isContinueToSwitchCase(label)) { |
| 206 // Creates the special instructions 'label = i; continue l;' used in | 206 // Creates the special instructions 'label = i; continue l;' used in |
| 207 // switch statements with continue statements. See | 207 // switch statements with continue statements. See |
| 208 // [SsaFromAstMixin.buildComplexSwitchStatement] for detail. | 208 // [SsaFromAstMixin.buildComplexSwitchStatement] for detail. |
| 209 | 209 |
| 210 assert(label != null); | 210 assert(label != null); |
| 211 // TODO(het): change the graph 'addConstantXXX' to take a ConstantSystem | 211 // TODO(het): change the graph 'addConstantXXX' to take a ConstantSystem |
| 212 // instead of a Compiler. | 212 // instead of a Compiler. |
| 213 HInstruction value = builder.graph | 213 HInstruction value = builder.graph |
| 214 .addConstantInt(targetIndexMap[label.target], builder.compiler); | 214 .addConstantInt(targetIndexMap[label.target], builder.closedWorld); |
| 215 builder.localsHandler.updateLocal(target, value); | 215 builder.localsHandler.updateLocal(target, value); |
| 216 | 216 |
| 217 assert(label.target.labels.contains(label)); | 217 assert(label.target.labels.contains(label)); |
| 218 HInstruction continueInstruction = new HContinue(target); | 218 HInstruction continueInstruction = new HContinue(target); |
| 219 LocalsHandler locals = new LocalsHandler.from(builder.localsHandler); | 219 LocalsHandler locals = new LocalsHandler.from(builder.localsHandler); |
| 220 builder.close(continueInstruction); | 220 builder.close(continueInstruction); |
| 221 jumps.add(new JumpHandlerEntry(continueInstruction, locals)); | 221 jumps.add(new JumpHandlerEntry(continueInstruction, locals)); |
| 222 } else { | 222 } else { |
| 223 super.generateContinue(label); | 223 super.generateContinue(label); |
| 224 } | 224 } |
| 225 } | 225 } |
| 226 | 226 |
| 227 void close() { | 227 void close() { |
| 228 // The mapping from TargetElement to JumpHandler is no longer needed. | 228 // The mapping from TargetElement to JumpHandler is no longer needed. |
| 229 for (JumpTarget target in targetIndexMap.keys) { | 229 for (JumpTarget target in targetIndexMap.keys) { |
| 230 builder.jumpTargets.remove(target); | 230 builder.jumpTargets.remove(target); |
| 231 } | 231 } |
| 232 super.close(); | 232 super.close(); |
| 233 } | 233 } |
| 234 } | 234 } |
| OLD | NEW |