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

Unified Diff: pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart

Issue 2125643002: Serialize parameter nodes for local functions. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | tests/compiler/dart2js/serialization/model_test_helper.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart
diff --git a/pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart b/pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart
index b5d6caee9de3b3ed6d883e066022522185bb1103..bce66ac01bd93fbfaa0004d59c4b5b24975dd6d0 100644
--- a/pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart
+++ b/pkg/compiler/lib/src/serialization/resolved_ast_serialization.dart
@@ -166,21 +166,25 @@ class ResolvedAstSerializer extends Visitor {
serializeLabelDefinition(labelDefinition, list.createObject());
}
}
+
if (element is FunctionElement) {
- FunctionElement function = element;
- function.functionSignature.forEachParameter((ParameterElement parameter) {
- ParameterElement parameterImpl = parameter.implementation;
- // TODO(johnniwinther): Should we support element->node mapping as well?
- getNodeDataEncoder(parameterImpl.node)
- .setElement(PARAMETER_NODE, parameter);
- if (parameter.initializer != null) {
- getNodeDataEncoder(parameterImpl.initializer)
- .setElement(PARAMETER_INITIALIZER, parameter);
- }
- });
+ serializeParameterNodes(element);
}
}
+ void serializeParameterNodes(FunctionElement function) {
+ function.functionSignature.forEachParameter((ParameterElement parameter) {
+ ParameterElement parameterImpl = parameter.implementation;
+ // TODO(johnniwinther): Should we support element->node mapping as well?
+ getNodeDataEncoder(parameterImpl.node)
+ .setElement(PARAMETER_NODE, parameter);
+ if (parameter.initializer != null) {
+ getNodeDataEncoder(parameterImpl.initializer)
+ .setElement(PARAMETER_INITIALIZER, parameter);
+ }
+ });
+ }
+
/// Serialize [target] into [encoder].
void serializeJumpTarget(JumpTarget jumpTarget, ObjectEncoder encoder) {
encoder.setElement(Key.EXECUTABLE_CONTEXT, jumpTarget.executableContext);
@@ -318,6 +322,7 @@ class ResolvedAstSerializer extends Visitor {
if (function != null && function.isFunction && function.isLocal) {
// Mark root nodes of local functions; these need their own ResolvedAst.
getNodeDataEncoder(node).setElement(Key.FUNCTION, function);
+ serializeParameterNodes(function);
}
}
}
« no previous file with comments | « no previous file | tests/compiler/dart2js/serialization/model_test_helper.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698