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

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

Issue 12377081: Register instantiated types instead of instantiated classes in the resolver. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Small bugfix: use the raw type if no type argument is given. Created 7 years, 9 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 dart2js; 5 part of dart2js;
6 6
7 class EnqueueTask extends CompilerTask { 7 class EnqueueTask extends CompilerTask {
8 final ResolutionEnqueuer resolution; 8 final ResolutionEnqueuer resolution;
9 final CodegenEnqueuer codegen; 9 final CodegenEnqueuer codegen;
10 10
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 /** 80 /**
81 * Adds [element] to the work list if it has not already been processed. 81 * Adds [element] to the work list if it has not already been processed.
82 * 82 *
83 * Returns [:true:] if the [element] should be processed. 83 * Returns [:true:] if the [element] should be processed.
84 */ 84 */
85 // TODO(johnniwinther): Change to 'Returns true if the element was added to 85 // TODO(johnniwinther): Change to 'Returns true if the element was added to
86 // the work list'? 86 // the work list'?
87 bool addElementToWorkList(Element element, [TreeElements elements]); 87 bool addElementToWorkList(Element element, [TreeElements elements]);
88 88
89 void registerInstantiatedType(InterfaceType type) { 89 void registerInstantiatedType(InterfaceType type) {
90 ClassElement cls = type.element;
91 cls.ensureResolved(compiler);
90 universe.instantiatedTypes.add(type); 92 universe.instantiatedTypes.add(type);
91 registerInstantiatedClass(type.element);
92 }
93
94 void registerInstantiatedClass(ClassElement cls) {
95 if (universe.instantiatedClasses.contains(cls)) return; 93 if (universe.instantiatedClasses.contains(cls)) return;
96 if (!cls.isAbstract(compiler)) { 94 if (!cls.isAbstract(compiler)) {
97 universe.instantiatedClasses.add(cls); 95 universe.instantiatedClasses.add(cls);
98 } 96 }
99 onRegisterInstantiatedClass(cls); 97 onRegisterInstantiatedClass(cls);
100 compiler.backend.registerInstantiatedClass(cls, this); 98 compiler.backend.registerInstantiatedClass(cls, this);
101 } 99 }
102 100
101 void registerInstantiatedClass(ClassElement cls) {
102 cls.ensureResolved(compiler);
103 registerInstantiatedType(cls.rawType);
104 }
105
103 bool checkNoEnqueuedInvokedInstanceMethods() { 106 bool checkNoEnqueuedInvokedInstanceMethods() {
104 task.measure(() { 107 task.measure(() {
105 // Run through the classes and see if we need to compile methods. 108 // Run through the classes and see if we need to compile methods.
106 for (ClassElement classElement in universe.instantiatedClasses) { 109 for (ClassElement classElement in universe.instantiatedClasses) {
107 for (ClassElement currentClass = classElement; 110 for (ClassElement currentClass = classElement;
108 currentClass != null; 111 currentClass != null;
109 currentClass = currentClass.superclass) { 112 currentClass = currentClass.superclass) {
110 processInstantiatedClass(currentClass); 113 processInstantiatedClass(currentClass);
111 } 114 }
112 } 115 }
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 while(!queue.isEmpty) { 549 while(!queue.isEmpty) {
547 // TODO(johnniwinther): Find an optimal process order for codegen. 550 // TODO(johnniwinther): Find an optimal process order for codegen.
548 f(queue.removeLast()); 551 f(queue.removeLast());
549 } 552 }
550 } 553 }
551 554
552 void _logSpecificSummary(log(message)) { 555 void _logSpecificSummary(log(message)) {
553 log('Compiled ${generatedCode.length} methods.'); 556 log('Compiled ${generatedCode.length} methods.');
554 } 557 }
555 } 558 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698