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

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

Issue 1405563002: Move otherDependencies to globalDependencies. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 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
« no previous file with comments | « pkg/compiler/lib/src/common/registry.dart ('k') | pkg/compiler/lib/src/resolution/registry.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/compiler.dart
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart
index ce7003ebe5fb58c4ad16d73e44f8d5f4bebe8c67..9f1484332e5f33016caad96a3dca37adb7c7bd40 100644
--- a/pkg/compiler/lib/src/compiler.dart
+++ b/pkg/compiler/lib/src/compiler.dart
@@ -158,7 +158,7 @@ abstract class Compiler {
* We should get rid of this and ensure that all dependencies are
* associated with a particular element.
*/
- Registry globalDependencies;
+ GlobalDependencyRegistry globalDependencies;
/**
* Dependencies that are only included due to mirrors.
@@ -495,8 +495,7 @@ abstract class Compiler {
// TODO(johnniwinther): Separate the dependency tracking from the enqueuing
// for global dependencies.
- globalDependencies =
- new CodegenRegistry(this, new TreeElementMapping(null));
+ globalDependencies = new GlobalDependencyRegistry(this);
if (emitJavaScript) {
js_backend.JavaScriptBackend jsBackend =
@@ -2030,3 +2029,22 @@ class _CompilerParsing implements Parsing {
});
}
}
+
+class GlobalDependencyRegistry extends CodegenRegistry {
+ Setlet<Element> _otherDependencies;
+
+ GlobalDependencyRegistry(Compiler compiler)
+ : super(compiler, new TreeElementMapping(null));
+
+ void registerDependency(Element element) {
+ if (element == null) return;
+ if (_otherDependencies == null) {
+ _otherDependencies = new Setlet<Element>();
+ }
+ _otherDependencies.add(element.implementation);
+ }
+
+ Iterable<Element> get otherDependencies {
+ return _otherDependencies != null ? _otherDependencies : const <Element>[];
+ }
+}
« no previous file with comments | « pkg/compiler/lib/src/common/registry.dart ('k') | pkg/compiler/lib/src/resolution/registry.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698