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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 ConstantExpression compileConstant(VariableElement element) { | 45 ConstantExpression compileConstant(VariableElement element) { |
46 return measure(() { | 46 return measure(() { |
47 // TODO(het): Only report errors from one of the constant compilers | 47 // TODO(het): Only report errors from one of the constant compilers |
48 ConstantExpression result = dartConstantCompiler.compileConstant(element); | 48 ConstantExpression result = dartConstantCompiler.compileConstant(element); |
49 jsConstantCompiler.compileConstant(element); | 49 jsConstantCompiler.compileConstant(element); |
50 return result; | 50 return result; |
51 }); | 51 }); |
52 } | 52 } |
53 | 53 |
54 @override | 54 @override |
55 void evaluate(ConstantExpression constant) { | 55 void evaluate(Spannable spannable, ConstantExpression constant) { |
56 return measure(() { | 56 return measure(() { |
57 dartConstantCompiler.evaluate(constant); | 57 dartConstantCompiler.evaluate(spannable, constant); |
58 jsConstantCompiler.evaluate(constant); | 58 jsConstantCompiler.evaluate(spannable, constant); |
59 }); | 59 }); |
60 } | 60 } |
61 | 61 |
62 void compileVariable(VariableElement element) { | 62 void compileVariable(VariableElement element) { |
63 measure(() { | 63 measure(() { |
64 jsConstantCompiler.compileVariable(element); | 64 jsConstantCompiler.compileVariable(element); |
65 }); | 65 }); |
66 } | 66 } |
67 | 67 |
68 ConstantExpression compileNode(Node node, TreeElements elements, | 68 ConstantExpression compileNode(Node node, TreeElements elements, |
(...skipping 221 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 |