OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 dart2js.world; | 5 library dart2js.world; |
6 | 6 |
7 import 'closure.dart' show ClosureClassElement, SynthesizedCallMethodElementX; | 7 import 'closure.dart' show ClosureClassElement, SynthesizedCallMethodElementX; |
8 import 'common/backend_api.dart' show BackendClasses; | 8 import 'common/backend_api.dart' show BackendClasses; |
9 import 'common.dart'; | 9 import 'common.dart'; |
10 import 'constants/constant_system.dart'; | 10 import 'constants/constant_system.dart'; |
11 import 'common_elements.dart' show CommonElements; | 11 import 'common_elements.dart' show CommonElements; |
12 import 'elements/entities.dart'; | 12 import 'elements/entities.dart'; |
13 import 'elements/elements.dart' | 13 import 'elements/elements.dart' |
14 show | 14 show |
15 ClassElement, | 15 ClassElement, |
16 Element, | 16 Element, |
17 FunctionElement, | 17 FunctionElement, |
18 MemberElement, | 18 MemberElement, |
19 MixinApplicationElement, | 19 MixinApplicationElement, |
20 TypedefElement; | 20 TypedefElement; |
21 import 'elements/resolution_types.dart'; | 21 import 'elements/resolution_types.dart'; |
| 22 import 'elements/types.dart'; |
22 import 'js_backend/backend.dart' show JavaScriptBackend; | 23 import 'js_backend/backend.dart' show JavaScriptBackend; |
23 import 'js_backend/interceptor_data.dart' show InterceptorData; | 24 import 'js_backend/interceptor_data.dart' show InterceptorData; |
24 import 'js_backend/native_data.dart' show NativeData; | 25 import 'js_backend/native_data.dart' show NativeData; |
25 import 'ordered_typeset.dart'; | 26 import 'ordered_typeset.dart'; |
26 import 'types/masks.dart' show CommonMasks, FlatTypeMask, TypeMask; | 27 import 'types/masks.dart' show CommonMasks, FlatTypeMask, TypeMask; |
27 import 'universe/class_set.dart'; | 28 import 'universe/class_set.dart'; |
28 import 'universe/function_set.dart' show FunctionSet, FunctionSetBuilder; | 29 import 'universe/function_set.dart' show FunctionSet, FunctionSetBuilder; |
29 import 'universe/selector.dart' show Selector; | 30 import 'universe/selector.dart' show Selector; |
30 import 'universe/side_effects.dart' show SideEffects; | 31 import 'universe/side_effects.dart' show SideEffects; |
31 import 'universe/world_builder.dart' show ResolutionWorldBuilder; | 32 import 'universe/world_builder.dart' show ResolutionWorldBuilder; |
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
970 assert(_checkInvariants(otherClass)); | 971 assert(_checkInvariants(otherClass)); |
971 OrderedTypeSet otherTypeSet = otherClass.allSupertypesAndSelf; | 972 OrderedTypeSet otherTypeSet = otherClass.allSupertypesAndSelf; |
972 otherTypeSets = otherTypeSets.prepend(otherTypeSet); | 973 otherTypeSets = otherTypeSets.prepend(otherTypeSet); |
973 if (otherTypeSet.maxDepth < depth) { | 974 if (otherTypeSet.maxDepth < depth) { |
974 depth = otherTypeSet.maxDepth; | 975 depth = otherTypeSet.maxDepth; |
975 } | 976 } |
976 } while (iterator.moveNext()); | 977 } while (iterator.moveNext()); |
977 | 978 |
978 List<ClassElement> commonSupertypes = <ClassElement>[]; | 979 List<ClassElement> commonSupertypes = <ClassElement>[]; |
979 OUTER: | 980 OUTER: |
980 for (Link<ResolutionDartType> link = typeSet[depth]; | 981 for (Link<InterfaceType> link = typeSet[depth]; |
981 link.head.element != commonElements.objectClass; | 982 link.head.element != commonElements.objectClass; |
982 link = link.tail) { | 983 link = link.tail) { |
983 ClassElement cls = link.head.element; | 984 ClassElement cls = link.head.element; |
984 for (Link<OrderedTypeSet> link = otherTypeSets; | 985 for (Link<OrderedTypeSet> link = otherTypeSets; |
985 !link.isEmpty; | 986 !link.isEmpty; |
986 link = link.tail) { | 987 link = link.tail) { |
987 if (link.head.asInstanceOf(cls) == null) { | 988 if (link.head.asInstanceOf(cls, cls.hierarchyDepth) == null) { |
988 continue OUTER; | 989 continue OUTER; |
989 } | 990 } |
990 } | 991 } |
991 commonSupertypes.add(cls); | 992 commonSupertypes.add(cls); |
992 } | 993 } |
993 commonSupertypes.add(commonElements.objectClass); | 994 commonSupertypes.add(commonElements.objectClass); |
994 return commonSupertypes; | 995 return commonSupertypes; |
995 } | 996 } |
996 | 997 |
997 Iterable<ClassEntity> commonSubclasses(ClassEntity cls1, ClassQuery query1, | 998 Iterable<ClassEntity> commonSubclasses(ClassEntity cls1, ClassQuery query1, |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 return getMightBePassedToApply(element.expression); | 1213 return getMightBePassedToApply(element.expression); |
1213 } | 1214 } |
1214 return functionsThatMightBePassedToApply.contains(element); | 1215 return functionsThatMightBePassedToApply.contains(element); |
1215 } | 1216 } |
1216 | 1217 |
1217 @override | 1218 @override |
1218 bool getCurrentlyKnownMightBePassedToApply(Element element) { | 1219 bool getCurrentlyKnownMightBePassedToApply(Element element) { |
1219 return getMightBePassedToApply(element); | 1220 return getMightBePassedToApply(element); |
1220 } | 1221 } |
1221 } | 1222 } |
OLD | NEW |