Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: pkg/compiler/lib/src/ssa/codegen.dart

Issue 1408383006: Rename UniverseSelector to DynamicUse and move it to use.dart (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/ssa/ssa.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 final SourceInformationStrategy sourceInformationFactory; 10 final SourceInformationStrategy sourceInformationFactory;
(...skipping 1626 matching lines...) Expand 10 before | Expand all | Expand 10 after
1637 // If we don't know what we're calling or if we are calling a getter, 1637 // If we don't know what we're calling or if we are calling a getter,
1638 // we need to register that fact that we may be calling a closure 1638 // we need to register that fact that we may be calling a closure
1639 // with the same arguments. 1639 // with the same arguments.
1640 Element target = node.element; 1640 Element target = node.element;
1641 if (target == null || target.isGetter) { 1641 if (target == null || target.isGetter) {
1642 // TODO(kasperl): If we have a typed selector for the call, we 1642 // TODO(kasperl): If we have a typed selector for the call, we
1643 // may know something about the types of closures that need 1643 // may know something about the types of closures that need
1644 // the specific closure call method. 1644 // the specific closure call method.
1645 Selector call = new Selector.callClosureFrom(selector); 1645 Selector call = new Selector.callClosureFrom(selector);
1646 registry.registerDynamicUse( 1646 registry.registerDynamicUse(
1647 new UniverseSelector(call, null)); 1647 new DynamicUse(call, null));
1648 } 1648 }
1649 registry.registerDynamicUse( 1649 registry.registerDynamicUse(
1650 new UniverseSelector(selector, mask)); 1650 new DynamicUse(selector, mask));
1651 } 1651 }
1652 1652
1653 void registerSetter(HInvokeDynamic node) { 1653 void registerSetter(HInvokeDynamic node) {
1654 Selector selector = node.selector; 1654 Selector selector = node.selector;
1655 TypeMask mask = getOptimizedSelectorFor(node, selector, node.mask); 1655 TypeMask mask = getOptimizedSelectorFor(node, selector, node.mask);
1656 registry.registerDynamicUse( 1656 registry.registerDynamicUse(
1657 new UniverseSelector(selector, mask)); 1657 new DynamicUse(selector, mask));
1658 } 1658 }
1659 1659
1660 void registerGetter(HInvokeDynamic node) { 1660 void registerGetter(HInvokeDynamic node) {
1661 Selector selector = node.selector; 1661 Selector selector = node.selector;
1662 TypeMask mask = getOptimizedSelectorFor(node, selector, node.mask); 1662 TypeMask mask = getOptimizedSelectorFor(node, selector, node.mask);
1663 registry.registerDynamicUse( 1663 registry.registerDynamicUse(
1664 new UniverseSelector(selector, mask)); 1664 new DynamicUse(selector, mask));
1665 } 1665 }
1666 1666
1667 visitInvokeDynamicSetter(HInvokeDynamicSetter node) { 1667 visitInvokeDynamicSetter(HInvokeDynamicSetter node) {
1668 use(node.receiver); 1668 use(node.receiver);
1669 js.Name name = backend.namer.invocationName(node.selector); 1669 js.Name name = backend.namer.invocationName(node.selector);
1670 push(js.propertyCall(pop(), name, visitArguments(node.inputs)) 1670 push(js.propertyCall(pop(), name, visitArguments(node.inputs))
1671 .withSourceInformation(node.sourceInformation)); 1671 .withSourceInformation(node.sourceInformation));
1672 registerSetter(node); 1672 registerSetter(node);
1673 } 1673 }
1674 1674
1675 visitInvokeDynamicGetter(HInvokeDynamicGetter node) { 1675 visitInvokeDynamicGetter(HInvokeDynamicGetter node) {
1676 use(node.receiver); 1676 use(node.receiver);
1677 js.Name name = backend.namer.invocationName(node.selector); 1677 js.Name name = backend.namer.invocationName(node.selector);
1678 push(js.propertyCall(pop(), name, visitArguments(node.inputs)) 1678 push(js.propertyCall(pop(), name, visitArguments(node.inputs))
1679 .withSourceInformation(node.sourceInformation)); 1679 .withSourceInformation(node.sourceInformation));
1680 registerGetter(node); 1680 registerGetter(node);
1681 } 1681 }
1682 1682
1683 visitInvokeClosure(HInvokeClosure node) { 1683 visitInvokeClosure(HInvokeClosure node) {
1684 Selector call = new Selector.callClosureFrom(node.selector); 1684 Selector call = new Selector.callClosureFrom(node.selector);
1685 use(node.receiver); 1685 use(node.receiver);
1686 push(js.propertyCall(pop(), 1686 push(js.propertyCall(pop(),
1687 backend.namer.invocationName(call), 1687 backend.namer.invocationName(call),
1688 visitArguments(node.inputs)) 1688 visitArguments(node.inputs))
1689 .withSourceInformation(node.sourceInformation)); 1689 .withSourceInformation(node.sourceInformation));
1690 registry.registerDynamicUse( 1690 registry.registerDynamicUse(
1691 new UniverseSelector(call, null)); 1691 new DynamicUse(call, null));
1692 } 1692 }
1693 1693
1694 visitInvokeStatic(HInvokeStatic node) { 1694 visitInvokeStatic(HInvokeStatic node) {
1695 Element element = node.element; 1695 Element element = node.element;
1696 List<DartType> instantiatedTypes = node.instantiatedTypes; 1696 List<DartType> instantiatedTypes = node.instantiatedTypes;
1697 1697
1698 if (instantiatedTypes != null && !instantiatedTypes.isEmpty) { 1698 if (instantiatedTypes != null && !instantiatedTypes.isEmpty) {
1699 instantiatedTypes.forEach((type) { 1699 instantiatedTypes.forEach((type) {
1700 registry.registerInstantiation(type); 1700 registry.registerInstantiation(type);
1701 }); 1701 });
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1768 // [world]. The emitter needs to know if it needs to emit a 1768 // [world]. The emitter needs to know if it needs to emit a
1769 // bound closure for a method. 1769 // bound closure for a method.
1770 1770
1771 // If [superMethod] is mixed in, [superClass] might not be live. 1771 // If [superMethod] is mixed in, [superClass] might not be live.
1772 // We use the superclass of the access instead. 1772 // We use the superclass of the access instead.
1773 TypeMask receiverType = 1773 TypeMask receiverType =
1774 new TypeMask.nonNullExact(node.caller.superclass, compiler.world); 1774 new TypeMask.nonNullExact(node.caller.superclass, compiler.world);
1775 // TODO(floitsch): we know the target. We shouldn't register a 1775 // TODO(floitsch): we know the target. We shouldn't register a
1776 // dynamic getter. 1776 // dynamic getter.
1777 registry.registerDynamicUse( 1777 registry.registerDynamicUse(
1778 new UniverseSelector(selector, receiverType)); 1778 new DynamicUse(selector, receiverType));
1779 if (superElement.isFunction) { 1779 if (superElement.isFunction) {
1780 registry.registerStaticUse( 1780 registry.registerStaticUse(
1781 new StaticUse.superTearOff(superElement)); 1781 new StaticUse.superTearOff(superElement));
1782 } 1782 }
1783 methodName = backend.namer.invocationName(selector); 1783 methodName = backend.namer.invocationName(selector);
1784 } else { 1784 } else {
1785 assert(invariant(node, compiler.hasIncrementalSupport)); 1785 assert(invariant(node, compiler.hasIncrementalSupport));
1786 methodName = backend.namer.instanceMethodName(superElement); 1786 methodName = backend.namer.instanceMethodName(superElement);
1787 } 1787 }
1788 registry.registerStaticUse( 1788 registry.registerStaticUse(
(...skipping 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after
2918 new StaticUse.staticInvoke(helper, 2918 new StaticUse.staticInvoke(helper,
2919 new CallStructure.unnamed(argumentCount))); 2919 new CallStructure.unnamed(argumentCount)));
2920 return backend.emitter.staticFunctionAccess(helper); 2920 return backend.emitter.staticFunctionAccess(helper);
2921 } 2921 }
2922 2922
2923 @override 2923 @override
2924 void visitRef(HRef node) { 2924 void visitRef(HRef node) {
2925 visit(node.value); 2925 visit(node.value);
2926 } 2926 }
2927 } 2927 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | pkg/compiler/lib/src/ssa/ssa.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698