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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ssa/codegen.dart

Issue 693883003: Encode super calls via extra properties on prototypes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix handling of [Object] and stubs generation. 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 | « sdk/lib/_internal/compiler/implementation/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(
1686 js.js('#.prototype.#.call(#)', [
1687 backend.namer.elementAccess(superClass),
1688 methodName, visitArguments(node.inputs, start: 0)]),
1689 node);
1685 } else { 1690 } else {
1686 methodName = backend.namer.getNameOfInstanceMember(superMethod); 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);
1687 } 1700 }
1688 push( 1701
1689 js.js('#.prototype.#.call(#)', [
1690 backend.namer.elementAccess(superClass),
1691 methodName, visitArguments(node.inputs, start: 0)]),
1692 node);
1693 } 1702 }
1694 } 1703 }
1695 1704
1696 visitFieldGet(HFieldGet node) { 1705 visitFieldGet(HFieldGet node) {
1697 use(node.receiver); 1706 use(node.receiver);
1698 Element element = node.element; 1707 Element element = node.element;
1699 if (node.isNullCheck) { 1708 if (node.isNullCheck) {
1700 // We access a JavaScript member we know all objects besides 1709 // We access a JavaScript member we know all objects besides
1701 // null and undefined have: V8 does not like accessing a member 1710 // null and undefined have: V8 does not like accessing a member
1702 // that does not exist. 1711 // that does not exist.
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
2713 js.PropertyAccess accessHelper(String name) { 2722 js.PropertyAccess accessHelper(String name) {
2714 Element helper = backend.findHelper(name); 2723 Element helper = backend.findHelper(name);
2715 if (helper == null) { 2724 if (helper == null) {
2716 // For mocked-up tests. 2725 // For mocked-up tests.
2717 return js.js('(void 0).$name'); 2726 return js.js('(void 0).$name');
2718 } 2727 }
2719 registry.registerStaticUse(helper); 2728 registry.registerStaticUse(helper);
2720 return backend.namer.elementAccess(helper); 2729 return backend.namer.elementAccess(helper);
2721 } 2730 }
2722 } 2731 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/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