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

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

Issue 1196443002: Revert "cps-ir: Support foreign code." (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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/tree_ir/tree_ir_tracer.dart ('k') | pkg/pkg.status » ('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 /** 7 /**
8 * A type mask represents a set of contained classes, but the 8 * A type mask represents a set of contained classes, but the
9 * operations on it are not guaranteed to be precise and they may 9 * operations on it are not guaranteed to be precise and they may
10 * yield conservative answers that contain too many classes. 10 * yield conservative answers that contain too many classes.
11 */ 11 */
12 abstract class TypeMask { 12 abstract class TypeMask {
13 factory TypeMask(ClassElement base, 13 factory TypeMask(ClassElement base,
14 int kind, 14 int kind,
15 bool isNullable, 15 bool isNullable,
16 ClassWorld classWorld) { 16 ClassWorld classWorld) {
17 return new FlatTypeMask.normalized( 17 return new FlatTypeMask.normalized(
18 base, (kind << 1) | (isNullable ? 1 : 0), classWorld); 18 base, (kind << 1) | (isNullable ? 1 : 0), classWorld);
19 } 19 }
20 20
21 const factory TypeMask.empty() = FlatTypeMask.empty; 21 const factory TypeMask.empty() = FlatTypeMask.empty;
22 22
23 factory TypeMask.exact(ClassElement base, ClassWorld classWorld) { 23 factory TypeMask.exact(ClassElement base, ClassWorld classWorld) {
24 assert(invariant(base, classWorld.isInstantiated(base), 24 assert(invariant(base, classWorld.isInstantiated(base),
25 message: "Cannot create extact type mask for uninstantiated class " 25 message: "Cannot create extact type mask for "
26 "${base.name}")); 26 "uninstantiated class $base"));
27 return new FlatTypeMask.exact(base); 27 return new FlatTypeMask.exact(base);
28 } 28 }
29 29
30 factory TypeMask.exactOrEmpty(ClassElement base, ClassWorld classWorld) { 30 factory TypeMask.exactOrEmpty(ClassElement base, ClassWorld classWorld) {
31 if (classWorld.isInstantiated(base)) return new FlatTypeMask.exact(base); 31 if (classWorld.isInstantiated(base)) return new FlatTypeMask.exact(base);
32 return const TypeMask.empty(); 32 return const TypeMask.empty();
33 } 33 }
34 34
35 factory TypeMask.subclass(ClassElement base, ClassWorld classWorld) { 35 factory TypeMask.subclass(ClassElement base, ClassWorld classWorld) {
36 if (classWorld.hasAnySubclass(base)) { 36 if (classWorld.hasAnySubclass(base)) {
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 /** 264 /**
265 * Returns the [element] that is known to always be hit at runtime 265 * Returns the [element] that is known to always be hit at runtime
266 * on this mask. Returns null if there is none. 266 * on this mask. Returns null if there is none.
267 */ 267 */
268 // TODO(johnniwinther): Move this method to [World]. 268 // TODO(johnniwinther): Move this method to [World].
269 Element locateSingleElement( 269 Element locateSingleElement(
270 Selector selector, 270 Selector selector,
271 TypeMask mask, 271 TypeMask mask,
272 Compiler compiler); 272 Compiler compiler);
273 } 273 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/tree_ir/tree_ir_tracer.dart ('k') | pkg/pkg.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698