| 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 import '../compile_time_constants.dart'; | 5 import '../compile_time_constants.dart'; |
| 6 import '../compiler.dart' show Compiler; | 6 import '../compiler.dart' show Compiler; |
| 7 import '../constants/constant_system.dart'; | 7 import '../constants/constant_system.dart'; |
| 8 import '../constants/expressions.dart'; | 8 import '../constants/expressions.dart'; |
| 9 import '../constants/values.dart'; | 9 import '../constants/values.dart'; |
| 10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 ConstantExpression constant = | 92 ConstantExpression constant = |
| 93 dartConstantCompiler.compileMetadata(metadata, node, elements); | 93 dartConstantCompiler.compileMetadata(metadata, node, elements); |
| 94 jsConstantCompiler.compileMetadata(metadata, node, elements); | 94 jsConstantCompiler.compileMetadata(metadata, node, elements); |
| 95 return constant; | 95 return constant; |
| 96 }); | 96 }); |
| 97 } | 97 } |
| 98 | 98 |
| 99 // TODO(johnniwinther): Remove this when values are computed from the | 99 // TODO(johnniwinther): Remove this when values are computed from the |
| 100 // expressions. | 100 // expressions. |
| 101 @override | 101 @override |
| 102 void copyConstantValues(JavaScriptConstantTask task) { | 102 void copyConstantValues(covariant JavaScriptConstantTask task) { |
| 103 jsConstantCompiler.constantValueMap | 103 jsConstantCompiler.constantValueMap |
| 104 .addAll(task.jsConstantCompiler.constantValueMap); | 104 .addAll(task.jsConstantCompiler.constantValueMap); |
| 105 dartConstantCompiler.constantValueMap | 105 dartConstantCompiler.constantValueMap |
| 106 .addAll(task.dartConstantCompiler.constantValueMap); | 106 .addAll(task.dartConstantCompiler.constantValueMap); |
| 107 } | 107 } |
| 108 } | 108 } |
| 109 | 109 |
| 110 /** | 110 /** |
| 111 * The [JavaScriptConstantCompiler] is used to keep track of compile-time | 111 * The [JavaScriptConstantCompiler] is used to keep track of compile-time |
| 112 * constants, initializations of global and static fields, and default values of | 112 * constants, initializations of global and static fields, and default values of |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 class ForgetConstantNodeVisitor extends Visitor { | 227 class ForgetConstantNodeVisitor extends Visitor { |
| 228 final JavaScriptConstantCompiler constants; | 228 final JavaScriptConstantCompiler constants; |
| 229 | 229 |
| 230 ForgetConstantNodeVisitor(this.constants); | 230 ForgetConstantNodeVisitor(this.constants); |
| 231 | 231 |
| 232 void visitNode(Node node) { | 232 void visitNode(Node node) { |
| 233 node.visitChildren(this); | 233 node.visitChildren(this); |
| 234 constants.nodeConstantMap.remove(node); | 234 constants.nodeConstantMap.remove(node); |
| 235 } | 235 } |
| 236 } | 236 } |
| OLD | NEW |