| 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 1630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1641 } | 1641 } |
| 1642 | 1642 |
| 1643 visitLocalSet(HLocalSet node) { | 1643 visitLocalSet(HLocalSet node) { |
| 1644 use(node.value); | 1644 use(node.value); |
| 1645 assignVariable(variableNames.getName(node.receiver), pop()); | 1645 assignVariable(variableNames.getName(node.receiver), pop()); |
| 1646 } | 1646 } |
| 1647 | 1647 |
| 1648 visitForeign(HForeign node) { | 1648 visitForeign(HForeign node) { |
| 1649 String code = node.code.slowToString(); | 1649 String code = node.code.slowToString(); |
| 1650 List<HInstruction> inputs = node.inputs; | 1650 List<HInstruction> inputs = node.inputs; |
| 1651 if (node.isStatement(types)) { | 1651 if (node.isJsStatement(types)) { |
| 1652 if (!inputs.isEmpty()) { | 1652 if (!inputs.isEmpty()) { |
| 1653 compiler.internalError("foreign statement with inputs: $code", | 1653 compiler.internalError("foreign statement with inputs: $code", |
| 1654 instruction: node); | 1654 instruction: node); |
| 1655 } | 1655 } |
| 1656 pushStatement(new js.LiteralStatement(code), node); | 1656 pushStatement(new js.LiteralStatement(code), node); |
| 1657 } else { | 1657 } else { |
| 1658 List<js.Expression> data = <js.Expression>[]; | 1658 List<js.Expression> data = <js.Expression>[]; |
| 1659 for (int i = 0; i < inputs.length; i++) { | 1659 for (int i = 0; i < inputs.length; i++) { |
| 1660 use(inputs[i]); | 1660 use(inputs[i]); |
| 1661 data.add(pop()); | 1661 data.add(pop()); |
| (...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2925 if (leftType.canBeNull() && rightType.canBeNull()) { | 2925 if (leftType.canBeNull() && rightType.canBeNull()) { |
| 2926 if (left.isConstantNull() || right.isConstantNull() || | 2926 if (left.isConstantNull() || right.isConstantNull() || |
| 2927 (leftType.isPrimitive() && leftType == rightType)) { | 2927 (leftType.isPrimitive() && leftType == rightType)) { |
| 2928 return '=='; | 2928 return '=='; |
| 2929 } | 2929 } |
| 2930 return null; | 2930 return null; |
| 2931 } else { | 2931 } else { |
| 2932 return '==='; | 2932 return '==='; |
| 2933 } | 2933 } |
| 2934 } | 2934 } |
| OLD | NEW |