OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 dart_backend; | 5 part of dart_backend; |
6 | 6 |
7 // TODO(ahe): This class is simply wrong. This backend should use | 7 // TODO(ahe): This class is simply wrong. This backend should use |
8 // elements when it can, not AST nodes. Perhaps a [Map<Element, | 8 // elements when it can, not AST nodes. Perhaps a [Map<Element, |
9 // TreeElements>] is what is needed. | 9 // TreeElements>] is what is needed. |
10 class ElementAst { | 10 class ElementAst { |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 } | 515 } |
516 | 516 |
517 @override | 517 @override |
518 ConstantExpression compileConstant(VariableElement element) { | 518 ConstantExpression compileConstant(VariableElement element) { |
519 return measure(() { | 519 return measure(() { |
520 return constantCompiler.compileConstant(element); | 520 return constantCompiler.compileConstant(element); |
521 }); | 521 }); |
522 } | 522 } |
523 | 523 |
524 @override | 524 @override |
525 void evaluate(ConstantExpression constant) { | 525 void evaluate(Spannable spannable, ConstantExpression constant) { |
526 return measure(() { | 526 return measure(() { |
527 return constantCompiler.evaluate(constant); | 527 return constantCompiler.evaluate(spannable, constant); |
528 }); | 528 }); |
529 } | 529 } |
530 | 530 |
531 void compileVariable(VariableElement element) { | 531 void compileVariable(VariableElement element) { |
532 measure(() { | 532 measure(() { |
533 constantCompiler.compileVariable(element); | 533 constantCompiler.compileVariable(element); |
534 }); | 534 }); |
535 } | 535 } |
536 | 536 |
537 @override | 537 @override |
(...skipping 18 matching lines...) Expand all Loading... |
556 } | 556 } |
557 | 557 |
558 // TODO(johnniwinther): Remove this when values are computed from the | 558 // TODO(johnniwinther): Remove this when values are computed from the |
559 // expressions. | 559 // expressions. |
560 @override | 560 @override |
561 void copyConstantValues(DartConstantTask task) { | 561 void copyConstantValues(DartConstantTask task) { |
562 constantCompiler.constantValueMap.addAll( | 562 constantCompiler.constantValueMap.addAll( |
563 task.constantCompiler.constantValueMap); | 563 task.constantCompiler.constantValueMap); |
564 } | 564 } |
565 } | 565 } |
OLD | NEW |