| 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 | 6 |
| 7 final JavaScriptBackend backend; | 7 final JavaScriptBackend backend; |
| 8 | 8 |
| 9 SsaCodeGeneratorTask(JavaScriptBackend backend) | 9 SsaCodeGeneratorTask(JavaScriptBackend backend) |
| 10 : this.backend = backend, | 10 : this.backend = backend, |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 658 void use(HInstruction argument) { | 658 void use(HInstruction argument) { |
| 659 if (isGenerateAtUseSite(argument)) { | 659 if (isGenerateAtUseSite(argument)) { |
| 660 visitExpression(argument); | 660 visitExpression(argument); |
| 661 } else if (argument is HCheck && argument.isControlFlow()) { | 661 } else if (argument is HCheck && argument.isControlFlow()) { |
| 662 // A [HCheck] that has control flow can never be used as an | 662 // A [HCheck] that has control flow can never be used as an |
| 663 // expression and may not have a name. Therefore we just use the | 663 // expression and may not have a name. Therefore we just use the |
| 664 // checked instruction. | 664 // checked instruction. |
| 665 HCheck check = argument; | 665 HCheck check = argument; |
| 666 use(check.checkedInput); | 666 use(check.checkedInput); |
| 667 } else { | 667 } else { |
| 668 push(new js.VariableUse(variableNames.getName(argument)), argument); | 668 push(new js.VariableUse(variableNames.getName(argument))); |
| 669 } | 669 } |
| 670 } | 670 } |
| 671 | 671 |
| 672 visit(HInstruction node) { | 672 visit(HInstruction node) { |
| 673 node.accept(this); | 673 node.accept(this); |
| 674 } | 674 } |
| 675 | 675 |
| 676 visitExpression(HInstruction node) { | 676 visitExpression(HInstruction node) { |
| 677 bool oldIsGeneratingExpression = isGeneratingExpression; | 677 bool oldIsGeneratingExpression = isGeneratingExpression; |
| 678 isGeneratingExpression = true; | 678 isGeneratingExpression = true; |
| (...skipping 2315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2994 if (leftType.canBeNull() && rightType.canBeNull()) { | 2994 if (leftType.canBeNull() && rightType.canBeNull()) { |
| 2995 if (left.isConstantNull() || right.isConstantNull() || | 2995 if (left.isConstantNull() || right.isConstantNull() || |
| 2996 (leftType.isPrimitive() && leftType == rightType)) { | 2996 (leftType.isPrimitive() && leftType == rightType)) { |
| 2997 return '=='; | 2997 return '=='; |
| 2998 } | 2998 } |
| 2999 return null; | 2999 return null; |
| 3000 } else { | 3000 } else { |
| 3001 return '==='; | 3001 return '==='; |
| 3002 } | 3002 } |
| 3003 } | 3003 } |
| OLD | NEW |