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

Unified Diff: dart/sdk/lib/_internal/compiler/implementation/constants.dart

Issue 21110003: Implement MirrorUsed.targets for libraries (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r25609 and added test. Created 7 years, 5 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: dart/sdk/lib/_internal/compiler/implementation/constants.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/constants.dart b/dart/sdk/lib/_internal/compiler/implementation/constants.dart
index 5e3a42942ea87b667f53b0d0062b0e1fb72eb5b9..4ff011ccd77651823df56bc82d548abf3de51400 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/constants.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/constants.dart
@@ -485,4 +485,15 @@ class ConstructedConstant extends ObjectConstant {
List<Constant> getDependencies() => fields;
accept(ConstantVisitor visitor) => visitor.visitConstructed(this);
+
+ Map<Element, Constant> get fieldElements {
+ // TODO(ahe): Refactor constant system to store this information directly.
+ ClassElement classElement = type.element;
+ int count = 0;
+ Map<Element, Constant> result = new Map<Element, Constant>();
+ classElement.implementation.forEachInstanceField((holder, field) {
+ result[field] = fields[count++];
+ }, includeSuperAndInjectedMembers: true);
+ return result;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698