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..4d37f2e007bb17b766ddc98ef33704395d7569c9 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 forEachPostProcessing(f(PostProcessing work)) {} |
+ |
void logSummary(log(message)) { |
_logSpecificSummary(log); |
nativeEnqueuer.logSummary(log); |
@@ -416,11 +418,14 @@ class ResolutionEnqueuer extends Enqueuer { |
final Queue<ResolutionWorkItem> queue; |
+ final Queue<PostProcessing> 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<PostProcessing>(); |
bool get isResolutionQueue => true; |
@@ -521,6 +526,20 @@ class ResolutionEnqueuer extends Enqueuer { |
} |
} |
+ void addPostProcessing(Element element, PostProcess process) { |
+ if (queueIsClosed) { |
+ throw new SpannableAssertionFailure(element, |
+ "Resolution work list is closed."); |
+ } |
+ postQueue.add(new PostProcessing(element, process)); |
+ } |
+ |
+ void forEachPostProcessing(f(PostProcessing work)) { |
+ while (!postQueue.isEmpty) { |
+ f(postQueue.removeFirst()); |
+ } |
+ } |
+ |
void registerJsCall(Send node, ResolverVisitor resolver) { |
nativeEnqueuer.registerJsCall(node, resolver); |
} |