| 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 library dart2js.enqueue; | 5 library dart2js.enqueue; |
| 6 | 6 |
| 7 import 'dart:collection' show | 7 import 'dart:collection' show |
| 8 Queue; | 8 Queue; |
| 9 | 9 |
| 10 import 'common/names.dart' show | 10 import 'common/names.dart' show |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 worldImpact.closurizedFunctions.forEach(registerGetOfStaticFunction); | 187 worldImpact.closurizedFunctions.forEach(registerGetOfStaticFunction); |
| 188 } | 188 } |
| 189 | 189 |
| 190 // TODO(johnniwinther): Remove the need for passing the [registry]. | 190 // TODO(johnniwinther): Remove the need for passing the [registry]. |
| 191 void registerInstantiatedType(InterfaceType type, Registry registry, | 191 void registerInstantiatedType(InterfaceType type, Registry registry, |
| 192 {bool mirrorUsage: false}) { | 192 {bool mirrorUsage: false}) { |
| 193 task.measure(() { | 193 task.measure(() { |
| 194 ClassElement cls = type.element; | 194 ClassElement cls = type.element; |
| 195 registry.registerDependency(cls); | 195 registry.registerDependency(cls); |
| 196 cls.ensureResolved(compiler); | 196 cls.ensureResolved(compiler); |
| 197 universe.registerTypeInstantiation(type, byMirrors: mirrorUsage); | 197 universe.registerTypeInstantiation( |
| 198 type, |
| 199 byMirrors: mirrorUsage, |
| 200 onImplemented: (ClassElement cls) { |
| 201 compiler.backend.registerImplementedClass( |
| 202 cls, this, compiler.globalDependencies); |
| 203 }); |
| 198 processInstantiatedClass(cls); | 204 processInstantiatedClass(cls); |
| 199 compiler.backend.registerInstantiatedType(type, registry); | 205 compiler.backend.registerInstantiatedType(type, registry); |
| 200 }); | 206 }); |
| 201 } | 207 } |
| 202 | 208 |
| 203 bool checkNoEnqueuedInvokedInstanceMethods() { | 209 bool checkNoEnqueuedInvokedInstanceMethods() { |
| 204 return filter.checkNoEnqueuedInvokedInstanceMethods(this); | 210 return filter.checkNoEnqueuedInvokedInstanceMethods(this); |
| 205 } | 211 } |
| 206 | 212 |
| 207 void processInstantiatedClassMembers(ClassElement cls) { | 213 void processInstantiatedClassMembers(ClassElement cls) { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 cls.implementation.forEachMember(processInstantiatedClassMember); | 335 cls.implementation.forEachMember(processInstantiatedClassMember); |
| 330 if (isResolutionQueue && !cls.isSynthesized) { | 336 if (isResolutionQueue && !cls.isSynthesized) { |
| 331 compiler.resolver.checkClass(cls); | 337 compiler.resolver.checkClass(cls); |
| 332 } | 338 } |
| 333 // We only tell the backend once that [cls] was instantiated, so | 339 // We only tell the backend once that [cls] was instantiated, so |
| 334 // any additional dependencies must be treated as global | 340 // any additional dependencies must be treated as global |
| 335 // dependencies. | 341 // dependencies. |
| 336 compiler.backend.registerInstantiatedClass( | 342 compiler.backend.registerInstantiatedClass( |
| 337 cls, this, compiler.globalDependencies); | 343 cls, this, compiler.globalDependencies); |
| 338 } | 344 } |
| 339 processClass(cls); | 345 while (cls != null) { |
| 340 for (Link<DartType> supertypes = cls.allSupertypes; | 346 processClass(cls); |
| 341 !supertypes.isEmpty; supertypes = supertypes.tail) { | 347 cls = cls.superclass; |
| 342 processClass(supertypes.head.element); | |
| 343 } | 348 } |
| 344 }); | 349 }); |
| 345 } | 350 } |
| 346 | 351 |
| 347 void registerInvocation(UniverseSelector selector) { | 352 void registerInvocation(UniverseSelector selector) { |
| 348 task.measure(() { | 353 task.measure(() { |
| 349 if (universe.registerInvocation(selector)) { | 354 if (universe.registerInvocation(selector)) { |
| 350 handleUnseenSelector(selector); | 355 handleUnseenSelector(selector); |
| 351 } | 356 } |
| 352 }); | 357 }); |
| (...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1069 @override | 1074 @override |
| 1070 void processStaticUse(Enqueuer enqueuer, Element element) { | 1075 void processStaticUse(Enqueuer enqueuer, Element element) { |
| 1071 enqueuer.registerStaticUseInternal(element); | 1076 enqueuer.registerStaticUseInternal(element); |
| 1072 } | 1077 } |
| 1073 | 1078 |
| 1074 @override | 1079 @override |
| 1075 void processSelector(Enqueuer enqueuer, UniverseSelector selector) { | 1080 void processSelector(Enqueuer enqueuer, UniverseSelector selector) { |
| 1076 enqueuer.handleUnseenSelectorInternal(selector); | 1081 enqueuer.handleUnseenSelectorInternal(selector); |
| 1077 } | 1082 } |
| 1078 } | 1083 } |
| OLD | NEW |