| 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 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 return getConstantValue(metadata.constant); | 475 return getConstantValue(metadata.constant); |
| 476 } | 476 } |
| 477 | 477 |
| 478 @override | 478 @override |
| 479 ConstantExpression compileConstant(VariableElement element) { | 479 ConstantExpression compileConstant(VariableElement element) { |
| 480 return measure(() { | 480 return measure(() { |
| 481 return constantCompiler.compileConstant(element); | 481 return constantCompiler.compileConstant(element); |
| 482 }); | 482 }); |
| 483 } | 483 } |
| 484 | 484 |
| 485 @override |
| 486 void evaluate(ConstantExpression constant) { |
| 487 return measure(() { |
| 488 return constantCompiler.evaluate(constant); |
| 489 }); |
| 490 } |
| 491 |
| 485 void compileVariable(VariableElement element) { | 492 void compileVariable(VariableElement element) { |
| 486 measure(() { | 493 measure(() { |
| 487 constantCompiler.compileVariable(element); | 494 constantCompiler.compileVariable(element); |
| 488 }); | 495 }); |
| 489 } | 496 } |
| 490 | 497 |
| 491 @override | 498 @override |
| 492 ConstantExpression compileNode( | 499 ConstantExpression compileNode( |
| 493 Node node, | 500 Node node, |
| 494 TreeElements elements, | 501 TreeElements elements, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 510 } | 517 } |
| 511 | 518 |
| 512 // TODO(johnniwinther): Remove this when values are computed from the | 519 // TODO(johnniwinther): Remove this when values are computed from the |
| 513 // expressions. | 520 // expressions. |
| 514 @override | 521 @override |
| 515 void copyConstantValues(DartConstantTask task) { | 522 void copyConstantValues(DartConstantTask task) { |
| 516 constantCompiler.constantValueMap.addAll( | 523 constantCompiler.constantValueMap.addAll( |
| 517 task.constantCompiler.constantValueMap); | 524 task.constantCompiler.constantValueMap); |
| 518 } | 525 } |
| 519 } | 526 } |
| OLD | NEW |