OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 part of types; | 5 part of types; |
6 | 6 |
7 /// An implementation of a [UniverseSelectorConstraints] that is consists if an
only | 7 /// An implementation of a [UniverseSelectorConstraints] that is consists if an
only |
8 /// increasing set of [TypeMask]s, that is, once a mask is added it cannot be | 8 /// increasing set of [TypeMask]s, that is, once a mask is added it cannot be |
9 /// removed. | 9 /// removed. |
10 class IncreasingTypeMaskSet extends UniverseSelectorConstraints { | 10 class IncreasingTypeMaskSet extends UniverseSelectorConstraints { |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 } else { | 115 } else { |
116 return new TypeMask.exactOrEmpty(base, classWorld); | 116 return new TypeMask.exactOrEmpty(base, classWorld); |
117 } | 117 } |
118 } | 118 } |
119 | 119 |
120 const factory TypeMask.nonNullEmpty() = FlatTypeMask.nonNullEmpty; | 120 const factory TypeMask.nonNullEmpty() = FlatTypeMask.nonNullEmpty; |
121 | 121 |
122 factory TypeMask.nonNullExact(ClassElement base, ClassWorld classWorld) { | 122 factory TypeMask.nonNullExact(ClassElement base, ClassWorld classWorld) { |
123 assert(invariant(base, classWorld.isInstantiated(base), | 123 assert(invariant(base, classWorld.isInstantiated(base), |
124 message: () => "Cannot create exact type mask for " | 124 message: () => "Cannot create exact type mask for " |
125 "uninstantiated class $base.\n${classWorld.dump()}")); | 125 "uninstantiated class $base.\n${classWorld.dump(base)}")); |
126 return new FlatTypeMask.nonNullExact(base); | 126 return new FlatTypeMask.nonNullExact(base); |
127 } | 127 } |
128 | 128 |
129 factory TypeMask.nonNullExactOrEmpty(ClassElement base, | 129 factory TypeMask.nonNullExactOrEmpty(ClassElement base, |
130 ClassWorld classWorld) { | 130 ClassWorld classWorld) { |
131 if (classWorld.isInstantiated(base)) { | 131 if (classWorld.isInstantiated(base)) { |
132 return new FlatTypeMask.nonNullExact(base); | 132 return new FlatTypeMask.nonNullExact(base); |
133 } | 133 } |
134 return const TypeMask.nonNullEmpty(); | 134 return const TypeMask.nonNullEmpty(); |
135 } | 135 } |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
330 /** | 330 /** |
331 * Returns the [element] that is known to always be hit at runtime | 331 * Returns the [element] that is known to always be hit at runtime |
332 * on this mask. Returns null if there is none. | 332 * on this mask. Returns null if there is none. |
333 */ | 333 */ |
334 // TODO(johnniwinther): Move this method to [World]. | 334 // TODO(johnniwinther): Move this method to [World]. |
335 Element locateSingleElement( | 335 Element locateSingleElement( |
336 Selector selector, | 336 Selector selector, |
337 TypeMask mask, | 337 TypeMask mask, |
338 Compiler compiler); | 338 Compiler compiler); |
339 } | 339 } |
OLD | NEW |