| 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 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1736 void registerForeignTypes(HForeign node) { | 1736 void registerForeignTypes(HForeign node) { |
| 1737 native.NativeBehavior nativeBehavior = node.nativeBehavior; | 1737 native.NativeBehavior nativeBehavior = node.nativeBehavior; |
| 1738 if (nativeBehavior == null) return; | 1738 if (nativeBehavior == null) return; |
| 1739 nativeBehavior.typesReturned.forEach((type) { | 1739 nativeBehavior.typesReturned.forEach((type) { |
| 1740 if (type is InterfaceType) { | 1740 if (type is InterfaceType) { |
| 1741 registry.registerInstantiatedType(type); | 1741 registry.registerInstantiatedType(type); |
| 1742 } | 1742 } |
| 1743 }); | 1743 }); |
| 1744 } | 1744 } |
| 1745 | 1745 |
| 1746 visitForeign(HForeign node) { | 1746 visitForeignCode(HForeignCode node) { |
| 1747 List<HInstruction> inputs = node.inputs; | 1747 List<HInstruction> inputs = node.inputs; |
| 1748 if (node.isJsStatement()) { | 1748 if (node.isJsStatement()) { |
| 1749 List<js.Expression> interpolatedExpressions = <js.Expression>[]; | 1749 List<js.Expression> interpolatedExpressions = <js.Expression>[]; |
| 1750 for (int i = 0; i < inputs.length; i++) { | 1750 for (int i = 0; i < inputs.length; i++) { |
| 1751 use(inputs[i]); | 1751 use(inputs[i]); |
| 1752 interpolatedExpressions.add(pop()); | 1752 interpolatedExpressions.add(pop()); |
| 1753 } | 1753 } |
| 1754 pushStatement(node.codeTemplate.instantiate(interpolatedExpressions)); | 1754 pushStatement(node.codeTemplate.instantiate(interpolatedExpressions)); |
| 1755 } else { | 1755 } else { |
| 1756 List<js.Expression> interpolatedExpressions = <js.Expression>[]; | 1756 List<js.Expression> interpolatedExpressions = <js.Expression>[]; |
| (...skipping 910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2667 js.PropertyAccess accessHelper(String name) { | 2667 js.PropertyAccess accessHelper(String name) { |
| 2668 Element helper = backend.findHelper(name); | 2668 Element helper = backend.findHelper(name); |
| 2669 if (helper == null) { | 2669 if (helper == null) { |
| 2670 // For mocked-up tests. | 2670 // For mocked-up tests. |
| 2671 return js.js('(void 0).$name'); | 2671 return js.js('(void 0).$name'); |
| 2672 } | 2672 } |
| 2673 registry.registerStaticUse(helper); | 2673 registry.registerStaticUse(helper); |
| 2674 return backend.emitter.staticFunctionAccess(helper); | 2674 return backend.emitter.staticFunctionAccess(helper); |
| 2675 } | 2675 } |
| 2676 } | 2676 } |
| OLD | NEW |