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

Unified Diff: pkg/compiler/lib/src/js_emitter/code_emitter_task.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/js_emitter/code_emitter_task.dart
diff --git a/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart b/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart
index 23c282ef27df1b22a462335d8bc06a5621aa5c12..59fe76ae18539aa14655ccfd8bffa0443f91e259 100644
--- a/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart
+++ b/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart
@@ -10,7 +10,7 @@ const USE_NEW_EMITTER = const bool.fromEnvironment("dart2js.use.new.emitter");
* Generates the code for all used classes in the program. Static fields (even
* in classes) are ignored, since they can be treated as non-class elements.
*
- * The code for the containing (used) methods must exist in the [:universe:].
+ * The code for the containing (used) methods must exist in the `universe`.
*/
class CodeEmitterTask extends CompilerTask {
// TODO(floitsch): the code-emitter task should not need a namer.
@@ -363,8 +363,9 @@ class CodeEmitterTask extends CompilerTask {
void computeNeededStaticNonFinalFields() {
JavaScriptConstantCompiler handler = backend.constants;
- Iterable<VariableElement> staticNonFinalFields =
- handler.getStaticNonFinalFieldsForEmission();
+ Iterable<VariableElement> staticNonFinalFields = handler
+ .getStaticNonFinalFieldsForEmission()
+ .where(compiler.codegenWorld.allReferencedStaticFields.contains);
for (Element element in Elements.sortedByPosition(staticNonFinalFields)) {
List<VariableElement> list = outputStaticNonFinalFieldLists.putIfAbsent(
compiler.deferredLoadTask.outputUnitForElement(element),

Powered by Google App Engine
This is Rietveld 408576698