| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 if (needsAccessor && backend.isAccessibleByReflection(member)) { | 138 if (needsAccessor && backend.isAccessibleByReflection(member)) { |
| 139 backend.retainMetadataOf(member); | 139 backend.retainMetadataOf(member); |
| 140 } | 140 } |
| 141 }); | 141 }); |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 typedefsNeededForReflection.forEach(backend.retainMetadataOf); | 144 typedefsNeededForReflection.forEach(backend.retainMetadataOf); |
| 145 } | 145 } |
| 146 | 146 |
| 147 JavaScriptConstantCompiler handler = backend.constants; | 147 JavaScriptConstantCompiler handler = backend.constants; |
| 148 List<ConstantValue> constants = handler.getConstantsForEmission( | 148 List<ConstantValue> constants = |
| 149 compiler.options.hasIncrementalSupport | 149 handler.getConstantsForEmission(emitter.compareConstants); |
| 150 ? null | |
| 151 : emitter.compareConstants); | |
| 152 for (ConstantValue constant in constants) { | 150 for (ConstantValue constant in constants) { |
| 153 if (emitter.isConstantInlinedOrAlreadyEmitted(constant)) continue; | 151 if (emitter.isConstantInlinedOrAlreadyEmitted(constant)) continue; |
| 154 | 152 |
| 155 if (constant.isList) outputContainsConstantList = true; | 153 if (constant.isList) outputContainsConstantList = true; |
| 156 | 154 |
| 157 OutputUnit constantUnit = | 155 OutputUnit constantUnit = |
| 158 compiler.deferredLoadTask.outputUnitForConstant(constant); | 156 compiler.deferredLoadTask.outputUnitForConstant(constant); |
| 159 if (constantUnit == null) { | 157 if (constantUnit == null) { |
| 160 // The back-end introduces some constants, like "InterceptorConstant" or | 158 // The back-end introduces some constants, like "InterceptorConstant" or |
| 161 // some list constants. They are emitted in the main output-unit. | 159 // some list constants. They are emitted in the main output-unit. |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 } | 322 } |
| 325 | 323 |
| 326 void collect() { | 324 void collect() { |
| 327 computeNeededDeclarations(); | 325 computeNeededDeclarations(); |
| 328 computeNeededConstants(); | 326 computeNeededConstants(); |
| 329 computeNeededStatics(); | 327 computeNeededStatics(); |
| 330 computeNeededStaticNonFinalFields(); | 328 computeNeededStaticNonFinalFields(); |
| 331 computeNeededLibraries(); | 329 computeNeededLibraries(); |
| 332 } | 330 } |
| 333 } | 331 } |
| OLD | NEW |