| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of dart2js.js_emitter; | 5 part of dart2js.js_emitter; |
| 6 | 6 |
| 7 | 7 |
| 8 class OldEmitter implements Emitter { | 8 class OldEmitter implements Emitter { |
| 9 final Compiler compiler; | 9 final Compiler compiler; |
| 10 final CodeEmitterTask task; | 10 final CodeEmitterTask task; |
| (...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 } | 763 } |
| 764 | 764 |
| 765 void emitStaticNonFinalFieldInitializations(CodeBuffer buffer, | 765 void emitStaticNonFinalFieldInitializations(CodeBuffer buffer, |
| 766 OutputUnit outputUnit) { | 766 OutputUnit outputUnit) { |
| 767 JavaScriptConstantCompiler handler = backend.constants; | 767 JavaScriptConstantCompiler handler = backend.constants; |
| 768 Iterable<VariableElement> staticNonFinalFields = | 768 Iterable<VariableElement> staticNonFinalFields = |
| 769 handler.getStaticNonFinalFieldsForEmission(); | 769 handler.getStaticNonFinalFieldsForEmission(); |
| 770 for (Element element in Elements.sortedByPosition(staticNonFinalFields)) { | 770 for (Element element in Elements.sortedByPosition(staticNonFinalFields)) { |
| 771 // [:interceptedNames:] is handled in [emitInterceptedNames]. | 771 // [:interceptedNames:] is handled in [emitInterceptedNames]. |
| 772 if (element == backend.interceptedNames) continue; | 772 if (element == backend.interceptedNames) continue; |
| 773 // `mapTypeToInterceptor` is handled in [emitMapTypeToInterceptor]. | |
| 774 if (element == backend.mapTypeToInterceptor) continue; | |
| 775 compiler.withCurrentElement(element, () { | 773 compiler.withCurrentElement(element, () { |
| 776 jsAst.Expression initialValue; | 774 jsAst.Expression initialValue; |
| 777 if (outputUnit != | 775 if (outputUnit != |
| 778 compiler.deferredLoadTask.outputUnitForElement(element)) { | 776 compiler.deferredLoadTask.outputUnitForElement(element)) { |
| 779 if (outputUnit == compiler.deferredLoadTask.mainOutputUnit) { | 777 if (outputUnit == compiler.deferredLoadTask.mainOutputUnit) { |
| 780 // In the main output-unit we output a stub initializer for deferred | 778 // In the main output-unit we output a stub initializer for deferred |
| 781 // variables, such that `isolateProperties` stays a fast object. | 779 // variables, such that `isolateProperties` stays a fast object. |
| 782 initialValue = jsAst.number(0); | 780 initialValue = jsAst.number(0); |
| 783 } else { | 781 } else { |
| 784 // Don't output stubs outside the main output file. | 782 // Don't output stubs outside the main output file. |
| (...skipping 1248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2033 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { | 2031 for (Element element in compiler.enqueuer.codegen.newlyEnqueuedElements) { |
| 2034 if (element.isInstanceMember) { | 2032 if (element.isInstanceMember) { |
| 2035 cachedClassBuilders.remove(element.enclosingClass); | 2033 cachedClassBuilders.remove(element.enclosingClass); |
| 2036 | 2034 |
| 2037 nativeEmitter.cachedBuilders.remove(element.enclosingClass); | 2035 nativeEmitter.cachedBuilders.remove(element.enclosingClass); |
| 2038 | 2036 |
| 2039 } | 2037 } |
| 2040 } | 2038 } |
| 2041 } | 2039 } |
| 2042 } | 2040 } |
| OLD | NEW |