| OLD | NEW |
| 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 'common/tasks.dart' show CompilerTask; | 7 import 'common/tasks.dart' show CompilerTask; |
| 8 import 'common.dart'; | 8 import 'common.dart'; |
| 9 import 'compiler.dart' show Compiler; | 9 import 'compiler.dart' show Compiler; |
| 10 import 'constants/expressions.dart' show ConstantExpression; | 10 import 'constants/expressions.dart' show ConstantExpression; |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 // extra dependencies due to mirrors. | 425 // extra dependencies due to mirrors. |
| 426 void addLiveInstanceMember(_, MemberElement element) { | 426 void addLiveInstanceMember(_, MemberElement element) { |
| 427 if (!compiler.resolutionWorldBuilder.isMemberUsed(element)) return; | 427 if (!compiler.resolutionWorldBuilder.isMemberUsed(element)) return; |
| 428 if (!isMirrorUsage && !element.isInstanceMember) return; | 428 if (!isMirrorUsage && !element.isInstanceMember) return; |
| 429 elements.add(element); | 429 elements.add(element); |
| 430 collectDependencies(element); | 430 collectDependencies(element); |
| 431 } | 431 } |
| 432 | 432 |
| 433 ClassElement cls = element.declaration; | 433 ClassElement cls = element.declaration; |
| 434 cls.implementation.forEachMember(addLiveInstanceMember); | 434 cls.implementation.forEachMember(addLiveInstanceMember); |
| 435 for (var type in cls.implementation.allSupertypes) { | 435 for (ResolutionInterfaceType type in cls.implementation.allSupertypes) { |
| 436 elements.add(type.element.implementation); | 436 elements.add(type.element.implementation); |
| 437 } | 437 } |
| 438 elements.add(cls.implementation); | 438 elements.add(cls.implementation); |
| 439 } else if (Elements.isStaticOrTopLevel(element) || element.isConstructor) { | 439 } else if (Elements.isStaticOrTopLevel(element) || element.isConstructor) { |
| 440 elements.add(element); | 440 elements.add(element); |
| 441 collectDependencies(element); | 441 collectDependencies(element); |
| 442 } | 442 } |
| 443 if (element.isGenerativeConstructor) { | 443 if (element.isGenerativeConstructor) { |
| 444 // When instantiating a class, we record a reference to the | 444 // When instantiating a class, we record a reference to the |
| 445 // constructor, not the class itself. We must add all the | 445 // constructor, not the class itself. We must add all the |
| (...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1061 | 1061 |
| 1062 bool operator ==(other) { | 1062 bool operator ==(other) { |
| 1063 if (other is! _DeclaredDeferredImport) return false; | 1063 if (other is! _DeclaredDeferredImport) return false; |
| 1064 return declaration == other.declaration; | 1064 return declaration == other.declaration; |
| 1065 } | 1065 } |
| 1066 | 1066 |
| 1067 int get hashCode => declaration.hashCode * 17; | 1067 int get hashCode => declaration.hashCode * 17; |
| 1068 | 1068 |
| 1069 String toString() => '$declaration'; | 1069 String toString() => '$declaration'; |
| 1070 } | 1070 } |
| OLD | NEW |