| 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 01c596381a30075f99227517986acd5a992b4ca4..a027ced641dbe594cc11f9e4fbb62976e4dc41cd 100644
|
| --- a/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart
|
| +++ b/pkg/compiler/lib/src/js_emitter/code_emitter_task.dart
|
| @@ -27,6 +27,8 @@ class CodeEmitterTask extends CompilerTask {
|
| new Map<OutputUnit, List<ConstantValue>>();
|
| final Map<OutputUnit, List<Element>> outputStaticLists =
|
| new Map<OutputUnit, List<Element>>();
|
| + final Map<OutputUnit, List<VariableElement>> outputStaticNonFinalFieldLists =
|
| + new Map<OutputUnit, List<VariableElement>>();
|
| final Map<OutputUnit, Set<LibraryElement>> outputLibraryLists =
|
| new Map<OutputUnit, Set<LibraryElement>>();
|
|
|
| @@ -360,10 +362,22 @@ class CodeEmitterTask extends CompilerTask {
|
| backend.generatedCode.keys.where(isStaticFunction);
|
|
|
| for (Element element in Elements.sortedByPosition(elements)) {
|
| - outputStaticLists.putIfAbsent(
|
| + List<Element> list = outputStaticLists.putIfAbsent(
|
| compiler.deferredLoadTask.outputUnitForElement(element),
|
| - () => new List<Element>())
|
| - .add(element);
|
| + () => new List<Element>());
|
| + list.add(element);
|
| + }
|
| + }
|
| +
|
| + void computeNeededStaticNonFinalFields() {
|
| + JavaScriptConstantCompiler handler = backend.constants;
|
| + Iterable<VariableElement> staticNonFinalFields =
|
| + handler.getStaticNonFinalFieldsForEmission();
|
| + for (Element element in Elements.sortedByPosition(staticNonFinalFields)) {
|
| + List<VariableElement> list = outputStaticNonFinalFieldLists.putIfAbsent(
|
| + compiler.deferredLoadTask.outputUnitForElement(element),
|
| + () => new List<VariableElement>());
|
| + list.add(element);
|
| }
|
| }
|
|
|
| @@ -387,6 +401,7 @@ class CodeEmitterTask extends CompilerTask {
|
| computeNeededDeclarations();
|
| computeNeededConstants();
|
| computeNeededStatics();
|
| + computeNeededStaticNonFinalFields();
|
| computeNeededLibraries();
|
| }
|
|
|
|
|