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

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

Issue 2630743002: Remove use of FunctionSignature et al from call_structure.dart (Closed)
Patch Set: Created 3 years, 11 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/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 9d2d6db06c64b18b3f30a3fbb16895835ab93273..82459f35510892723bc5fc52b7e57a535f2756b7 100644
--- a/pkg/compiler/lib/src/compile_time_constants.dart
+++ b/pkg/compiler/lib/src/compile_time_constants.dart
@@ -865,8 +865,7 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
target.computeType(resolution);
- FunctionSignature signature = target.functionSignature;
- if (!callStructure.signatureApplies(signature)) {
+ if (!callStructure.signatureApplies(target.type)) {
String name = Elements.constructorNameForDiagnostics(
target.enclosingClass.name, target.name);
reporter.reportErrorMessage(node,
@@ -876,8 +875,8 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
target.functionSignature.parameterCount,
new ErroneousAstConstant(context, node));
}
- return callStructure.makeArgumentsList(
- arguments, target, compileArgument, compileDefaultValue);
+ return Elements.makeArgumentsList<AstConstant>(
+ callStructure, arguments, target, compileArgument, compileDefaultValue);
}
AstConstant visitNewExpression(NewExpression node) {
@@ -1113,7 +1112,7 @@ class CompileTimeConstantEvaluator extends Visitor<AstConstant> {
}
assert(invariant(
node,
- callStructure.signatureApplies(constructor.functionSignature) ||
+ callStructure.signatureApplies(constructor.type) ||
compiler.compilationFailed,
message: "Call structure $callStructure does not apply to constructor "
"$constructor."));
@@ -1295,10 +1294,10 @@ class ConstructorEvaluator extends CompileTimeConstantEvaluator {
Function compileArgument = (element) => definitions[element];
Function compileConstant = handler.compileConstant;
FunctionElement target = constructor.definingConstructor.implementation;
- CallStructure.addForwardingElementArgumentsToList(constructor,
+ Elements.addForwardingElementArgumentsToList<AstConstant>(constructor,
compiledArguments, target, compileArgument, compileConstant);
- CallStructure callStructure =
- new CallStructure.fromSignature(target.functionSignature);
+ CallStructure callStructure = new CallStructure(
+ target.functionSignature.parameterCount, target.type.namedParameters);
Siggi Cherem (dart-lang) 2017/01/13 17:11:07 do we want to also get rid of functionSignature he
Johnni Winther 2017/01/18 11:02:51 I considered adding a 'parameterCount' property to
evaluateSuperOrRedirectSend(compiledArguments, callStructure, target);
return;
}
« no previous file with comments | « no previous file | pkg/compiler/lib/src/elements/elements.dart » ('j') | pkg/compiler/lib/src/elements/elements.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698