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

Unified Diff: pkg/compiler/lib/src/library_loader.dart

Issue 2735763002: Create ResolutionEnqueuer after library loading. (Closed)
Patch Set: Updated cf. comments. Created 3 years, 9 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
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend_helpers.dart ('k') | pkg/compiler/lib/src/patch_parser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/library_loader.dart
diff --git a/pkg/compiler/lib/src/library_loader.dart b/pkg/compiler/lib/src/library_loader.dart
index 796b7079258aa82484be499166323c36c0e83bd9..8865f1e6e28183e1a0f9e7178fa11c0e90e11908 100644
--- a/pkg/compiler/lib/src/library_loader.dart
+++ b/pkg/compiler/lib/src/library_loader.dart
@@ -27,6 +27,7 @@ import 'elements/modelx.dart'
LibraryDependencyElementX,
PrefixElementX,
SyntheticImportElement;
+import 'enqueue.dart' show DeferredAction;
import 'environment.dart';
import 'resolved_uri_translator.dart';
import 'script.dart';
@@ -171,6 +172,14 @@ abstract class LibraryLoaderTask implements LibraryProvider, CompilerTask {
/// Similar to [resetAsync] but [reuseLibrary] maps all libraries to a list
/// of libraries that can be reused.
Future<Null> resetLibraries(ReuseLibrariesFunction reuseLibraries);
+
+ // TODO(johnniwinther): Move these to a separate interface.
+ /// Register a deferred action to be performed during resolution.
+ void registerDeferredAction(DeferredAction action);
+
+ /// Returns the deferred actions registered since the last call to
+ /// [pullDeferredActions].
+ Iterable<DeferredAction> pullDeferredActions();
}
/// Interface for an entity that provide libraries. For instance from normal
@@ -302,6 +311,8 @@ class _LibraryLoaderTask extends CompilerTask implements LibraryLoaderTask {
/// conditional imports.
final Environment environment;
+ List<DeferredAction> _deferredActions = <DeferredAction>[];
+
final DiagnosticReporter reporter;
_LibraryLoaderTask(
@@ -760,6 +771,16 @@ class _LibraryLoaderTask extends CompilerTask implements LibraryLoaderTask {
});
return unit;
}
+
+ void registerDeferredAction(DeferredAction action) {
+ _deferredActions.add(action);
+ }
+
+ Iterable<DeferredAction> pullDeferredActions() {
+ Iterable<DeferredAction> actions = _deferredActions.toList();
+ _deferredActions.clear();
+ return actions;
+ }
}
/// A state machine for checking script tags come in the correct order.
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend_helpers.dart ('k') | pkg/compiler/lib/src/patch_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698