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 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
601 } else { | 601 } else { |
602 visitStatement(instruction); | 602 visitStatement(instruction); |
603 } | 603 } |
604 } | 604 } |
605 | 605 |
606 void use(HInstruction argument) { | 606 void use(HInstruction argument) { |
607 if (isGenerateAtUseSite(argument)) { | 607 if (isGenerateAtUseSite(argument)) { |
608 visitExpression(argument); | 608 visitExpression(argument); |
609 } else if (argument is HCheck && !variableNames.hasName(argument)) { | 609 } else if (argument is HCheck && !variableNames.hasName(argument)) { |
610 HCheck check = argument; | 610 HCheck check = argument; |
| 611 // This can only happen if the checked node does not have a name. |
| 612 assert(!variableNames.hasName(check.checkedInput)); |
611 use(check.checkedInput); | 613 use(check.checkedInput); |
612 } else { | 614 } else { |
613 assert(variableNames.hasName(argument)); | 615 assert(variableNames.hasName(argument)); |
614 push(new js.VariableUse(variableNames.getName(argument))); | 616 push(new js.VariableUse(variableNames.getName(argument))); |
615 } | 617 } |
616 } | 618 } |
617 | 619 |
618 visit(HInstruction node) { | 620 visit(HInstruction node) { |
619 node.accept(this); | 621 node.accept(this); |
620 } | 622 } |
(...skipping 1970 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2591 if (leftType.canBeNull() && rightType.canBeNull()) { | 2593 if (leftType.canBeNull() && rightType.canBeNull()) { |
2592 if (left.isConstantNull() || right.isConstantNull() || | 2594 if (left.isConstantNull() || right.isConstantNull() || |
2593 (leftType.isPrimitive(compiler) && leftType == rightType)) { | 2595 (leftType.isPrimitive(compiler) && leftType == rightType)) { |
2594 return '=='; | 2596 return '=='; |
2595 } | 2597 } |
2596 return null; | 2598 return null; |
2597 } else { | 2599 } else { |
2598 return '==='; | 2600 return '==='; |
2599 } | 2601 } |
2600 } | 2602 } |
OLD | NEW |