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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 /// [ConstantCompilerTask] for compilation of constants for the Dart backend. | 450 /// [ConstantCompilerTask] for compilation of constants for the Dart backend. |
451 /// | 451 /// |
452 /// Since this task needs no distinction between frontend and backend constants | 452 /// Since this task needs no distinction between frontend and backend constants |
453 /// it also serves as the [BackendConstantEnvironment]. | 453 /// it also serves as the [BackendConstantEnvironment]. |
454 class DartConstantTask extends ConstantCompilerTask | 454 class DartConstantTask extends ConstantCompilerTask |
455 implements BackendConstantEnvironment { | 455 implements BackendConstantEnvironment { |
456 final DartConstantCompiler constantCompiler; | 456 final DartConstantCompiler constantCompiler; |
457 | 457 |
458 DartConstantTask(Compiler compiler) | 458 DartConstantTask(Compiler compiler) |
459 : this.constantCompiler = new DartConstantCompiler(compiler), | 459 : this.constantCompiler = new DartConstantCompiler(compiler), |
460 super(compiler); | 460 super(compiler.measurer); |
461 | 461 |
462 String get name => 'ConstantHandler'; | 462 String get name => 'ConstantHandler'; |
463 | 463 |
464 @override | 464 @override |
465 ConstantSystem get constantSystem => constantCompiler.constantSystem; | 465 ConstantSystem get constantSystem => constantCompiler.constantSystem; |
466 | 466 |
467 @override | 467 @override |
468 bool hasConstantValue(ConstantExpression expression) { | 468 bool hasConstantValue(ConstantExpression expression) { |
469 return constantCompiler.hasConstantValue(expression); | 469 return constantCompiler.hasConstantValue(expression); |
470 } | 470 } |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 } | 534 } |
535 | 535 |
536 // TODO(johnniwinther): Remove this when values are computed from the | 536 // TODO(johnniwinther): Remove this when values are computed from the |
537 // expressions. | 537 // expressions. |
538 @override | 538 @override |
539 void copyConstantValues(DartConstantTask task) { | 539 void copyConstantValues(DartConstantTask task) { |
540 constantCompiler.constantValueMap | 540 constantCompiler.constantValueMap |
541 .addAll(task.constantCompiler.constantValueMap); | 541 .addAll(task.constantCompiler.constantValueMap); |
542 } | 542 } |
543 } | 543 } |
OLD | NEW |