Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: sdk/lib/_internal/compiler/implementation/enqueue.dart

Issue 654903002: Remove ResolutionEnqueuer.isLive (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add test. Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/compiler/implementation/enqueue.dart
diff --git a/sdk/lib/_internal/compiler/implementation/enqueue.dart b/sdk/lib/_internal/compiler/implementation/enqueue.dart
index 8c101a4ed2a9c447a1db7863277ba93f002fbbb7..a00c365e2d766fdf465c8ef3533ce6bba95218ff 100644
--- a/sdk/lib/_internal/compiler/implementation/enqueue.dart
+++ b/sdk/lib/_internal/compiler/implementation/enqueue.dart
@@ -40,7 +40,7 @@ abstract class Enqueuer {
= new Map<String, Set<Element>>();
final Map<String, Set<Element>> instanceFunctionsByName
= new Map<String, Set<Element>>();
- final Set<ClassElement> _seenClasses = new Set<ClassElement>();
+ final Set<ClassElement> _processedClasses = new Set<ClassElement>();
Set<ClassElement> recentClasses = new Setlet<ClassElement>();
final Universe universe = new Universe();
@@ -91,7 +91,7 @@ abstract class Enqueuer {
registry.registerDependency(cls);
cls.ensureResolved(compiler);
universe.registerTypeInstantiation(type, byMirrors: mirrorUsage);
- onRegisterInstantiatedClass(cls);
+ processInstantiatedClass(cls);
});
}
@@ -105,7 +105,7 @@ abstract class Enqueuer {
return filter.checkNoEnqueuedInvokedInstanceMethods(this);
}
- void processInstantiatedClass(ClassElement cls) {
+ void processInstantiatedClassMembers(ClassElement cls) {
cls.implementation.forEachMember(processInstantiatedClassMember);
}
@@ -214,17 +214,17 @@ abstract class Enqueuer {
void enableNoSuchMethod(Element element) {}
void enableIsolateSupport() {}
- void onRegisterInstantiatedClass(ClassElement cls) {
+ void processInstantiatedClass(ClassElement cls) {
task.measure(() {
- if (_seenClasses.contains(cls)) return;
+ if (_processedClasses.contains(cls)) return;
// The class must be resolved to compute the set of all
// supertypes.
cls.ensureResolved(compiler);
void processClass(ClassElement cls) {
- if (_seenClasses.contains(cls)) return;
+ if (_processedClasses.contains(cls)) return;
- _seenClasses.add(cls);
+ _processedClasses.add(cls);
recentClasses.add(cls);
cls.ensureResolved(compiler);
cls.implementation.forEachMember(processInstantiatedClassMember);
@@ -410,7 +410,7 @@ abstract class Enqueuer {
// as recently seen, as we do not know how many rounds of resolution might
// have run before tree shaking is disabled and thus everything is
// enqueued.
- recents = _seenClasses.toSet();
+ recents = _processedClasses.toSet();
compiler.log('Enqueuing everything');
for (LibraryElement lib in compiler.libraryLoader.libraries) {
enqueueReflectiveElementsInLibrary(lib, recents);
@@ -639,7 +639,7 @@ abstract class Enqueuer {
void forgetElement(Element element) {
universe.forgetElement(element, compiler);
- _seenClasses.remove(element);
+ _processedClasses.remove(element);
}
}
@@ -682,13 +682,6 @@ class ResolutionEnqueuer extends Enqueuer {
resolvedElements.add(element);
}
- /// Returns [:true:] if [element] has actually been used.
- bool isLive(Element element) {
- if (_seenClasses.contains(element)) return true;
- if (hasBeenResolved(element)) return true;
- return false;
- }
-
/**
* Decides whether an element should be included to satisfy requirements
* of the mirror system.
@@ -888,11 +881,12 @@ class QueueFilter {
bool checkNoEnqueuedInvokedInstanceMethods(Enqueuer enqueuer) {
enqueuer.task.measure(() {
// Run through the classes and see if we need to compile methods.
- for (ClassElement classElement in enqueuer.universe.instantiatedClasses) {
+ for (ClassElement classElement in
+ enqueuer.universe.directlyInstantiatedClasses) {
for (ClassElement currentClass = classElement;
currentClass != null;
currentClass = currentClass.superclass) {
- enqueuer.processInstantiatedClass(currentClass);
+ enqueuer.processInstantiatedClassMembers(currentClass);
}
}
});

Powered by Google App Engine
This is Rietveld 408576698