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

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

Issue 13133006: Check for cyclic type variable bounds. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased + pull in PostProcess code. Created 7 years, 8 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 125a355bc9e374777be6d0cc40cb69092374fcd2..ce52d95f4d53c6018c6dc4d5e3fbd483798c7256 100644
--- a/sdk/lib/_internal/compiler/implementation/enqueue.dart
+++ b/sdk/lib/_internal/compiler/implementation/enqueue.dart
@@ -393,6 +393,8 @@ abstract class Enqueuer {
void forEach(f(WorkItem work));
+ void forEachPostProcessTask(f(PostProcessTask work)) {}
+
void logSummary(log(message)) {
_logSpecificSummary(log);
nativeEnqueuer.logSummary(log);
@@ -416,11 +418,18 @@ class ResolutionEnqueuer extends Enqueuer {
final Queue<ResolutionWorkItem> queue;
+ /**
+ * A post-processing queue for the resolution phase which is processed
+ * immediately after the resolution queue has been closed.
+ */
+ final Queue<PostProcessTask> postQueue;
+
ResolutionEnqueuer(Compiler compiler,
ItemCompilationContext itemCompilationContextCreator())
: super('resolution enqueuer', compiler, itemCompilationContextCreator),
resolvedElements = new Map<Element, TreeElements>(),
- queue = new Queue<ResolutionWorkItem>();
+ queue = new Queue<ResolutionWorkItem>(),
+ postQueue = new Queue<PostProcessTask>();
bool get isResolutionQueue => true;
@@ -521,6 +530,27 @@ class ResolutionEnqueuer extends Enqueuer {
}
}
+ /**
+ * Adds an action to the post-processing queue.
+ *
+ * The action is performed as part of the post-processing immediately after
+ * the resolution queue has been closed. As a consequence, [action] must not
+ * add elements to the resolution queue.
+ */
+ void addPostProcessAction(Element element, PostProcessAction action) {
+ if (queueIsClosed) {
+ throw new SpannableAssertionFailure(element,
+ "Resolution work list is closed.");
+ }
+ postQueue.add(new PostProcessTask(element, action));
+ }
+
+ void forEachPostProcessTask(f(PostProcessTask work)) {
+ while (!postQueue.isEmpty) {
+ f(postQueue.removeFirst());
+ }
+ }
+
void registerJsCall(Send node, ResolverVisitor resolver) {
nativeEnqueuer.registerJsCall(node, resolver);
}

Powered by Google App Engine
This is Rietveld 408576698