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

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

Issue 2015183003: Create ExecutableElementImpl.type lazily. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library summary_resynthesizer; 5 library summary_resynthesizer;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/token.dart'; 10 import 'package:analyzer/dart/ast/token.dart';
(...skipping 2081 matching lines...) Expand 10 before | Expand all | Expand 10 after
2092 if (length != 0) { 2092 if (length != 0) {
2093 List<ParameterElementImpl> parameters = 2093 List<ParameterElementImpl> parameters =
2094 new List<ParameterElementImpl>(length); 2094 new List<ParameterElementImpl>(length);
2095 for (int i = 0; i < length; i++) { 2095 for (int i = 0; i < length; i++) {
2096 parameters[i] = 2096 parameters[i] =
2097 buildParameter(unlinkedParameters[i], executableElement); 2097 buildParameter(unlinkedParameters[i], executableElement);
2098 } 2098 }
2099 executableElement.parameters = parameters; 2099 executableElement.parameters = parameters;
2100 } 2100 }
2101 } 2101 }
2102 executableElement.type = new FunctionTypeImpl.elementWithNameAndArgs(
2103 executableElement, null, getCurrentTypeArguments(skipLevels: 1), false);
2104 { 2102 {
2105 List<UnlinkedExecutable> unlinkedFunctions = 2103 List<UnlinkedExecutable> unlinkedFunctions =
2106 serializedExecutable.localFunctions; 2104 serializedExecutable.localFunctions;
2107 int length = unlinkedFunctions.length; 2105 int length = unlinkedFunctions.length;
2108 if (length != 0) { 2106 if (length != 0) {
2109 List<FunctionElementImpl> localFunctions = 2107 List<FunctionElementImpl> localFunctions =
2110 new List<FunctionElementImpl>(length); 2108 new List<FunctionElementImpl>(length);
2111 for (int i = 0; i < length; i++) { 2109 for (int i = 0; i < length; i++) {
2112 localFunctions[i] = 2110 localFunctions[i] =
2113 buildLocalFunction(unlinkedFunctions[i], executableElement); 2111 buildLocalFunction(unlinkedFunctions[i], executableElement);
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after
2844 static String _getElementIdentifier(String name, ReferenceKind kind) { 2842 static String _getElementIdentifier(String name, ReferenceKind kind) {
2845 if (kind == ReferenceKind.topLevelPropertyAccessor || 2843 if (kind == ReferenceKind.topLevelPropertyAccessor ||
2846 kind == ReferenceKind.propertyAccessor) { 2844 kind == ReferenceKind.propertyAccessor) {
2847 if (!name.endsWith('=')) { 2845 if (!name.endsWith('=')) {
2848 return name + '?'; 2846 return name + '?';
2849 } 2847 }
2850 } 2848 }
2851 return name; 2849 return name;
2852 } 2850 }
2853 } 2851 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698