mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 08:24:39 +00:00
Remove EnqueuerImpl.processInstantiatedClassMembers
R=het@google.com Review URL: https://codereview.chromium.org/2539043002 .
This commit is contained in:
parent
c6412af7bb
commit
27afcc4296
|
@ -122,7 +122,6 @@ abstract class Enqueuer {
|
|||
abstract class EnqueuerImpl extends Enqueuer {
|
||||
CompilerTask get task;
|
||||
EnqueuerStrategy get strategy;
|
||||
void processInstantiatedClassMembers(ClassElement cls);
|
||||
void processInstantiatedClassMember(ClassElement cls, Element member);
|
||||
void processStaticUse(StaticUse staticUse);
|
||||
void processTypeUse(TypeUse typeUse);
|
||||
|
@ -234,10 +233,6 @@ class ResolutionEnqueuer extends EnqueuerImpl {
|
|||
return strategy.checkEnqueuerConsistency(this);
|
||||
}
|
||||
|
||||
void processInstantiatedClassMembers(ClassElement cls) {
|
||||
strategy.processInstantiatedClass(this, cls);
|
||||
}
|
||||
|
||||
void processInstantiatedClassMember(ClassElement cls, Element member) {
|
||||
assert(invariant(member, member.isDeclaration));
|
||||
if (isProcessed(member)) return;
|
||||
|
@ -677,9 +672,6 @@ void removeFromSet(Map<String, Set<Element>> map, Element element) {
|
|||
class EnqueuerStrategy {
|
||||
const EnqueuerStrategy();
|
||||
|
||||
/// Process a class instantiated in live code.
|
||||
void processInstantiatedClass(EnqueuerImpl enqueuer, ClassElement cls) {}
|
||||
|
||||
/// Process a static use of and element in live code.
|
||||
void processStaticUse(EnqueuerImpl enqueuer, StaticUse staticUse) {}
|
||||
|
||||
|
@ -690,20 +682,7 @@ class EnqueuerStrategy {
|
|||
void processDynamicUse(EnqueuerImpl enqueuer, DynamicUse dynamicUse) {}
|
||||
|
||||
/// Check enqueuer consistency after the queue has been closed.
|
||||
bool checkEnqueuerConsistency(EnqueuerImpl enqueuer) {
|
||||
enqueuer.task.measure(() {
|
||||
// Run through the classes and see if we need to enqueue more methods.
|
||||
for (ClassElement classElement
|
||||
in enqueuer.universe.directlyInstantiatedClasses) {
|
||||
for (ClassElement currentClass = classElement;
|
||||
currentClass != null;
|
||||
currentClass = currentClass.superclass) {
|
||||
enqueuer.processInstantiatedClassMembers(currentClass);
|
||||
}
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
bool checkEnqueuerConsistency(EnqueuerImpl enqueuer) => true;
|
||||
|
||||
/// Process [work] using [f].
|
||||
void processWorkItem(void f(WorkItem work), WorkItem work) {
|
||||
|
@ -725,11 +704,6 @@ class DirectEnqueuerStrategy extends EnqueuerStrategy {
|
|||
class TreeShakingEnqueuerStrategy extends EnqueuerStrategy {
|
||||
const TreeShakingEnqueuerStrategy();
|
||||
|
||||
@override
|
||||
void processInstantiatedClass(EnqueuerImpl enqueuer, ClassElement cls) {
|
||||
cls.implementation.forEachMember(enqueuer.processInstantiatedClassMember);
|
||||
}
|
||||
|
||||
@override
|
||||
void processStaticUse(EnqueuerImpl enqueuer, StaticUse staticUse) {
|
||||
enqueuer.processStaticUse(staticUse);
|
||||
|
@ -744,6 +718,23 @@ class TreeShakingEnqueuerStrategy extends EnqueuerStrategy {
|
|||
void processDynamicUse(EnqueuerImpl enqueuer, DynamicUse dynamicUse) {
|
||||
enqueuer.processDynamicUse(dynamicUse);
|
||||
}
|
||||
|
||||
/// Check enqueuer consistency after the queue has been closed.
|
||||
bool checkEnqueuerConsistency(EnqueuerImpl enqueuer) {
|
||||
enqueuer.task.measure(() {
|
||||
// Run through the classes and see if we need to enqueue more methods.
|
||||
for (ClassElement classElement
|
||||
in enqueuer.universe.directlyInstantiatedClasses) {
|
||||
for (ClassElement currentClass = classElement;
|
||||
currentClass != null;
|
||||
currentClass = currentClass.superclass) {
|
||||
currentClass.implementation
|
||||
.forEachMember(enqueuer.processInstantiatedClassMember);
|
||||
}
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class EnqueuerImplImpactVisitor implements WorldImpactVisitor {
|
||||
|
|
|
@ -163,10 +163,6 @@ class CodegenEnqueuer extends EnqueuerImpl {
|
|||
return strategy.checkEnqueuerConsistency(this);
|
||||
}
|
||||
|
||||
void processInstantiatedClassMembers(ClassElement cls) {
|
||||
strategy.processInstantiatedClass(this, cls);
|
||||
}
|
||||
|
||||
void processInstantiatedClassMember(ClassElement cls, Element member) {
|
||||
assert(invariant(member, member.isDeclaration));
|
||||
if (isProcessed(member)) return;
|
||||
|
|
Loading…
Reference in a new issue