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

Unified Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 1919143002: Store constant variable initializers in elements. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 8 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 | « pkg/compiler/lib/src/serialization/modelz.dart ('k') | pkg/compiler/lib/src/typechecker.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 acfdef0c593cfa9dd1a5584a23e21aec41480846..e9279711efb5275bce6ddfbd5dc559f8e7c360b7 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -123,7 +123,7 @@ class SsaBuilderTask extends CompilerTask {
signature.forEachOptionalParameter((ParameterElement parameter) {
// This ensures the default value will be computed.
ConstantValue constant =
- backend.constants.getConstantValueForVariable(parameter);
+ backend.constants.getConstantValue(parameter.constant);
work.registry.registerCompileTimeConstant(constant);
});
}
@@ -1595,9 +1595,9 @@ class SsaBuilder extends ast.Visitor
HInstruction handleConstantForOptionalParameterJsInterop(Element parameter) =>
null;
- HInstruction handleConstantForOptionalParameter(Element parameter) {
+ HInstruction handleConstantForOptionalParameter(ParameterElement parameter) {
ConstantValue constantValue =
- backend.constants.getConstantValueForVariable(parameter);
+ backend.constants.getConstantValue(parameter.constant);
assert(invariant(parameter, constantValue != null,
message: 'No constant computed for $parameter'));
return graph.addConstant(constantValue, compiler);
@@ -3505,8 +3505,7 @@ class SsaBuilder extends ast.Visitor
/// Read a static or top level [field].
void generateStaticFieldGet(ast.Send node, FieldElement field) {
- ConstantExpression constant =
- backend.constants.getConstantForVariable(field);
+ ConstantExpression constant = field.constant;
SourceInformation sourceInformation =
sourceInformationBuilder.buildGet(node);
if (constant != null) {
« no previous file with comments | « pkg/compiler/lib/src/serialization/modelz.dart ('k') | pkg/compiler/lib/src/typechecker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698