| 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 part of ssa; | 5 part of ssa; |
| 6 | 6 |
| 7 class SsaCodeGeneratorTask extends CompilerTask { | 7 class SsaCodeGeneratorTask extends CompilerTask { |
| 8 | 8 |
| 9 final JavaScriptBackend backend; | 9 final JavaScriptBackend backend; |
| 10 | 10 |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 if (isGeneratingExpression) { | 623 if (isGeneratingExpression) { |
| 624 visitExpression(instruction); | 624 visitExpression(instruction); |
| 625 } else { | 625 } else { |
| 626 visitStatement(instruction); | 626 visitStatement(instruction); |
| 627 } | 627 } |
| 628 } | 628 } |
| 629 | 629 |
| 630 void use(HInstruction argument) { | 630 void use(HInstruction argument) { |
| 631 if (isGenerateAtUseSite(argument)) { | 631 if (isGenerateAtUseSite(argument)) { |
| 632 visitExpression(argument); | 632 visitExpression(argument); |
| 633 } else if (argument is HCheck && argument.isControlFlow()) { | 633 } else if (argument is HCheck && !variableNames.hasName(argument)) { |
| 634 // A [HCheck] that has control flow can never be used as an | |
| 635 // expression and may not have a name. Therefore we just use the | |
| 636 // checked instruction. | |
| 637 HCheck check = argument; | 634 HCheck check = argument; |
| 638 use(check.checkedInput); | 635 use(check.checkedInput); |
| 639 } else { | 636 } else { |
| 640 push(new js.VariableUse(variableNames.getName(argument))); | 637 push(new js.VariableUse(variableNames.getName(argument))); |
| 641 } | 638 } |
| 642 } | 639 } |
| 643 | 640 |
| 644 visit(HInstruction node) { | 641 visit(HInstruction node) { |
| 645 node.accept(this); | 642 node.accept(this); |
| 646 } | 643 } |
| (...skipping 2315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2962 if (leftType.canBeNull() && rightType.canBeNull()) { | 2959 if (leftType.canBeNull() && rightType.canBeNull()) { |
| 2963 if (left.isConstantNull() || right.isConstantNull() || | 2960 if (left.isConstantNull() || right.isConstantNull() || |
| 2964 (leftType.isPrimitive() && leftType == rightType)) { | 2961 (leftType.isPrimitive() && leftType == rightType)) { |
| 2965 return '=='; | 2962 return '=='; |
| 2966 } | 2963 } |
| 2967 return null; | 2964 return null; |
| 2968 } else { | 2965 } else { |
| 2969 return '==='; | 2966 return '==='; |
| 2970 } | 2967 } |
| 2971 } | 2968 } |
| OLD | NEW |