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

Unified Diff: pkg/compiler/lib/src/ssa/builder.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/ssa/builder.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index 331c75047831e15448a3896e395374a930ca252f..4853e89cbdc08480a6cbb3021cc8db3d2880a7d9 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -141,7 +141,7 @@ class SsaBuilderTask extends CompilerTask {
signature.forEachOptionalParameter((ParameterElement parameter) {
// This ensures the default value will be computed.
ConstantValue constant =
- backend.constants.getConstantForVariable(parameter).value;
+ backend.constants.getConstantValueForVariable(parameter);
CodegenRegistry registry = work.registry;
registry.registerCompileTimeConstant(constant);
});
@@ -1505,11 +1505,11 @@ class SsaBuilder extends NewResolvedVisitor {
}
HInstruction handleConstantForOptionalParameter(Element parameter) {
- ConstantExpression constant =
- backend.constants.getConstantForVariable(parameter);
- assert(invariant(parameter, constant != null,
+ ConstantValue constantValue =
+ backend.constants.getConstantValueForVariable(parameter);
+ assert(invariant(parameter, constantValue != null,
message: 'No constant computed for $parameter'));
- return graph.addConstant(constant.value, compiler);
+ return graph.addConstant(constantValue, compiler);
}
Element get currentNonClosureClass {
@@ -1545,11 +1545,11 @@ class SsaBuilder extends NewResolvedVisitor {
bool inTryStatement = false;
ConstantValue getConstantForNode(ast.Node node) {
- ConstantExpression constant =
- backend.constants.getConstantForNode(node, elements);
- assert(invariant(node, constant != null,
+ ConstantValue constantValue =
+ backend.constants.getConstantValueForNode(node, elements);
+ assert(invariant(node, constantValue != null,
message: 'No constant computed for $node'));
- return constant.value;
+ return constantValue;
}
HInstruction addConstant(ast.Node node) {
@@ -3310,7 +3310,7 @@ class SsaBuilder extends NewResolvedVisitor {
ast.Send node,
FieldElement field,
ConstantExpression constant) {
- ConstantValue value = constant.value;
+ ConstantValue value = backend.constants.getConstantValue(constant);
HConstant instruction;
// Constants that are referred via a deferred prefix should be referred
// by reference.
« no previous file with comments | « pkg/compiler/lib/src/resolution/resolution_common.dart ('k') | pkg/compiler/lib/src/tree_ir/tree_ir_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698