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

Side by Side Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 868643002: Revert "Change signature of lookupConstructor to only require a name." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 const VERBOSE_OPTIMIZER_HINTS = false; 7 const VERBOSE_OPTIMIZER_HINTS = false;
8 8
9 const bool USE_CPS_IR = const bool.fromEnvironment("USE_CPS_IR"); 9 const bool USE_CPS_IR = const bool.fromEnvironment("USE_CPS_IR");
10 10
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 enqueue(enqueuer, getNativeInterceptorMethod, registry); 835 enqueue(enqueuer, getNativeInterceptorMethod, registry);
836 enqueueClass(enqueuer, jsInterceptorClass, compiler.globalDependencies); 836 enqueueClass(enqueuer, jsInterceptorClass, compiler.globalDependencies);
837 enqueueClass(enqueuer, jsPlainJavaScriptObjectClass, registry); 837 enqueueClass(enqueuer, jsPlainJavaScriptObjectClass, registry);
838 } else if (cls == mapLiteralClass) { 838 } else if (cls == mapLiteralClass) {
839 // For map literals, the dependency between the implementation class 839 // For map literals, the dependency between the implementation class
840 // and [Map] is not visible, so we have to add it manually. 840 // and [Map] is not visible, so we have to add it manually.
841 Element getFactory(String name, int arity) { 841 Element getFactory(String name, int arity) {
842 // The constructor is on the patch class, but dart2js unit tests don't 842 // The constructor is on the patch class, but dart2js unit tests don't
843 // have a patch class. 843 // have a patch class.
844 ClassElement implementation = cls.patch != null ? cls.patch : cls; 844 ClassElement implementation = cls.patch != null ? cls.patch : cls;
845 ConstructorElement ctor = implementation.lookupConstructor(name); 845 return implementation.lookupConstructor(
846 if (ctor == null 846 new Selector.callConstructor(
847 || (isPrivateName(name) 847 name, mapLiteralClass.library, arity),
848 && ctor.library != mapLiteralClass.library)) { 848 (element) {
849 compiler.internalError(mapLiteralClass, 849 compiler.internalError(mapLiteralClass,
850 "Map literal class $mapLiteralClass missing " 850 "Map literal class $mapLiteralClass missing "
851 "'$name' constructor" 851 "'$name' constructor"
852 " ${mapLiteralClass.constructors}"); 852 " ${mapLiteralClass.constructors}");
853 } 853 });
854 return ctor;
855 } 854 }
856 mapLiteralConstructor = getFactory('_literal', 1); 855 mapLiteralConstructor = getFactory('_literal', 1);
857 mapLiteralConstructorEmpty = getFactory('_empty', 0); 856 mapLiteralConstructorEmpty = getFactory('_empty', 0);
858 enqueueInResolution(mapLiteralConstructor, registry); 857 enqueueInResolution(mapLiteralConstructor, registry);
859 enqueueInResolution(mapLiteralConstructorEmpty, registry); 858 enqueueInResolution(mapLiteralConstructorEmpty, registry);
860 } 859 }
861 } 860 }
862 if (cls == closureClass) { 861 if (cls == closureClass) {
863 enqueue(enqueuer, findHelper('closureFromTearOff'), registry); 862 enqueue(enqueuer, findHelper('closureFromTearOff'), registry);
864 } 863 }
(...skipping 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after
2526 } 2525 }
2527 } 2526 }
2528 2527
2529 /// Records that [constant] is used by the element behind [registry]. 2528 /// Records that [constant] is used by the element behind [registry].
2530 class Dependency { 2529 class Dependency {
2531 final ConstantValue constant; 2530 final ConstantValue constant;
2532 final Element annotatedElement; 2531 final Element annotatedElement;
2533 2532
2534 const Dependency(this.constant, this.annotatedElement); 2533 const Dependency(this.constant, this.annotatedElement);
2535 } 2534 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/inferrer/simple_types_inferrer.dart ('k') | pkg/compiler/lib/src/resolution/members.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698