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

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

Issue 1955403002: Skip spurious constants in deferred computation. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. 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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
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);
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) {
469 return constantCompiler.hasConstantValue(expression);
470 }
471
472 @override
468 ConstantValue getConstantValue(ConstantExpression expression) { 473 ConstantValue getConstantValue(ConstantExpression expression) {
469 return constantCompiler.getConstantValue(expression); 474 return constantCompiler.getConstantValue(expression);
470 } 475 }
471 476
472 @override 477 @override
473 ConstantValue getConstantValueForVariable(VariableElement element) { 478 ConstantValue getConstantValueForVariable(VariableElement element) {
474 return constantCompiler.getConstantValueForVariable(element); 479 return constantCompiler.getConstantValueForVariable(element);
475 } 480 }
476 481
477 @override 482 @override
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 } 534 }
530 535
531 // TODO(johnniwinther): Remove this when values are computed from the 536 // TODO(johnniwinther): Remove this when values are computed from the
532 // expressions. 537 // expressions.
533 @override 538 @override
534 void copyConstantValues(DartConstantTask task) { 539 void copyConstantValues(DartConstantTask task) {
535 constantCompiler.constantValueMap 540 constantCompiler.constantValueMap
536 .addAll(task.constantCompiler.constantValueMap); 541 .addAll(task.constantCompiler.constantValueMap);
537 } 542 }
538 } 543 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/constants/expressions.dart ('k') | pkg/compiler/lib/src/deferred_load.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698