OLD | NEW |
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 Enqueuer codegen; | 8 final Enqueuer codegen; |
9 final Enqueuer resolution; | 9 final Enqueuer resolution; |
10 | 10 |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 void registerInstantiatedClass(ClassElement cls) { | 133 void registerInstantiatedClass(ClassElement cls) { |
134 if (cls.isInterface()) { | 134 if (cls.isInterface()) { |
135 compiler.internalErrorOnElement( | 135 compiler.internalErrorOnElement( |
136 // Use the current element, as this is where cls is referenced from. | 136 // Use the current element, as this is where cls is referenced from. |
137 compiler.currentElement, | 137 compiler.currentElement, |
138 'Expected a class, but $cls is an interface.'); | 138 'Expected a class, but $cls is an interface.'); |
139 } | 139 } |
140 universe.instantiatedClasses.add(cls); | 140 universe.instantiatedClasses.add(cls); |
141 onRegisterInstantiatedClass(cls); | 141 onRegisterInstantiatedClass(cls); |
| 142 if (cls.isAbstract(compiler)) { |
| 143 ClassElement element = compiler.backend.getBackendImplementation(cls); |
| 144 if (element != null) registerInstantiatedClass(element); |
| 145 } |
142 } | 146 } |
143 | 147 |
144 bool checkNoEnqueuedInvokedInstanceMethods() { | 148 bool checkNoEnqueuedInvokedInstanceMethods() { |
145 task.measure(() { | 149 task.measure(() { |
146 // Run through the classes and see if we need to compile methods. | 150 // Run through the classes and see if we need to compile methods. |
147 for (ClassElement classElement in universe.instantiatedClasses) { | 151 for (ClassElement classElement in universe.instantiatedClasses) { |
148 for (ClassElement currentClass = classElement; | 152 for (ClassElement currentClass = classElement; |
149 currentClass != null; | 153 currentClass != null; |
150 currentClass = currentClass.superclass) { | 154 currentClass = currentClass.superclass) { |
151 processInstantiatedClass(currentClass); | 155 processInstantiatedClass(currentClass); |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 | 370 |
367 String toString() => 'Enqueuer($name)'; | 371 String toString() => 'Enqueuer($name)'; |
368 | 372 |
369 registerUsedSelector(Selector selector) { | 373 registerUsedSelector(Selector selector) { |
370 Element interceptor = compiler.backend.getInterceptor(selector); | 374 Element interceptor = compiler.backend.getInterceptor(selector); |
371 if (interceptor != null) { | 375 if (interceptor != null) { |
372 registerStaticUse(interceptor); | 376 registerStaticUse(interceptor); |
373 } | 377 } |
374 } | 378 } |
375 } | 379 } |
OLD | NEW |