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

Unified Diff: pkg/compiler/lib/src/dart_backend/backend.dart

Issue 1148343004: Remove ConstantExpression.value (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Update comments. Created 5 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
Index: pkg/compiler/lib/src/dart_backend/backend.dart
diff --git a/pkg/compiler/lib/src/dart_backend/backend.dart b/pkg/compiler/lib/src/dart_backend/backend.dart
index 78aaeba6d7b317b34d70c266191b03b703888110..7ac9d670fb4ffcf288f1988053f82ef07664d2b2 100644
--- a/pkg/compiler/lib/src/dart_backend/backend.dart
+++ b/pkg/compiler/lib/src/dart_backend/backend.dart
@@ -424,18 +424,41 @@ class DartConstantTask extends ConstantCompilerTask
String get name => 'ConstantHandler';
+ @override
+ ConstantSystem get constantSystem => constantCompiler.constantSystem;
+
+ @override
+ ConstantValue getConstantValue(ConstantExpression expression) {
+ return constantCompiler.getConstantValue(expression);
+ }
+
+ @override
+ ConstantValue getConstantValueForVariable(VariableElement element) {
+ return constantCompiler.getConstantValueForVariable(element);
+ }
+
+ @override
ConstantExpression getConstantForVariable(VariableElement element) {
return constantCompiler.getConstantForVariable(element);
}
+ @override
ConstantExpression getConstantForNode(Node node, TreeElements elements) {
return constantCompiler.getConstantForNode(node, elements);
}
- ConstantExpression getConstantForMetadata(MetadataAnnotation metadata) {
- return metadata.constant;
+ @override
+ ConstantValue getConstantValueForNode(Node node, TreeElements elements) {
+ return getConstantValue(
+ constantCompiler.getConstantForNode(node, elements));
}
+ @override
+ ConstantValue getConstantValueForMetadata(MetadataAnnotation metadata) {
+ return getConstantValue(metadata.constant);
+ }
+
+ @override
ConstantExpression compileConstant(VariableElement element) {
return measure(() {
return constantCompiler.compileConstant(element);
@@ -448,21 +471,34 @@ class DartConstantTask extends ConstantCompilerTask
});
}
- ConstantExpression compileNode(Node node, TreeElements elements,
- {bool enforceConst: true}) {
+ @override
+ ConstantExpression compileNode(
+ Node node,
+ TreeElements elements,
+ {bool enforceConst: true}) {
return measure(() {
return constantCompiler.compileNodeWithDefinitions(node, elements,
isConst: enforceConst);
});
}
- ConstantExpression compileMetadata(MetadataAnnotation metadata,
- Node node,
- TreeElements elements) {
+ @override
+ ConstantExpression compileMetadata(
+ MetadataAnnotation metadata,
+ Node node,
+ TreeElements elements) {
return measure(() {
return constantCompiler.compileMetadata(metadata, node, elements);
});
}
+
+ // TODO(johnniwinther): Remove this when values are computed from the
+ // expressions.
+ @override
+ void copyConstantValues(DartConstantTask task) {
+ constantCompiler.constantValueMap.addAll(
+ task.constantCompiler.constantValueMap);
+ }
}
abstract class ElementAstCreationContext {
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/type_propagation.dart ('k') | pkg/compiler/lib/src/dart_backend/dart_backend.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698