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

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

Issue 2696483005: Move global dependencies to BackendUsage (Closed)
Patch Set: Created 3 years, 10 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: pkg/compiler/lib/src/js_backend/backend_usage.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend_usage.dart b/pkg/compiler/lib/src/js_backend/backend_usage.dart
index dcfa2af6d9215c0518b7ffd86e312d05ef6659de..9c0b46b5e108fcb7632a9519b3067cdb992bd193 100644
--- a/pkg/compiler/lib/src/js_backend/backend_usage.dart
+++ b/pkg/compiler/lib/src/js_backend/backend_usage.dart
@@ -4,7 +4,6 @@
import '../common.dart';
import '../common/resolution.dart' show Resolution;
-import '../compiler.dart' show GlobalDependencyRegistry;
import '../core_types.dart';
import '../elements/elements.dart';
import '../elements/resolution_types.dart';
@@ -12,6 +11,7 @@ import '../universe/selector.dart';
import '../universe/use.dart';
import '../universe/world_impact.dart'
show WorldImpact, WorldImpactBuilder, WorldImpactBuilderImpl;
+import '../util/util.dart' show Setlet;
import 'backend_helpers.dart';
import 'backend_impact.dart';
@@ -19,7 +19,8 @@ class BackendUsage {
final CommonElements commonElements;
final BackendHelpers helpers;
final Resolution resolution;
- final GlobalDependencyRegistry globalDependencies;
+ // TODO(johnniwinther): Remove the need for this.
+ Setlet<Element> _globalDependencies;
/// List of elements that the backend may use.
final Set<Element> helpersUsed = new Set<Element>();
@@ -27,8 +28,7 @@ class BackendUsage {
bool needToInitializeIsolateAffinityTag = false;
bool needToInitializeDispatchProperty = false;
- BackendUsage(this.commonElements, this.helpers, this.resolution,
- this.globalDependencies);
+ BackendUsage(this.commonElements, this.helpers, this.resolution);
/// The backend must *always* call this method when enqueuing an
/// element. Calls done by the backend are not seen by global
@@ -111,7 +111,7 @@ class BackendUsage {
// TODO(johnniwinther): Store the correct use in impacts.
new StaticUse.foreignUse(element));
if (isGlobal) {
- globalDependencies.registerDependency(element);
+ registerGlobalDependency(element);
}
}
@@ -122,7 +122,7 @@ class BackendUsage {
registerBackendUse(cls);
worldImpact.registerTypeUse(new TypeUse.instantiation(cls.rawType));
if (isGlobal) {
- globalDependencies.registerDependency(cls);
+ registerGlobalDependency(cls);
}
}
@@ -165,4 +165,14 @@ class BackendUsage {
}
}
}
+
+ void registerGlobalDependency(Element element) {
+ if (element == null) return;
+ if (_globalDependencies == null) {
+ _globalDependencies = new Setlet<Element>();
+ }
+ _globalDependencies.add(element.implementation);
+ }
+
+ Iterable<Element> get globalDependencies => _globalDependencies;
}
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | pkg/compiler/lib/src/js_backend/custom_elements_analysis.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698