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

Unified Diff: pkg/compiler/lib/src/compile_time_constants.dart

Issue 2024873002: Compute non-final static fields without the constant compiler. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/compile_time_constants.dart
diff --git a/pkg/compiler/lib/src/compile_time_constants.dart b/pkg/compiler/lib/src/compile_time_constants.dart
index ab95a9736694f2e03d0a02caf50e5deabf218548..005b1c3df44cc02ddc1d20e71bef2bd2f2e52eff 100644
--- a/pkg/compiler/lib/src/compile_time_constants.dart
+++ b/pkg/compiler/lib/src/compile_time_constants.dart
@@ -145,7 +145,7 @@ abstract class ConstantCompilerBase implements ConstantCompiler {
*
* Invariant: The keys in this map are declarations.
*/
- final Map<VariableElement, ConstantExpression> initialVariableValues =
+ final Map<VariableElement, ConstantExpression> _initialVariableValues =
new Map<VariableElement, ConstantExpression>();
/** The set of variable elements that are in the process of being computed. */
@@ -163,7 +163,7 @@ abstract class ConstantCompilerBase implements ConstantCompiler {
@override
@deprecated
ConstantValue getConstantValueForVariable(VariableElement element) {
- return getConstantValue(initialVariableValues[element.declaration]);
+ return getConstantValue(_initialVariableValues[element.declaration]);
}
ConstantExpression compileConstant(VariableElement element) {
@@ -187,8 +187,8 @@ abstract class ConstantCompilerBase implements ConstantCompiler {
/// report an error if [element] does not typecheck.
ConstantExpression internalCompileVariable(
VariableElement element, bool isConst, bool checkType) {
- if (initialVariableValues.containsKey(element.declaration)) {
- ConstantExpression result = initialVariableValues[element.declaration];
+ if (_initialVariableValues.containsKey(element.declaration)) {
+ ConstantExpression result = _initialVariableValues[element.declaration];
return result;
}
if (element.hasConstant) {
@@ -286,7 +286,7 @@ abstract class ConstantCompilerBase implements ConstantCompiler {
}
if (expression != null) {
element.constant = expression;
- initialVariableValues[element.declaration] = expression;
+ _initialVariableValues[element.declaration] = expression;
} else {
assert(invariant(element, !isConst,
message: "Variable $element does not compile to a constant."));
@@ -333,9 +333,9 @@ abstract class ConstantCompilerBase implements ConstantCompiler {
}
void forgetElement(Element element) {
- initialVariableValues.remove(element);
+ _initialVariableValues.remove(element);
if (element is ScopeContainerElement) {
- element.forEachLocalMember(initialVariableValues.remove);
+ element.forEachLocalMember(_initialVariableValues.remove);
}
if (element is FunctionElement && element.hasFunctionSignature) {
element.functionSignature.forEachParameter(this.forgetElement);
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_backend/constant_handler_javascript.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698