| 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 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1394 int kind = EMPTY; | 1394 int kind = EMPTY; |
| 1395 bool updateKind(int newKind) { | 1395 bool updateKind(int newKind) { |
| 1396 if (kind != EMPTY) return false; | 1396 if (kind != EMPTY) return false; |
| 1397 kind = newKind; | 1397 kind = newKind; |
| 1398 return true; | 1398 return true; |
| 1399 } | 1399 } |
| 1400 | 1400 |
| 1401 for (HInstruction instruction = start.first; | 1401 for (HInstruction instruction = start.first; |
| 1402 instruction != start.last; | 1402 instruction != start.last; |
| 1403 instruction = instruction.next) { | 1403 instruction = instruction.next) { |
| 1404 if (instruction.isStatement()) { | 1404 if (instruction.isStatement) { |
| 1405 if (!updateKind(ONE_STATEMENT)) return MULTIPLE_STATEMENTS; | 1405 if (!updateKind(ONE_STATEMENT)) return MULTIPLE_STATEMENTS; |
| 1406 } else if (!isGenerateAtUseSite(instruction)) { | 1406 } else if (!isGenerateAtUseSite(instruction)) { |
| 1407 if (!updateKind(ONE_EXPRESSION)) return MULTIPLE_STATEMENTS; | 1407 if (!updateKind(ONE_EXPRESSION)) return MULTIPLE_STATEMENTS; |
| 1408 } | 1408 } |
| 1409 } | 1409 } |
| 1410 | 1410 |
| 1411 HInstruction last = start.last; | 1411 HInstruction last = start.last; |
| 1412 if (last is !HGoto) { | 1412 if (last is !HGoto) { |
| 1413 if (!updateKind(last.isStatement() ? ONE_STATEMENT : ONE_EXPRESSION)) { | 1413 if (!updateKind(last.isStatement ? ONE_STATEMENT : ONE_EXPRESSION)) { |
| 1414 return MULTIPLE_STATEMENTS; | 1414 return MULTIPLE_STATEMENTS; |
| 1415 } | 1415 } |
| 1416 } | 1416 } |
| 1417 | 1417 |
| 1418 CopyHandler handler = variableNames.getCopyHandler(start); | 1418 CopyHandler handler = variableNames.getCopyHandler(start); |
| 1419 if (handler !== null && !handler.isEmpty()) { | 1419 if (handler !== null && !handler.isEmpty()) { |
| 1420 if (handler.assignments.length > 1) return MULTIPLE_STATEMENTS; | 1420 if (handler.assignments.length > 1) return MULTIPLE_STATEMENTS; |
| 1421 if (handler.assignments.length == 1) { | 1421 if (handler.assignments.length == 1) { |
| 1422 if (!updateKind(ONE_STATEMENT)) return MULTIPLE_STATEMENTS; | 1422 if (!updateKind(ONE_STATEMENT)) return MULTIPLE_STATEMENTS; |
| 1423 } | 1423 } |
| (...skipping 1648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3072 startBailoutSwitch(); | 3072 startBailoutSwitch(); |
| 3073 } | 3073 } |
| 3074 } | 3074 } |
| 3075 | 3075 |
| 3076 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { | 3076 void endLabeledBlock(HLabeledBlockInformation labeledBlockInfo) { |
| 3077 if (labeledBlockInfo.body.start.hasGuards()) { | 3077 if (labeledBlockInfo.body.start.hasGuards()) { |
| 3078 endBailoutSwitch(); | 3078 endBailoutSwitch(); |
| 3079 } | 3079 } |
| 3080 } | 3080 } |
| 3081 } | 3081 } |
| OLD | NEW |