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

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

Issue 762793002: Disable super-aliases during incremental compilation. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years 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 | Annotate | Revision Log
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 10
(...skipping 1651 matching lines...) Expand 10 before | Expand all | Expand 10 after
1662 js.PropertyAccess access = 1662 js.PropertyAccess access =
1663 new js.PropertyAccess.field(pop(), fieldName); 1663 new js.PropertyAccess.field(pop(), fieldName);
1664 if (node.isSetter) { 1664 if (node.isSetter) {
1665 use(node.value); 1665 use(node.value);
1666 push(new js.Assignment(access, pop()), node); 1666 push(new js.Assignment(access, pop()), node);
1667 } else { 1667 } else {
1668 push(access, node); 1668 push(access, node);
1669 } 1669 }
1670 } else { 1670 } else {
1671 Selector selector = node.selector; 1671 Selector selector = node.selector;
1672 String methodName; 1672
1673 if (selector.isGetter) { 1673 if (!backend.registerAliasedSuperMember(superMethod, selector)) {
1674 // If the selector we need to register a typed getter to the 1674 String methodName;
1675 // [world]. The emitter needs to know if it needs to emit a 1675 if (selector.isGetter) {
1676 // bound closure for a method. 1676 // If the selector we need to register a typed getter to the
1677 TypeMask receiverType = 1677 // [world]. The emitter needs to know if it needs to emit a
1678 new TypeMask.nonNullExact(superClass, compiler.world); 1678 // bound closure for a method.
1679 selector = new TypedSelector(receiverType, selector, compiler.world); 1679 TypeMask receiverType =
1680 // TODO(floitsch): we know the target. We shouldn't register a 1680 new TypeMask.nonNullExact(superClass, compiler.world);
1681 // dynamic getter. 1681 selector = new TypedSelector(receiverType, selector, compiler.world);
1682 registry.registerDynamicGetter(selector); 1682 // TODO(floitsch): we know the target. We shouldn't register a
1683 registry.registerGetterForSuperMethod(node.element); 1683 // dynamic getter.
1684 methodName = backend.namer.invocationName(selector); 1684 registry.registerDynamicGetter(selector);
1685 push( 1685 registry.registerGetterForSuperMethod(node.element);
1686 js.js('#.prototype.#.call(#)', [ 1686 methodName = backend.namer.invocationName(selector);
1687 backend.namer.elementAccess(superClass), 1687 } else {
1688 methodName, visitArguments(node.inputs, start: 0)]), 1688 assert(invariant(node, compiler.hasIncrementalSupport));
1689 node); 1689 methodName = backend.namer.getNameOfInstanceMember(superMethod);
1690 }
1691 push(js.js('#.prototype.#.call(#)',
1692 [backend.namer.elementAccess(superClass),
1693 methodName, visitArguments(node.inputs, start: 0)]),
1694 node);
1690 } else { 1695 } else {
1691 methodName =
1692 backend.namer.getNameOfAliasedSuperMember(superMethod);
1693 backend.registerAliasedSuperMember(superMethod);
1694 use(node.receiver); 1696 use(node.receiver);
1695 push( 1697 push(
1696 js.js('#.#(#)', [ 1698 js.js('#.#(#)', [
1697 pop(), methodName, 1699 pop(), backend.namer.getNameOfAliasedSuperMember(superMethod),
1698 visitArguments(node.inputs, start: 1)]), // Skip receiver argument. 1700 visitArguments(node.inputs, start: 1)]), // Skip receiver argument.
1699 node); 1701 node);
1700 } 1702 }
1701
1702 } 1703 }
1703 } 1704 }
1704 1705
1705 visitFieldGet(HFieldGet node) { 1706 visitFieldGet(HFieldGet node) {
1706 use(node.receiver); 1707 use(node.receiver);
1707 Element element = node.element; 1708 Element element = node.element;
1708 if (node.isNullCheck) { 1709 if (node.isNullCheck) {
1709 // We access a JavaScript member we know all objects besides 1710 // We access a JavaScript member we know all objects besides
1710 // null and undefined have: V8 does not like accessing a member 1711 // null and undefined have: V8 does not like accessing a member
1711 // that does not exist. 1712 // that does not exist.
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after
2723 js.PropertyAccess accessHelper(String name) { 2724 js.PropertyAccess accessHelper(String name) {
2724 Element helper = backend.findHelper(name); 2725 Element helper = backend.findHelper(name);
2725 if (helper == null) { 2726 if (helper == null) {
2726 // For mocked-up tests. 2727 // For mocked-up tests.
2727 return js.js('(void 0).$name'); 2728 return js.js('(void 0).$name');
2728 } 2729 }
2729 registry.registerStaticUse(helper); 2730 registry.registerStaticUse(helper);
2730 return backend.namer.elementAccess(helper); 2731 return backend.namer.elementAccess(helper);
2731 } 2732 }
2732 } 2733 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698