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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 * Invariant: [element] must be a declaration element. | 131 * Invariant: [element] must be a declaration element. |
132 */ | 132 */ |
133 void eagerRecompile(Element element) { | 133 void eagerRecompile(Element element) { |
134 assert(invariant(element, element.isDeclaration)); | 134 assert(invariant(element, element.isDeclaration)); |
135 universe.generatedCode.remove(element); | 135 universe.generatedCode.remove(element); |
136 universe.generatedBailoutCode.remove(element); | 136 universe.generatedBailoutCode.remove(element); |
137 addToWorkList(element); | 137 addToWorkList(element); |
138 } | 138 } |
139 | 139 |
140 void registerInstantiatedClass(ClassElement cls) { | 140 void registerInstantiatedClass(ClassElement cls) { |
| 141 if (universe.instantiatedClasses.contains(cls)) return; |
141 universe.instantiatedClasses.add(cls); | 142 universe.instantiatedClasses.add(cls); |
142 onRegisterInstantiatedClass(cls); | 143 onRegisterInstantiatedClass(cls); |
143 compiler.backend.registerInstantiatedClass(cls, this); | 144 compiler.backend.registerInstantiatedClass(cls, this); |
144 } | 145 } |
145 | 146 |
146 bool checkNoEnqueuedInvokedInstanceMethods() { | 147 bool checkNoEnqueuedInvokedInstanceMethods() { |
147 task.measure(() { | 148 task.measure(() { |
148 // Run through the classes and see if we need to compile methods. | 149 // Run through the classes and see if we need to compile methods. |
149 for (ClassElement classElement in universe.instantiatedClasses) { | 150 for (ClassElement classElement in universe.instantiatedClasses) { |
150 for (ClassElement currentClass = classElement; | 151 for (ClassElement currentClass = classElement; |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 nativeEnqueuer.logSummary(log); | 405 nativeEnqueuer.logSummary(log); |
405 } | 406 } |
406 | 407 |
407 registerUsedSelector(Selector selector) { | 408 registerUsedSelector(Selector selector) { |
408 Element interceptor = compiler.backend.getInterceptor(selector); | 409 Element interceptor = compiler.backend.getInterceptor(selector); |
409 if (interceptor != null) { | 410 if (interceptor != null) { |
410 registerStaticUse(interceptor); | 411 registerStaticUse(interceptor); |
411 } | 412 } |
412 } | 413 } |
413 } | 414 } |
OLD | NEW |