| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 class SsaCodeGeneratorTask extends CompilerTask { | 5 class SsaCodeGeneratorTask extends CompilerTask { |
| 6 final JavaScriptBackend backend; | 6 final JavaScriptBackend backend; |
| 7 SsaCodeGeneratorTask(JavaScriptBackend backend) | 7 SsaCodeGeneratorTask(JavaScriptBackend backend) |
| 8 : this.backend = backend, | 8 : this.backend = backend, |
| 9 super(backend.compiler); | 9 super(backend.compiler); |
| 10 String get name() => 'SSA code generator'; | 10 String get name() => 'SSA code generator'; |
| (...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1256 compiler.internalError('visitTry should not be called', instruction: node); | 1256 compiler.internalError('visitTry should not be called', instruction: node); |
| 1257 } | 1257 } |
| 1258 | 1258 |
| 1259 bool isEmptyElse(HBasicBlock start, HBasicBlock end) { | 1259 bool isEmptyElse(HBasicBlock start, HBasicBlock end) { |
| 1260 if (start !== end) return false; | 1260 if (start !== end) return false; |
| 1261 if (start.last is !HGoto | 1261 if (start.last is !HGoto |
| 1262 || start.last is HBreak | 1262 || start.last is HBreak |
| 1263 || start.last is HContinue) { | 1263 || start.last is HContinue) { |
| 1264 return false; | 1264 return false; |
| 1265 } | 1265 } |
| 1266 HInstruction instruction = start.first; | |
| 1267 for (HInstruction instruction = start.first; | 1266 for (HInstruction instruction = start.first; |
| 1268 instruction != start.last; | 1267 instruction != start.last; |
| 1269 instruction = instruction.next) { | 1268 instruction = instruction.next) { |
| 1270 // Instructions generated at use site are okay because they do | 1269 // Instructions generated at use site are okay because they do |
| 1271 // not generate code in this else block. | 1270 // not generate code in this else block. |
| 1272 if (!isGenerateAtUseSite(instruction)) return false; | 1271 if (!isGenerateAtUseSite(instruction)) return false; |
| 1273 } | 1272 } |
| 1274 CopyHandler handler = variableNames.getCopyHandler(start); | 1273 CopyHandler handler = variableNames.getCopyHandler(start); |
| 1275 if (handler == null || handler.isEmpty()) return true; | 1274 if (handler == null || handler.isEmpty()) return true; |
| 1276 if (!handler.assignments.isEmpty()) return false; | 1275 if (!handler.assignments.isEmpty()) return false; |
| (...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2505 startBailoutSwitch(); | 2504 startBailoutSwitch(); |
| 2506 } | 2505 } |
| 2507 } | 2506 } |
| 2508 | 2507 |
| 2509 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { | 2508 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { |
| 2510 if (labeledBlockInfo.body.start.hasGuards()) { | 2509 if (labeledBlockInfo.body.start.hasGuards()) { |
| 2511 endBailoutSwitch(); | 2510 endBailoutSwitch(); |
| 2512 } | 2511 } |
| 2513 } | 2512 } |
| 2514 } | 2513 } |
| OLD | NEW |