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

Unified Diff: pkg/compiler/lib/src/universe/call_structure.dart

Issue 2240823002: Deserialize ResolvedAsts and ResolutionImpacts only when needed for compilation. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 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/task.dart ('k') | tests/compiler/dart2js/serialization/helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/universe/call_structure.dart
diff --git a/pkg/compiler/lib/src/universe/call_structure.dart b/pkg/compiler/lib/src/universe/call_structure.dart
index 84c0a62d08a4d7346c057e0718fac2e50382dee2..a96622e74f8c5f50be490255828d22a234adfd48 100644
--- a/pkg/compiler/lib/src/universe/call_structure.dart
+++ b/pkg/compiler/lib/src/universe/call_structure.dart
@@ -38,6 +38,17 @@ class CallStructure {
return new NamedCallStructure(argumentCount, namedArguments);
}
+ /// Creates the [CallStructure] corresponding to calling [signature] as
+ /// declared, that is, all named arguments are in the order of declaration.
+ factory CallStructure.fromSignature(FunctionSignature signature) {
+ List<String> namedParameters;
+ if (signature.optionalParametersAreNamed) {
+ namedParameters =
+ signature.optionalParameters.map((e) => e.name).toList();
+ }
+ return new CallStructure(signature.parameterCount, namedParameters);
+ }
+
/// `true` if this call has named arguments.
bool get isNamed => false;
@@ -220,13 +231,7 @@ class CallStructure {
// Synthesize a structure for the call.
// TODO(ngeoffray): Should the resolver do it instead?
- List<String> namedParameters;
- if (signature.optionalParametersAreNamed) {
- namedParameters =
- signature.optionalParameters.map((e) => e.name).toList();
- }
- CallStructure callStructure =
- new CallStructure(signature.parameterCount, namedParameters);
+ CallStructure callStructure = new CallStructure.fromSignature(signature);
if (!callStructure.signatureApplies(signature)) {
return false;
}
« no previous file with comments | « pkg/compiler/lib/src/serialization/task.dart ('k') | tests/compiler/dart2js/serialization/helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698