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

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

Issue 142193005: Fix JS-backend when MirrorsUsed target a static field, but there is no mirrors usage. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update copyright year. Created 6 years, 11 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: sdk/lib/_internal/compiler/implementation/enqueue.dart
diff --git a/sdk/lib/_internal/compiler/implementation/enqueue.dart b/sdk/lib/_internal/compiler/implementation/enqueue.dart
index 2be6abeb486337fa71450992c874c55211d9d12b..f4ee00c4b978e1839a4aab63d3a1126659b6bac5 100644
--- a/sdk/lib/_internal/compiler/implementation/enqueue.dart
+++ b/sdk/lib/_internal/compiler/implementation/enqueue.dart
@@ -85,7 +85,7 @@ abstract class Enqueuer {
EnqueueTask task;
native.NativeEnqueuer nativeEnqueuer; // Set by EnqueueTask
- bool hasEnqueuedEverything = false;
+ bool hasEnqueuedReflectiveElements = false;
Enqueuer(this.name, this.compiler, this.itemCompilationContextCreator);
@@ -359,7 +359,7 @@ abstract class Enqueuer {
}
void enqueueEverything() {
- if (hasEnqueuedEverything) return;
+ if (hasEnqueuedReflectiveElements) return;
compiler.log('Enqueuing everything');
task.ensureAllElementsByName();
for (Link link in task.allElementsByName.values) {
@@ -367,7 +367,17 @@ abstract class Enqueuer {
pretendElementWasUsed(element, compiler.globalDependencies);
}
}
- hasEnqueuedEverything = true;
+ hasEnqueuedReflectiveElements = true;
+ }
+
+ /// Enqueue the static fields that have been marked as used by reflective
+ /// usage through `MirrorsUsed`.
+ void enqueueReflectiveStaticFields(Iterable<Element> elements) {
+ if (hasEnqueuedReflectiveElements) return;
+ hasEnqueuedReflectiveElements = true;
+ for (Element element in elements) {
+ pretendElementWasUsed(element, compiler.globalDependencies);
+ }
}
processLink(Map<String, Link<Element>> map,

Powered by Google App Engine
This is Rietveld 408576698