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 compiler.backend.registerInstantiatedClass(cls, this); |
142 } | 143 } |
143 | 144 |
144 bool checkNoEnqueuedInvokedInstanceMethods() { | 145 bool checkNoEnqueuedInvokedInstanceMethods() { |
145 task.measure(() { | 146 task.measure(() { |
146 // Run through the classes and see if we need to compile methods. | 147 // Run through the classes and see if we need to compile methods. |
147 for (ClassElement classElement in universe.instantiatedClasses) { | 148 for (ClassElement classElement in universe.instantiatedClasses) { |
148 for (ClassElement currentClass = classElement; | 149 for (ClassElement currentClass = classElement; |
149 currentClass != null; | 150 currentClass != null; |
150 currentClass = currentClass.superclass) { | 151 currentClass = currentClass.superclass) { |
151 processInstantiatedClass(currentClass); | 152 processInstantiatedClass(currentClass); |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 | 367 |
367 String toString() => 'Enqueuer($name)'; | 368 String toString() => 'Enqueuer($name)'; |
368 | 369 |
369 registerUsedSelector(Selector selector) { | 370 registerUsedSelector(Selector selector) { |
370 Element interceptor = compiler.backend.getInterceptor(selector); | 371 Element interceptor = compiler.backend.getInterceptor(selector); |
371 if (interceptor != null) { | 372 if (interceptor != null) { |
372 registerStaticUse(interceptor); | 373 registerStaticUse(interceptor); |
373 } | 374 } |
374 } | 375 } |
375 } | 376 } |
OLD | NEW |