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

Side by Side Diff: pkg/compiler/lib/src/constants/evaluation.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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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.constants.evaluation; 5 library dart2js.constants.evaluation;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common_elements.dart' show CommonElements; 8 import '../common_elements.dart' show CommonElements;
9 import '../elements/entities.dart'; 9 import '../elements/entities.dart';
10 import '../elements/types.dart'; 10 import '../elements/types.dart';
11 import '../universe/call_structure.dart' show CallStructure; 11 import '../universe/call_structure.dart' show CallStructure;
12 import 'constructors.dart'; 12 import 'constructors.dart';
13 import 'expressions.dart'; 13 import 'expressions.dart';
14 14
15 /// Environment used for evaluating constant expressions. 15 /// Environment used for evaluating constant expressions.
16 abstract class Environment { 16 abstract class EvaluationEnvironment {
17 CommonElements get commonElements; 17 CommonElements get commonElements;
18 18
19 /// Read environments string passed in using the '-Dname=value' option. 19 /// Read environments string passed in using the '-Dname=value' option.
20 String readFromEnvironment(String name); 20 String readFromEnvironment(String name);
21 21
22 /// Returns the [ConstantExpression] for the value of the constant [local]. 22 /// Returns the [ConstantExpression] for the value of the constant [local].
23 ConstantExpression getLocalConstant(Local local); 23 ConstantExpression getLocalConstant(Local local);
24 24
25 /// Returns the [ConstantExpression] for the value of the constant [field]. 25 /// Returns the [ConstantExpression] for the value of the constant [field].
26 ConstantExpression getFieldConstant(FieldEntity field); 26 ConstantExpression getFieldConstant(FieldEntity field);
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 if (needsComma) { 100 if (needsComma) {
101 sb.write(','); 101 sb.write(',');
102 } 102 }
103 sb.write(value.toStructuredText()); 103 sb.write(value.toStructuredText());
104 needsComma = true; 104 needsComma = true;
105 }); 105 });
106 sb.write(']]'); 106 sb.write(']]');
107 return sb.toString(); 107 return sb.toString();
108 } 108 }
109 } 109 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/constants/constructors.dart ('k') | pkg/compiler/lib/src/constants/expressions.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698