Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: pkg/compiler/lib/src/dart_backend/backend.dart

Issue 2000323006: Make CompilerTask independent of compiler. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698