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