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.dart'; | 7 import 'common.dart'; |
8 import 'common/resolution.dart' show Resolution; | 8 import 'common/resolution.dart' show Resolution; |
9 import 'common/tasks.dart' show CompilerTask, Measurer; | 9 import 'common/tasks.dart' show CompilerTask, Measurer; |
10 import 'compiler.dart' show Compiler; | 10 import 'compiler.dart' show Compiler; |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 /// Depending on implementation, the constant might be stored in [elements]. | 97 /// Depending on implementation, the constant might be stored in [elements]. |
98 ConstantValue getConstantValueForNode(Node node, TreeElements elements); | 98 ConstantValue getConstantValueForNode(Node node, TreeElements elements); |
99 | 99 |
100 /// Returns the compile-time constant associated with [node]. | 100 /// Returns the compile-time constant associated with [node]. |
101 /// | 101 /// |
102 /// Depending on implementation, the constant might be stored in [elements]. | 102 /// Depending on implementation, the constant might be stored in [elements]. |
103 ConstantExpression getConstantForNode(Node node, TreeElements elements); | 103 ConstantExpression getConstantForNode(Node node, TreeElements elements); |
104 | 104 |
105 /// Returns the compile-time constant value of [metadata]. | 105 /// Returns the compile-time constant value of [metadata]. |
106 ConstantValue getConstantValueForMetadata(MetadataAnnotation metadata); | 106 ConstantValue getConstantValueForMetadata(MetadataAnnotation metadata); |
| 107 |
| 108 /// Register that [element] needs lazy initialization. |
| 109 void registerLazyStatic(FieldElement element); |
107 } | 110 } |
108 | 111 |
109 /// Interface for the task that compiles the constant environments for the | 112 /// Interface for the task that compiles the constant environments for the |
110 /// frontend and backend interpretation of compile-time constants. | 113 /// frontend and backend interpretation of compile-time constants. |
111 abstract class ConstantCompilerTask extends CompilerTask | 114 abstract class ConstantCompilerTask extends CompilerTask |
112 implements ConstantCompiler { | 115 implements ConstantCompiler { |
113 ConstantCompilerTask(Measurer measurer) : super(measurer); | 116 ConstantCompilerTask(Measurer measurer) : super(measurer); |
114 | 117 |
115 /// Copy all cached constant values from [task]. | 118 /// Copy all cached constant values from [task]. |
116 /// | 119 /// |
(...skipping 1246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1363 class _CompilerEnvironment implements Environment { | 1366 class _CompilerEnvironment implements Environment { |
1364 final Compiler compiler; | 1367 final Compiler compiler; |
1365 | 1368 |
1366 _CompilerEnvironment(this.compiler); | 1369 _CompilerEnvironment(this.compiler); |
1367 | 1370 |
1368 @override | 1371 @override |
1369 String readFromEnvironment(String name) { | 1372 String readFromEnvironment(String name) { |
1370 return compiler.fromEnvironment(name); | 1373 return compiler.fromEnvironment(name); |
1371 } | 1374 } |
1372 } | 1375 } |
OLD | NEW |