| 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 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 return definitions.getConstant(node); | 213 return definitions.getConstant(node); |
| 214 } | 214 } |
| 215 | 215 |
| 216 ConstantValue getConstantValueForMetadata(MetadataAnnotation metadata) { | 216 ConstantValue getConstantValueForMetadata(MetadataAnnotation metadata) { |
| 217 return getConstantValue(metadata.constant); | 217 return getConstantValue(metadata.constant); |
| 218 } | 218 } |
| 219 | 219 |
| 220 @override | 220 @override |
| 221 ConstantExpression compileMetadata( | 221 ConstantExpression compileMetadata( |
| 222 MetadataAnnotation metadata, Node node, TreeElements elements) { | 222 MetadataAnnotation metadata, Node node, TreeElements elements) { |
| 223 ConstantExpression constant = | 223 ConstantExpression constant = |
| 224 super.compileMetadata(metadata, node, elements); | 224 super.compileMetadata(metadata, node, elements); |
| 225 metadataConstantMap[metadata] = constant; | 225 metadataConstantMap[metadata] = constant; |
| 226 return constant; | 226 return constant; |
| 227 } | 227 } |
| 228 | 228 |
| 229 void forgetElement(Element element) { | 229 void forgetElement(Element element) { |
| 230 super.forgetElement(element); | 230 super.forgetElement(element); |
| 231 const ForgetConstantElementVisitor().visit(element, this); | 231 const ForgetConstantElementVisitor().visit(element, this); |
| 232 if (element is AstElement && element.hasNode) { | 232 if (element is AstElement && element.hasNode) { |
| 233 element.node.accept(new ForgetConstantNodeVisitor(this)); | 233 element.node.accept(new ForgetConstantNodeVisitor(this)); |
| 234 } | 234 } |
| 235 } | 235 } |
| 236 } | 236 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 // TODO(ahe): This doesn't belong here. Rename this class and generalize. | 269 // TODO(ahe): This doesn't belong here. Rename this class and generalize. |
| 270 var closureClassMap = constants | 270 var closureClassMap = constants |
| 271 .compiler.closureToClassMapper.closureMappingCache | 271 .compiler.closureToClassMapper.closureMappingCache |
| 272 .remove(node); | 272 .remove(node); |
| 273 if (closureClassMap != null) { | 273 if (closureClassMap != null) { |
| 274 closureClassMap | 274 closureClassMap |
| 275 .removeMyselfFrom(constants.compiler.enqueuer.codegen.universe); | 275 .removeMyselfFrom(constants.compiler.enqueuer.codegen.universe); |
| 276 } | 276 } |
| 277 } | 277 } |
| 278 } | 278 } |
| OLD | NEW |