| 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 1675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1686 visitLocalGet(HLocalGet node) { | 1686 visitLocalGet(HLocalGet node) { |
| 1687 use(node.receiver); | 1687 use(node.receiver); |
| 1688 } | 1688 } |
| 1689 | 1689 |
| 1690 visitLocalSet(HLocalSet node) { | 1690 visitLocalSet(HLocalSet node) { |
| 1691 use(node.value); | 1691 use(node.value); |
| 1692 assignVariable(variableNames.getName(node.receiver), pop()); | 1692 assignVariable(variableNames.getName(node.receiver), pop()); |
| 1693 } | 1693 } |
| 1694 | 1694 |
| 1695 void registerForeignType(HType type) { | 1695 void registerForeignType(HType type) { |
| 1696 // TODO(kasperl): This looks shaky. It makes sense if the type is | |
| 1697 // exact, but otherwise we should be registering more types as | |
| 1698 // instantiated. We should find a way of using something along the | |
| 1699 // lines of the NativeEnqueuerBase.processNativeBehavior method. | |
| 1700 if (type.isUnknown()) return; | 1696 if (type.isUnknown()) return; |
| 1701 TypeMask mask = type.computeMask(compiler); | 1697 TypeMask mask = type.computeMask(compiler); |
| 1702 world.registerInstantiatedClass(mask.base.element, work.resolutionTree); | 1698 for (ClassElement cls in mask.containedClasses(compiler)) { |
| 1699 world.registerInstantiatedClass(cls, work.resolutionTree); |
| 1700 } |
| 1703 } | 1701 } |
| 1704 | 1702 |
| 1705 visitForeign(HForeign node) { | 1703 visitForeign(HForeign node) { |
| 1706 List<HInstruction> inputs = node.inputs; | 1704 List<HInstruction> inputs = node.inputs; |
| 1707 if (node.isJsStatement()) { | 1705 if (node.isJsStatement()) { |
| 1708 if (!inputs.isEmpty) { | 1706 if (!inputs.isEmpty) { |
| 1709 compiler.internalError("foreign statement with inputs", | 1707 compiler.internalError("foreign statement with inputs", |
| 1710 instruction: node); | 1708 instruction: node); |
| 1711 } | 1709 } |
| 1712 pushStatement(node.codeAst, node); | 1710 pushStatement(node.codeAst, node); |
| (...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2976 if (leftType.canBeNull() && rightType.canBeNull()) { | 2974 if (leftType.canBeNull() && rightType.canBeNull()) { |
| 2977 if (left.isConstantNull() || right.isConstantNull() || | 2975 if (left.isConstantNull() || right.isConstantNull() || |
| 2978 (leftType.isPrimitive() && leftType == rightType)) { | 2976 (leftType.isPrimitive() && leftType == rightType)) { |
| 2979 return '=='; | 2977 return '=='; |
| 2980 } | 2978 } |
| 2981 return null; | 2979 return null; |
| 2982 } else { | 2980 } else { |
| 2983 return '==='; | 2981 return '==='; |
| 2984 } | 2982 } |
| 2985 } | 2983 } |
| OLD | NEW |