| 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 1620 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1631 use(node.receiver); | 1631 use(node.receiver); |
| 1632 push(jsPropertyCall(pop(), | 1632 push(jsPropertyCall(pop(), |
| 1633 backend.namer.invocationName(call), | 1633 backend.namer.invocationName(call), |
| 1634 visitArguments(node.inputs)), | 1634 visitArguments(node.inputs)), |
| 1635 node); | 1635 node); |
| 1636 registry.registerDynamicInvocation(call); | 1636 registry.registerDynamicInvocation(call); |
| 1637 } | 1637 } |
| 1638 | 1638 |
| 1639 visitInvokeStatic(HInvokeStatic node) { | 1639 visitInvokeStatic(HInvokeStatic node) { |
| 1640 Element element = node.element; | 1640 Element element = node.element; |
| 1641 ClassElement cls = element.enclosingClass; | |
| 1642 List<DartType> instantiatedTypes = node.instantiatedTypes; | 1641 List<DartType> instantiatedTypes = node.instantiatedTypes; |
| 1643 | 1642 |
| 1644 registry.registerStaticUse(element); | 1643 registry.registerStaticInvocation(element); |
| 1645 | 1644 |
| 1646 if (instantiatedTypes != null && !instantiatedTypes.isEmpty) { | 1645 if (instantiatedTypes != null && !instantiatedTypes.isEmpty) { |
| 1647 instantiatedTypes.forEach((type) { | 1646 instantiatedTypes.forEach((type) { |
| 1648 registry.registerInstantiatedType(type); | 1647 registry.registerInstantiatedType(type); |
| 1649 }); | 1648 }); |
| 1650 } | 1649 } |
| 1651 | 1650 |
| 1652 push(backend.namer.elementAccess(node.element)); | 1651 push(backend.namer.elementAccess(node.element)); |
| 1653 push(new js.Call(pop(), visitArguments(node.inputs, start: 0)), node); | 1652 push(new js.Call(pop(), visitArguments(node.inputs, start: 0)), node); |
| 1654 } | 1653 } |
| 1655 | 1654 |
| 1656 visitInvokeSuper(HInvokeSuper node) { | 1655 visitInvokeSuper(HInvokeSuper node) { |
| 1657 Element superMethod = node.element; | 1656 Element superMethod = node.element; |
| 1658 registry.registerStaticUse(superMethod); | 1657 registry.registerSuperInvocation(superMethod); |
| 1659 ClassElement superClass = superMethod.enclosingClass; | 1658 ClassElement superClass = superMethod.enclosingClass; |
| 1660 if (superMethod.kind == ElementKind.FIELD) { | 1659 if (superMethod.kind == ElementKind.FIELD) { |
| 1661 String fieldName = backend.namer.instanceFieldPropertyName(superMethod); | 1660 String fieldName = backend.namer.instanceFieldPropertyName(superMethod); |
| 1662 use(node.inputs[0]); | 1661 use(node.inputs[0]); |
| 1663 js.PropertyAccess access = | 1662 js.PropertyAccess access = |
| 1664 new js.PropertyAccess.field(pop(), fieldName); | 1663 new js.PropertyAccess.field(pop(), fieldName); |
| 1665 if (node.isSetter) { | 1664 if (node.isSetter) { |
| 1666 use(node.value); | 1665 use(node.value); |
| 1667 push(new js.Assignment(access, pop()), node); | 1666 push(new js.Assignment(access, pop()), node); |
| 1668 } else { | 1667 } else { |
| (...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2724 js.PropertyAccess accessHelper(String name) { | 2723 js.PropertyAccess accessHelper(String name) { |
| 2725 Element helper = backend.findHelper(name); | 2724 Element helper = backend.findHelper(name); |
| 2726 if (helper == null) { | 2725 if (helper == null) { |
| 2727 // For mocked-up tests. | 2726 // For mocked-up tests. |
| 2728 return js.js('(void 0).$name'); | 2727 return js.js('(void 0).$name'); |
| 2729 } | 2728 } |
| 2730 registry.registerStaticUse(helper); | 2729 registry.registerStaticUse(helper); |
| 2731 return backend.namer.elementAccess(helper); | 2730 return backend.namer.elementAccess(helper); |
| 2732 } | 2731 } |
| 2733 } | 2732 } |
| OLD | NEW |