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

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

Issue 1132363003: dart2js: keep track of non-final static fields. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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/universe/universe.dart
diff --git a/pkg/compiler/lib/src/universe/universe.dart b/pkg/compiler/lib/src/universe/universe.dart
index 712b870408a4238867c9f677ddb8514f52f9359a..c1ad13fc1cd8fdc31f2862a321c4bf915ead235d 100644
--- a/pkg/compiler/lib/src/universe/universe.dart
+++ b/pkg/compiler/lib/src/universe/universe.dart
@@ -37,6 +37,11 @@ class Universe {
/// Invariant: Elements are declaration elements.
final Set<ClassElement> _allInstantiatedClasses = new Set<ClassElement>();
+ /// The set of all referenced static fields.
+ ///
+ /// Invariant: Elements are declaration elements.
+ final Set<FieldElement> allReferencedStaticFields = new Set<FieldElement>();
+
/**
* Documentation wanted -- johnniwinther
*
@@ -185,6 +190,13 @@ class Universe {
return type;
}
+ void registerStaticFieldUse(FieldElement staticField) {
+ assert(Elements.isStaticOrTopLevel(staticField) && staticField.isField);
+ assert(staticField.isDeclaration);
+
+ allReferencedStaticFields.add(staticField);
+ }
+
void forgetElement(Element element, Compiler compiler) {
allClosures.remove(element);
slowDirectlyNestedClosures(element).forEach(compiler.forgetElement);

Powered by Google App Engine
This is Rietveld 408576698