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 universe; | 5 library universe; |
6 | 6 |
7 import '../closure.dart'; | 7 import '../closure.dart'; |
8 import '../elements/elements.dart'; | 8 import '../elements/elements.dart'; |
9 import '../dart2jslib.dart'; | 9 import '../dart2jslib.dart'; |
10 import '../dart_types.dart'; | 10 import '../dart_types.dart'; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 * getter and only registers an invoked getter. | 43 * getter and only registers an invoked getter. |
44 */ | 44 */ |
45 final Set<Element> fieldGetters; | 45 final Set<Element> fieldGetters; |
46 | 46 |
47 /** | 47 /** |
48 * Fields set. See comment in [fieldGetters]. | 48 * Fields set. See comment in [fieldGetters]. |
49 */ | 49 */ |
50 final Set<Element> fieldSetters; | 50 final Set<Element> fieldSetters; |
51 final Set<DartType> isChecks; | 51 final Set<DartType> isChecks; |
52 | 52 |
| 53 /** |
| 54 * Set of [:call:] methods in instantiated classes that use type variables |
| 55 * in their signature. |
| 56 */ |
| 57 final Set<Element> genericCallMethods; |
| 58 |
| 59 /** |
| 60 * Set of methods in instantiated classes that use type variables in their |
| 61 * signature and have potentially been closurized. |
| 62 */ |
| 63 final Set<Element> closurizedGenericMembers; |
| 64 |
53 Universe() : instantiatedClasses = new Set<ClassElement>(), | 65 Universe() : instantiatedClasses = new Set<ClassElement>(), |
54 instantiatedTypes = new Set<DartType>(), | 66 instantiatedTypes = new Set<DartType>(), |
55 staticFunctionsNeedingGetter = new Set<FunctionElement>(), | 67 staticFunctionsNeedingGetter = new Set<FunctionElement>(), |
56 invokedNames = new Map<SourceString, Set<Selector>>(), | 68 invokedNames = new Map<SourceString, Set<Selector>>(), |
57 invokedGetters = new Map<SourceString, Set<Selector>>(), | 69 invokedGetters = new Map<SourceString, Set<Selector>>(), |
58 invokedSetters = new Map<SourceString, Set<Selector>>(), | 70 invokedSetters = new Map<SourceString, Set<Selector>>(), |
59 fieldGetters = new Set<Element>(), | 71 fieldGetters = new Set<Element>(), |
60 fieldSetters = new Set<Element>(), | 72 fieldSetters = new Set<Element>(), |
61 isChecks = new Set<DartType>(); | 73 isChecks = new Set<DartType>(), |
| 74 genericCallMethods = new Set<Element>(), |
| 75 closurizedGenericMembers = new Set<Element>(); |
62 | 76 |
63 bool hasMatchingSelector(Set<Selector> selectors, | 77 bool hasMatchingSelector(Set<Selector> selectors, |
64 Element member, | 78 Element member, |
65 Compiler compiler) { | 79 Compiler compiler) { |
66 if (selectors == null) return false; | 80 if (selectors == null) return false; |
67 for (Selector selector in selectors) { | 81 for (Selector selector in selectors) { |
68 if (selector.appliesUnnamed(member, compiler)) return true; | 82 if (selector.appliesUnnamed(member, compiler)) return true; |
69 } | 83 } |
70 return false; | 84 return false; |
71 } | 85 } |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 ClassElement cls = self; | 556 ClassElement cls = self; |
543 if (cls.isSubclassOf(other)) { | 557 if (cls.isSubclassOf(other)) { |
544 // Resolve an invocation of [element.name] on [self]. If it | 558 // Resolve an invocation of [element.name] on [self]. If it |
545 // is found, this selector is a candidate. | 559 // is found, this selector is a candidate. |
546 return hasElementIn(cls, element) && appliesUntyped(element, compiler); | 560 return hasElementIn(cls, element) && appliesUntyped(element, compiler); |
547 } | 561 } |
548 } | 562 } |
549 return false; | 563 return false; |
550 } | 564 } |
551 } | 565 } |
OLD | NEW |