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

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

Issue 743383002: Redo "Revert "Encode super calls via extra properties on prototypes."" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart ('k') | no next file » | 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 10
(...skipping 1664 matching lines...) Expand 10 before | Expand all | Expand 10 after
1675 // [world]. The emitter needs to know if it needs to emit a 1675 // [world]. The emitter needs to know if it needs to emit a
1676 // bound closure for a method. 1676 // bound closure for a method.
1677 TypeMask receiverType = 1677 TypeMask receiverType =
1678 new TypeMask.nonNullExact(superClass, compiler.world); 1678 new TypeMask.nonNullExact(superClass, compiler.world);
1679 selector = new TypedSelector(receiverType, selector, compiler.world); 1679 selector = new TypedSelector(receiverType, selector, compiler.world);
1680 // TODO(floitsch): we know the target. We shouldn't register a 1680 // TODO(floitsch): we know the target. We shouldn't register a
1681 // dynamic getter. 1681 // dynamic getter.
1682 registry.registerDynamicGetter(selector); 1682 registry.registerDynamicGetter(selector);
1683 registry.registerGetterForSuperMethod(node.element); 1683 registry.registerGetterForSuperMethod(node.element);
1684 methodName = backend.namer.invocationName(selector); 1684 methodName = backend.namer.invocationName(selector);
1685 push( 1685 } else {
1686 methodName = backend.namer.getNameOfInstanceMember(superMethod);
1687 }
1688 push(
1686 js.js('#.prototype.#.call(#)', [ 1689 js.js('#.prototype.#.call(#)', [
1687 backend.namer.elementAccess(superClass), 1690 backend.namer.elementAccess(superClass),
1688 methodName, visitArguments(node.inputs, start: 0)]), 1691 methodName, visitArguments(node.inputs, start: 0)]),
1689 node); 1692 node);
1690 } else {
1691 methodName =
1692 backend.namer.getNameOfAliasedSuperMember(superMethod);
1693 backend.registerAliasedSuperMember(superMethod);
1694 use(node.inputs.first);
1695 push(
1696 js.js('#.#(#)', [
1697 pop(), methodName,
1698 visitArguments(node.inputs, start: 1)]),
1699 node);
1700 }
1701
1702 } 1693 }
1703 } 1694 }
1704 1695
1705 visitFieldGet(HFieldGet node) { 1696 visitFieldGet(HFieldGet node) {
1706 use(node.receiver); 1697 use(node.receiver);
1707 Element element = node.element; 1698 Element element = node.element;
1708 if (node.isNullCheck) { 1699 if (node.isNullCheck) {
1709 // We access a JavaScript member we know all objects besides 1700 // We access a JavaScript member we know all objects besides
1710 // null and undefined have: V8 does not like accessing a member 1701 // null and undefined have: V8 does not like accessing a member
1711 // that does not exist. 1702 // that does not exist.
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after
2723 js.PropertyAccess accessHelper(String name) { 2714 js.PropertyAccess accessHelper(String name) {
2724 Element helper = backend.findHelper(name); 2715 Element helper = backend.findHelper(name);
2725 if (helper == null) { 2716 if (helper == null) {
2726 // For mocked-up tests. 2717 // For mocked-up tests.
2727 return js.js('(void 0).$name'); 2718 return js.js('(void 0).$name');
2728 } 2719 }
2729 registry.registerStaticUse(helper); 2720 registry.registerStaticUse(helper);
2730 return backend.namer.elementAccess(helper); 2721 return backend.namer.elementAccess(helper);
2731 } 2722 }
2732 } 2723 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/old_emitter/reflection_data_parser.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698