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

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

Issue 2550323002: Insert default arguments for static calls and constructor calls. (Closed)
Patch Set: Created 4 years 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/kernel_ast_adapter.dart
diff --git a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
index 7b4ab9b7967e3109093ef86a6f706a3b3feb1f8c..1343be0b2db2003b3c9b5bd14a5f6ce701885117 100644
--- a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
+++ b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
@@ -292,6 +292,19 @@ class KernelAstAdapter {
return constantValue;
}
+ ConstantValue getConstantForParameterDefaultValue(ir.Node defaultExpression) {
+ // TODO(27394): Evaluate constant expressions in ir.Node domain.
+ // In the interim, expand the Constantifier and do this:
+ //
+ // ConstantExpression constantExpression =
+ // defaultExpression.accept(new Constantifier(this));
+ // assert(constantExpression != null);
+ ConstantExpression constantExpression =
+ kernel.parameterInitializerNodeToConstant[defaultExpression];
+ if (constantExpression == null) return null;
+ return _backend.constants.getConstantValue(constantExpression);
+ }
+
ConstantValue getConstantForType(ir.DartType irType) {
DartType type = getDartType(irType);
return _backend.constantSystem.createType(_compiler, type.asRaw());
« pkg/compiler/lib/src/ssa/builder_kernel.dart ('K') | « pkg/compiler/lib/src/ssa/builder_kernel.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698