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 library dart2js.compile_time_constant_evaluator; | 5 library dart2js.compile_time_constant_evaluator; |
6 | 6 |
7 import 'common/tasks.dart' show | 7 import 'common/tasks.dart' show |
8 CompilerTask; | 8 CompilerTask; |
9 import 'compiler.dart' show | 9 import 'compiler.dart' show |
10 Compiler; | 10 Compiler; |
11 import 'constant_system_dart.dart'; | 11 import 'constant_system_dart.dart'; |
12 import 'constants/constant_system.dart'; | 12 import 'constants/constant_system.dart'; |
13 import 'constants/evaluation.dart'; | 13 import 'constants/evaluation.dart'; |
14 import 'constants/expressions.dart'; | 14 import 'constants/expressions.dart'; |
15 import 'constants/values.dart'; | 15 import 'constants/values.dart'; |
16 import 'dart_types.dart'; | 16 import 'dart_types.dart'; |
17 import 'diagnostics/invariant.dart' show | 17 import 'diagnostics/invariant.dart' show |
18 invariant; | 18 invariant; |
| 19 import 'diagnostics/messages.dart' show |
| 20 MessageKind; |
19 import 'enqueue.dart' show | 21 import 'enqueue.dart' show |
20 WorldImpact; | 22 WorldImpact; |
21 import 'elements/elements.dart'; | 23 import 'elements/elements.dart'; |
22 import 'elements/modelx.dart' show FunctionElementX; | 24 import 'elements/modelx.dart' show |
23 import 'messages.dart' show MessageKind; | 25 FunctionElementX; |
24 import 'resolution/resolution.dart'; | 26 import 'resolution/resolution.dart'; |
25 import 'resolution/operators.dart'; | 27 import 'resolution/operators.dart'; |
26 import 'tree/tree.dart'; | 28 import 'tree/tree.dart'; |
27 import 'util/util.dart' show Link; | 29 import 'util/util.dart' show |
28 import 'universe/universe.dart' show CallStructure; | 30 Link; |
| 31 import 'universe/universe.dart' show |
| 32 CallStructure; |
29 | 33 |
30 /// A [ConstantEnvironment] provides access for constants compiled for variable | 34 /// A [ConstantEnvironment] provides access for constants compiled for variable |
31 /// initializers. | 35 /// initializers. |
32 abstract class ConstantEnvironment { | 36 abstract class ConstantEnvironment { |
33 /// The [ConstantSystem] used by this environment. | 37 /// The [ConstantSystem] used by this environment. |
34 ConstantSystem get constantSystem; | 38 ConstantSystem get constantSystem; |
35 | 39 |
36 /// Returns the constant value computed for [expression]. | 40 /// Returns the constant value computed for [expression]. |
37 // TODO(johnniwinther): Support directly evaluation of [expression]. | 41 // TODO(johnniwinther): Support directly evaluation of [expression]. |
38 ConstantValue getConstantValue(ConstantExpression expression); | 42 ConstantValue getConstantValue(ConstantExpression expression); |
(...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1261 class _CompilerEnvironment implements Environment { | 1265 class _CompilerEnvironment implements Environment { |
1262 final Compiler compiler; | 1266 final Compiler compiler; |
1263 | 1267 |
1264 _CompilerEnvironment(this.compiler); | 1268 _CompilerEnvironment(this.compiler); |
1265 | 1269 |
1266 @override | 1270 @override |
1267 String readFromEnvironment(String name) { | 1271 String readFromEnvironment(String name) { |
1268 return compiler.fromEnvironment(name); | 1272 return compiler.fromEnvironment(name); |
1269 } | 1273 } |
1270 } | 1274 } |
OLD | NEW |