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

Side by Side Diff: pkg/compiler/lib/src/compile_time_constants.dart

Issue 2857373002: Handle more constants in Constantifier (Closed)
Patch Set: Updated cf. comments. Created 3 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
« no previous file with comments | « no previous file | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 library dart2js.compile_time_constant_evaluator; 5 library dart2js.compile_time_constant_evaluator;
6 6
7 import 'common/resolution.dart' show Resolution; 7 import 'common/resolution.dart' show Resolution;
8 import 'common/tasks.dart' show CompilerTask, Measurer; 8 import 'common/tasks.dart' show CompilerTask, Measurer;
9 import 'common.dart'; 9 import 'common.dart';
10 import 'compiler.dart' show Compiler; 10 import 'compiler.dart' show Compiler;
(...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 class ErroneousAstConstant extends AstConstant { 1435 class ErroneousAstConstant extends AstConstant {
1436 ErroneousAstConstant(Element element, Node node) 1436 ErroneousAstConstant(Element element, Node node)
1437 : super( 1437 : super(
1438 element, 1438 element,
1439 node, 1439 node,
1440 // TODO(johnniwinther): Return a [NonConstantValue] instead. 1440 // TODO(johnniwinther): Return a [NonConstantValue] instead.
1441 new ErroneousConstantExpression(), 1441 new ErroneousConstantExpression(),
1442 new NullConstantValue()); 1442 new NullConstantValue());
1443 } 1443 }
1444 1444
1445 class _CompilerEnvironment implements Environment { 1445 class _CompilerEnvironment implements EvaluationEnvironment {
1446 final Compiler _compiler; 1446 final Compiler _compiler;
1447 1447
1448 _CompilerEnvironment(this._compiler); 1448 _CompilerEnvironment(this._compiler);
1449 1449
1450 @override 1450 @override
1451 CommonElements get commonElements => _compiler.commonElements; 1451 CommonElements get commonElements => _compiler.commonElements;
1452 1452
1453 @override 1453 @override
1454 String readFromEnvironment(String name) { 1454 String readFromEnvironment(String name) {
1455 return _compiler.fromEnvironment(name); 1455 return _compiler.fromEnvironment(name);
(...skipping 13 matching lines...) Expand all
1469 @override 1469 @override
1470 ConstantExpression getFieldConstant(FieldElement field) { 1470 ConstantExpression getFieldConstant(FieldElement field) {
1471 return field.constant; 1471 return field.constant;
1472 } 1472 }
1473 1473
1474 @override 1474 @override
1475 ConstantExpression getLocalConstant(LocalVariableElement local) { 1475 ConstantExpression getLocalConstant(LocalVariableElement local) {
1476 return local.constant; 1476 return local.constant;
1477 } 1477 }
1478 } 1478 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698