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

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

Issue 10964016: Change the type inference for fields in dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minor fixes and rebased Created 8 years, 3 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: lib/compiler/implementation/enqueue.dart
diff --git a/lib/compiler/implementation/enqueue.dart b/lib/compiler/implementation/enqueue.dart
index 4a4b3530618480f43f0728e3cd928b74278471b5..7b0a8cf24ab612236de745546adf1a6bd0b6701e 100644
--- a/lib/compiler/implementation/enqueue.dart
+++ b/lib/compiler/implementation/enqueue.dart
@@ -19,35 +19,6 @@ class EnqueueTask extends CompilerTask {
}
}
-class RecompilationQueue {
- final Function itemCompilationContextCreator;
- final Queue<WorkItem> queue;
- final Set<Element> queueElements;
- int processed = 0;
-
- RecompilationQueue(ItemCompilationContext itemCompilationContextCreator())
- : this.itemCompilationContextCreator = itemCompilationContextCreator,
- queue = new Queue<WorkItem>(),
- queueElements = new Set<Element>();
-
- void add(Element element, TreeElements elements) {
- if (queueElements.contains(element)) return;
- queueElements.add(element);
- queue.add(new WorkItem(element, elements, itemCompilationContextCreator()));
- }
-
- int get length => queue.length;
-
- bool isEmpty() => queue.isEmpty();
-
- WorkItem next() {
- WorkItem item = queue.removeLast();
- queueElements.remove(item.element);
- processed++;
- return item;
- }
-}
-
class Enqueuer {
final Compiler compiler; // TODO(ahe): Remove this dependency.
final Function itemCompilationContextCreator;
@@ -56,7 +27,6 @@ class Enqueuer {
final Universe universe;
final Queue<WorkItem> queue;
final Map<Element, TreeElements> resolvedElements;
- final RecompilationQueue recompilationCandidates;
bool queueIsClosed = false;
EnqueueTask task;
@@ -68,9 +38,7 @@ class Enqueuer {
seenClasses = new Set<ClassElement>(),
universe = new Universe(),
queue = new Queue<WorkItem>(),
- resolvedElements = new Map<Element, TreeElements>(),
- recompilationCandidates =
- new RecompilationQueue(itemCompilationContextCreator);
+ resolvedElements = new Map<Element, TreeElements>();
bool get isResolutionQueue => compiler.enqueuer.resolution === this;
@@ -89,7 +57,6 @@ class Enqueuer {
void addToWorkList(Element element, [TreeElements elements]) {
if (element.isForeign()) return;
- if (compiler.phase == Compiler.PHASE_RECOMPILING) return;
if (queueIsClosed) {
if (isResolutionQueue && getCachedElements(element) !== null) return;
compiler.internalErrorOnElement(element, "Work list is closed.");
@@ -127,14 +94,6 @@ class Enqueuer {
addToWorkList(element);
}
- void registerRecompilationCandidate(Element element,
- [TreeElements elements]) {
- if (queueIsClosed) {
- compiler.internalErrorOnElement(element, "Work list is closed.");
- }
- recompilationCandidates.add(element, elements);
- }
-
void registerInstantiatedClass(ClassElement cls) {
if (cls.isInterface()) {
compiler.internalErrorOnElement(
@@ -298,6 +257,11 @@ class Enqueuer {
}
return false;
});
+ // TODO(sgjesse): Add subscription to the enqueuer to deliver this
+ // information to the JavaScript backend instead of this hardcoded hack.
+ if (compiler.backend is js_backend.JavaScriptBackend) {
+ compiler.backend.addedDynamicSetter(selector);
ngeoffray 2012/09/20 14:43:01 I don't understand why you have to do that here. I
Søren Gjesse 2012/09/21 13:49:44 Having it here ensures that we get just one call w
+ }
}
void registerStaticUse(Element element) {

Powered by Google App Engine
This is Rietveld 408576698