| 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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 sorted.sort(preSortCompare); | 189 sorted.sort(preSortCompare); |
| 190 } | 190 } |
| 191 sorted.forEach(addConstant); | 191 sorted.forEach(addConstant); |
| 192 return result; | 192 return result; |
| 193 } | 193 } |
| 194 | 194 |
| 195 ConstantValue getInitialValueFor(VariableElement element) { | 195 ConstantValue getInitialValueFor(VariableElement element) { |
| 196 ConstantExpression initialValue = | 196 ConstantExpression initialValue = |
| 197 initialVariableValues[element.declaration]; | 197 initialVariableValues[element.declaration]; |
| 198 if (initialValue == null) { | 198 if (initialValue == null) { |
| 199 compiler.internalError(element, "No initial value for given element."); | 199 reporter.internalError(element, "No initial value for given element."); |
| 200 } | 200 } |
| 201 return getConstantValue(initialValue); | 201 return getConstantValue(initialValue); |
| 202 } | 202 } |
| 203 | 203 |
| 204 ConstantExpression compileNode(Node node, TreeElements elements, | 204 ConstantExpression compileNode(Node node, TreeElements elements, |
| 205 {bool enforceConst: true}) { | 205 {bool enforceConst: true}) { |
| 206 return compileNodeWithDefinitions(node, elements, isConst: enforceConst); | 206 return compileNodeWithDefinitions(node, elements, isConst: enforceConst); |
| 207 } | 207 } |
| 208 | 208 |
| 209 ConstantExpression compileNodeWithDefinitions(Node node, | 209 ConstantExpression compileNodeWithDefinitions(Node node, |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 // TODO(ahe): This doesn't belong here. Rename this class and generalize. | 290 // TODO(ahe): This doesn't belong here. Rename this class and generalize. |
| 291 var closureClassMap = | 291 var closureClassMap = |
| 292 constants.compiler.closureToClassMapper.closureMappingCache | 292 constants.compiler.closureToClassMapper.closureMappingCache |
| 293 .remove(node); | 293 .remove(node); |
| 294 if (closureClassMap != null) { | 294 if (closureClassMap != null) { |
| 295 closureClassMap.removeMyselfFrom( | 295 closureClassMap.removeMyselfFrom( |
| 296 constants.compiler.enqueuer.codegen.universe); | 296 constants.compiler.enqueuer.codegen.universe); |
| 297 } | 297 } |
| 298 } | 298 } |
| 299 } | 299 } |
| OLD | NEW |