| 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 js_backend; | 5 part of js_backend; |
| 6 | 6 |
| 7 /// [ConstantCompilerTask] for compilation of constants for the JavaScript | 7 /// [ConstantCompilerTask] for compilation of constants for the JavaScript |
| 8 /// backend. | 8 /// backend. |
| 9 /// | 9 /// |
| 10 /// Since this task needs to distinguish between frontend and backend constants | 10 /// Since this task needs to distinguish between frontend and backend constants |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 } | 106 } |
| 107 | 107 |
| 108 /** | 108 /** |
| 109 * Returns an [Iterable] of static non final fields that need to be | 109 * Returns an [Iterable] of static non final fields that need to be |
| 110 * initialized. The fields list must be evaluated in order since they might | 110 * initialized. The fields list must be evaluated in order since they might |
| 111 * depend on each other. | 111 * depend on each other. |
| 112 */ | 112 */ |
| 113 Iterable<VariableElement> getStaticNonFinalFieldsForEmission() { | 113 Iterable<VariableElement> getStaticNonFinalFieldsForEmission() { |
| 114 return initialVariableValues.keys.where((element) { | 114 return initialVariableValues.keys.where((element) { |
| 115 return element.kind == ElementKind.FIELD && | 115 return element.kind == ElementKind.FIELD && |
| 116 !element.isInstanceMember() && | 116 !element.isInstanceMember && |
| 117 !element.modifiers.isFinal() && | 117 !element.modifiers.isFinal && |
| 118 // The const fields are all either emitted elsewhere or inlined. | 118 // The const fields are all either emitted elsewhere or inlined. |
| 119 !element.modifiers.isConst(); | 119 !element.modifiers.isConst; |
| 120 }); | 120 }); |
| 121 } | 121 } |
| 122 | 122 |
| 123 List<VariableElement> getLazilyInitializedFieldsForEmission() { | 123 List<VariableElement> getLazilyInitializedFieldsForEmission() { |
| 124 return new List<VariableElement>.from(lazyStatics); | 124 return new List<VariableElement>.from(lazyStatics); |
| 125 } | 125 } |
| 126 | 126 |
| 127 /** | 127 /** |
| 128 * Returns a list of constants topologically sorted so that dependencies | 128 * Returns a list of constants topologically sorted so that dependencies |
| 129 * appear before the dependent constant. [preSortCompare] is a comparator | 129 * appear before the dependent constant. [preSortCompare] is a comparator |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 return constant; | 200 return constant; |
| 201 } | 201 } |
| 202 | 202 |
| 203 Constant createTypeConstant(TypeDeclarationElement element) { | 203 Constant createTypeConstant(TypeDeclarationElement element) { |
| 204 DartType elementType = element.rawType; | 204 DartType elementType = element.rawType; |
| 205 DartType constantType = | 205 DartType constantType = |
| 206 compiler.backend.typeImplementation.computeType(compiler); | 206 compiler.backend.typeImplementation.computeType(compiler); |
| 207 return new TypeConstant(elementType, constantType); | 207 return new TypeConstant(elementType, constantType); |
| 208 } | 208 } |
| 209 } | 209 } |
| OLD | NEW |