| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.program_builder; | 5 part of dart2js.js_emitter.program_builder; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Generates the code for all used classes in the program. Static fields (even | 8 * Generates the code for all used classes in the program. Static fields (even |
| 9 * in classes) are ignored, since they can be treated as non-class elements. | 9 * in classes) are ignored, since they can be treated as non-class elements. |
| 10 * | 10 * |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 backend.retainMetadataOf(member); | 141 backend.retainMetadataOf(member); |
| 142 } | 142 } |
| 143 }); | 143 }); |
| 144 } | 144 } |
| 145 } | 145 } |
| 146 typedefsNeededForReflection.forEach(backend.retainMetadataOf); | 146 typedefsNeededForReflection.forEach(backend.retainMetadataOf); |
| 147 } | 147 } |
| 148 | 148 |
| 149 JavaScriptConstantCompiler handler = backend.constants; | 149 JavaScriptConstantCompiler handler = backend.constants; |
| 150 List<ConstantValue> constants = handler.getConstantsForEmission( | 150 List<ConstantValue> constants = handler.getConstantsForEmission( |
| 151 compiler.hasIncrementalSupport ? null : emitter.compareConstants); | 151 compiler.options.hasIncrementalSupport ? null |
| 152 : emitter.compareConstants); |
| 152 for (ConstantValue constant in constants) { | 153 for (ConstantValue constant in constants) { |
| 153 if (emitter.isConstantInlinedOrAlreadyEmitted(constant)) continue; | 154 if (emitter.isConstantInlinedOrAlreadyEmitted(constant)) continue; |
| 154 | 155 |
| 155 if (constant.isList) outputContainsConstantList = true; | 156 if (constant.isList) outputContainsConstantList = true; |
| 156 | 157 |
| 157 OutputUnit constantUnit = | 158 OutputUnit constantUnit = |
| 158 compiler.deferredLoadTask.outputUnitForConstant(constant); | 159 compiler.deferredLoadTask.outputUnitForConstant(constant); |
| 159 if (constantUnit == null) { | 160 if (constantUnit == null) { |
| 160 // The back-end introduces some constants, like "InterceptorConstant" or | 161 // The back-end introduces some constants, like "InterceptorConstant" or |
| 161 // some list constants. They are emitted in the main output-unit. | 162 // some list constants. They are emitted in the main output-unit. |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 neededClasses.forEach(addSurroundingLibraryToSet); | 308 neededClasses.forEach(addSurroundingLibraryToSet); |
| 308 } | 309 } |
| 309 | 310 |
| 310 void collect() { | 311 void collect() { |
| 311 computeNeededDeclarations(); | 312 computeNeededDeclarations(); |
| 312 computeNeededConstants(); | 313 computeNeededConstants(); |
| 313 computeNeededStatics(); | 314 computeNeededStatics(); |
| 314 computeNeededStaticNonFinalFields(); | 315 computeNeededStaticNonFinalFields(); |
| 315 computeNeededLibraries(); | 316 computeNeededLibraries(); |
| 316 } | 317 } |
| 317 } | 318 } |
| OLD | NEW |