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

Side by Side Diff: pkg/compiler/lib/src/types/type_mask.dart

Issue 1402913003: Avoid creating invalid TypeMask.nonNullExact (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 5 years, 2 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
« no previous file with comments | « pkg/compiler/lib/src/ssa/codegen.dart ('k') | pkg/compiler/lib/src/universe/class_set.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) 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
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
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 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/codegen.dart ('k') | pkg/compiler/lib/src/universe/class_set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698