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

Side by Side Diff: pkg/compiler/lib/src/deferred_load.dart

Issue 1087473002: Revert "Dart2js deferred loading. Follow types of functions when calculating dependencies." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 deferred_load; 5 library deferred_load;
6 6
7 import 'constants/expressions.dart'; 7 import 'constants/expressions.dart';
8 import 'constants/values.dart' show 8 import 'constants/values.dart' show
9 ConstantValue, 9 ConstantValue,
10 ConstructedConstantValue, 10 ConstructedConstantValue,
(...skipping 20 matching lines...) Expand all
31 ElementKind, 31 ElementKind,
32 Elements, 32 Elements,
33 FunctionElement, 33 FunctionElement,
34 LibraryElement, 34 LibraryElement,
35 MetadataAnnotation, 35 MetadataAnnotation,
36 PrefixElement, 36 PrefixElement,
37 ScopeContainerElement, 37 ScopeContainerElement,
38 TypedefElement, 38 TypedefElement,
39 VoidElement; 39 VoidElement;
40 40
41 import 'dart_types.dart';
42
43 import 'util/util.dart' show 41 import 'util/util.dart' show
44 Link, makeUnique; 42 Link, makeUnique;
45 import 'util/uri_extras.dart' as uri_extras; 43 import 'util/uri_extras.dart' as uri_extras;
46 44
47 import 'util/setlet.dart' show 45 import 'util/setlet.dart' show
48 Setlet; 46 Setlet;
49 47
50 import 'tree/tree.dart' show 48 import 'tree/tree.dart' show
51 Import, 49 Import,
52 LibraryTag, 50 LibraryTag,
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 } 294 }
297 295
298 // TODO(sigurdm): How is metadata on a patch-class handled? 296 // TODO(sigurdm): How is metadata on a patch-class handled?
299 for (MetadataAnnotation metadata in element.metadata) { 297 for (MetadataAnnotation metadata in element.metadata) {
300 ConstantExpression constant = 298 ConstantExpression constant =
301 backend.constants.getConstantForMetadata(metadata); 299 backend.constants.getConstantForMetadata(metadata);
302 if (constant != null) { 300 if (constant != null) {
303 addConstants(constant.value); 301 addConstants(constant.value);
304 } 302 }
305 } 303 }
306
307 collectTypeDependencies(DartType type) {
308 if (type is FunctionType) {
309 for (DartType argumentType in type.parameterTypes) {
310 collectTypeDependencies(argumentType);
311 }
312 for (DartType argumentType in type.optionalParameterTypes) {
313 collectTypeDependencies(argumentType);
314 }
315 for (DartType argumentType in type.namedParameterTypes) {
316 collectTypeDependencies(argumentType);
317 }
318 collectTypeDependencies(type.returnType);
319 } else if (type is TypedefType) {
320 type.element.alias;
321 } else if (type is InterfaceType) {
322 elements.add(type.element);
323 }
324 }
325
326 if (element is FunctionElement) {
327 collectTypeDependencies(element.type);
328 }
329
330 if (element.isClass) { 304 if (element.isClass) {
331 // If we see a class, add everything its live instance members refer 305 // If we see a class, add everything its live instance members refer
332 // to. Static members are not relevant, unless we are processing 306 // to. Static members are not relevant, unless we are processing
333 // extra dependencies due to mirrors. 307 // extra dependencies due to mirrors.
334 void addLiveInstanceMember(Element element) { 308 void addLiveInstanceMember(Element element) {
335 if (!compiler.enqueuer.resolution.hasBeenResolved(element)) return; 309 if (!compiler.enqueuer.resolution.hasBeenResolved(element)) return;
336 if (!isMirrorUsage && !element.isInstanceMember) return; 310 if (!isMirrorUsage && !element.isInstanceMember) return;
337 collectDependencies(element.implementation); 311 collectDependencies(element.implementation);
338 } 312 }
339 ClassElement cls = element.declaration; 313 ClassElement cls = element.declaration;
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
855 _importingLibrary = importingLibrary; 829 _importingLibrary = importingLibrary;
856 830
857 String get importingLibraryName { 831 String get importingLibraryName {
858 String libraryName = _importingLibrary.getLibraryName(); 832 String libraryName = _importingLibrary.getLibraryName();
859 return libraryName == "" 833 return libraryName == ""
860 ? "<unnamed>" 834 ? "<unnamed>"
861 : libraryName; 835 : libraryName;
862 } 836 }
863 837
864 } 838 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/elements/modelx.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698