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

Side by Side Diff: pkg/analyzer/lib/src/summary/link.dart

Issue 2485043004: Don't serialize elements of top-level function/constructor/method bodies. (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * This library is capable of producing linked summaries from unlinked 6 * This library is capable of producing linked summaries from unlinked
7 * ones (or prelinked ones). It functions by building a miniature 7 * ones (or prelinked ones). It functions by building a miniature
8 * element model to represent the contents of the summaries, and then 8 * element model to represent the contents of the summaries, and then
9 * scanning the element model to gather linked information and adding 9 * scanning the element model to gather linked information and adding
10 * it to the summary data structures. 10 * it to the summary data structures.
(...skipping 3086 matching lines...) Expand 10 before | Expand all | Expand 10 after
3097 @override 3097 @override
3098 FunctionElementForLink_Local getLocalFunction(int index) { 3098 FunctionElementForLink_Local getLocalFunction(int index) {
3099 List<FunctionElementForLink_Local_NonSynthetic> functions = this.functions; 3099 List<FunctionElementForLink_Local_NonSynthetic> functions = this.functions;
3100 return index < functions.length ? functions[index] : null; 3100 return index < functions.length ? functions[index] : null;
3101 } 3101 }
3102 3102
3103 /** 3103 /**
3104 * Store the results of type inference for this function in [compilationUnit]. 3104 * Store the results of type inference for this function in [compilationUnit].
3105 */ 3105 */
3106 void link(CompilationUnitElementInBuildUnit compilationUnit) { 3106 void link(CompilationUnitElementInBuildUnit compilationUnit) {
3107 compilationUnit._storeLinkedType( 3107 if (_unlinkedExecutable.returnType == null) {
3108 _unlinkedExecutable.inferredReturnTypeSlot, inferredReturnType, this); 3108 compilationUnit._storeLinkedType(
3109 _unlinkedExecutable.inferredReturnTypeSlot, inferredReturnType, this);
3110 }
3109 for (FunctionElementForLink_Local_NonSynthetic function in functions) { 3111 for (FunctionElementForLink_Local_NonSynthetic function in functions) {
3110 function.link(compilationUnit); 3112 function.link(compilationUnit);
3111 } 3113 }
3112 } 3114 }
3113 3115
3114 @override 3116 @override
3115 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); 3117 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
3116 3118
3117 @override 3119 @override
3118 void _setInferredType(DartType type) { 3120 void _setInferredType(DartType type) {
(...skipping 1940 matching lines...) Expand 10 before | Expand all | Expand 10 after
5059 * there are no type parameters in scope. 5061 * there are no type parameters in scope.
5060 */ 5062 */
5061 TypeParameterizedElementMixin get _typeParameterContext; 5063 TypeParameterizedElementMixin get _typeParameterContext;
5062 5064
5063 @override 5065 @override
5064 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); 5066 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
5065 5067
5066 @override 5068 @override
5067 String toString() => '$enclosingElement.$name'; 5069 String toString() => '$enclosingElement.$name';
5068 } 5070 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698