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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart

Issue 14049010: Take noSuchMethod into account when computing the potential targets of a call. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 months 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 js_backend; 5 part of js_backend;
6 6
7 typedef void Recompile(Element element); 7 typedef void Recompile(Element element);
8 8
9 class ReturnInfo { 9 class ReturnInfo {
10 HType returnType; 10 HType returnType;
(...skipping 999 matching lines...) Expand 10 before | Expand all | Expand 10 after
1010 } 1010 }
1011 1011
1012 void initializeNoSuchMethod() { 1012 void initializeNoSuchMethod() {
1013 // In case the emitter generates noSuchMethod calls, we need to 1013 // In case the emitter generates noSuchMethod calls, we need to
1014 // make sure all [noSuchMethod] methods know they might take a 1014 // make sure all [noSuchMethod] methods know they might take a
1015 // [JsInvocationMirror] as parameter. 1015 // [JsInvocationMirror] as parameter.
1016 HTypeList types = new HTypeList(1); 1016 HTypeList types = new HTypeList(1);
1017 types[0] = new HType.nonNullExact( 1017 types[0] = new HType.nonNullExact(
1018 compiler.jsInvocationMirrorClass.computeType(compiler), 1018 compiler.jsInvocationMirrorClass.computeType(compiler),
1019 compiler); 1019 compiler);
1020 argumentTypes.registerDynamicInvocation(types, new Selector.noSuchMethod()); 1020 argumentTypes.registerDynamicInvocation(
1021 types, compiler.noSuchMethodSelector);
1021 } 1022 }
1022 1023
1023 void registerInstantiatedClass(ClassElement cls, 1024 void registerInstantiatedClass(ClassElement cls,
1024 Enqueuer enqueuer, 1025 Enqueuer enqueuer,
1025 TreeElements elements) { 1026 TreeElements elements) {
1026 if (!seenAnyClass) { 1027 if (!seenAnyClass) {
1027 initializeNoSuchMethod(); 1028 initializeNoSuchMethod();
1028 seenAnyClass = true; 1029 seenAnyClass = true;
1029 if (enqueuer.isResolutionQueue) { 1030 if (enqueuer.isResolutionQueue) {
1030 // TODO(9577): Make it so that these are not needed when there are no 1031 // TODO(9577): Make it so that these are not needed when there are no
(...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after
1771 ClassElement get constListImplementation => jsArrayClass; 1772 ClassElement get constListImplementation => jsArrayClass;
1772 ClassElement get fixedListImplementation => jsFixedArrayClass; 1773 ClassElement get fixedListImplementation => jsFixedArrayClass;
1773 ClassElement get growableListImplementation => jsExtendableArrayClass; 1774 ClassElement get growableListImplementation => jsExtendableArrayClass;
1774 ClassElement get mapImplementation => mapLiteralClass; 1775 ClassElement get mapImplementation => mapLiteralClass;
1775 ClassElement get constMapImplementation => constMapLiteralClass; 1776 ClassElement get constMapImplementation => constMapLiteralClass;
1776 ClassElement get functionImplementation => jsFunctionClass; 1777 ClassElement get functionImplementation => jsFunctionClass;
1777 ClassElement get typeImplementation => typeLiteralClass; 1778 ClassElement get typeImplementation => typeLiteralClass;
1778 ClassElement get boolImplementation => jsBoolClass; 1779 ClassElement get boolImplementation => jsBoolClass;
1779 ClassElement get nullImplementation => jsNullClass; 1780 ClassElement get nullImplementation => jsNullClass;
1780 } 1781 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698