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

Side by Side Diff: pkg/compiler/lib/src/ssa/nodes.dart

Issue 1371193004: Add bool value types to type inference. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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
OLDNEW
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 part of ssa; 5 part of ssa;
6 6
7 abstract class HVisitor<R> { 7 abstract class HVisitor<R> {
8 R visitAdd(HAdd node); 8 R visitAdd(HAdd node);
9 R visitAwait(HAwait node); 9 R visitAwait(HAwait node);
10 R visitBitAnd(HBitAnd node); 10 R visitBitAnd(HBitAnd node);
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 HInstruction nonCheck() => this; 869 HInstruction nonCheck() => this;
870 870
871 /// Can this node throw an exception? 871 /// Can this node throw an exception?
872 bool canThrow() => false; 872 bool canThrow() => false;
873 873
874 /// Does this node potentially affect control flow. 874 /// Does this node potentially affect control flow.
875 bool isControlFlow() => false; 875 bool isControlFlow() => false;
876 876
877 bool isExact() => instructionType.isExact || isNull(); 877 bool isExact() => instructionType.isExact || isNull();
878 878
879 bool isValue() => instructionType.isValue;
880
879 bool canBeNull() => instructionType.isNullable; 881 bool canBeNull() => instructionType.isNullable;
880 882
881 bool isNull() => instructionType.isEmpty && instructionType.isNullable; 883 bool isNull() => instructionType.isEmpty && instructionType.isNullable;
882 bool isConflicting() { 884 bool isConflicting() {
883 return instructionType.isEmpty && !instructionType.isNullable; 885 return instructionType.isEmpty && !instructionType.isNullable;
884 } 886 }
885 887
886 /// Returns `true` if [typeMask] contains [cls]. 888 /// Returns `true` if [typeMask] contains [cls].
887 static bool containsType( 889 static bool containsType(
888 TypeMask typeMask, 890 TypeMask typeMask,
(...skipping 2436 matching lines...) Expand 10 before | Expand all | Expand 10 after
3325 class HDynamicType extends HRuntimeType { 3327 class HDynamicType extends HRuntimeType {
3326 HDynamicType(DynamicType dartType, TypeMask instructionType) 3328 HDynamicType(DynamicType dartType, TypeMask instructionType)
3327 : super(const <HInstruction>[], dartType, instructionType); 3329 : super(const <HInstruction>[], dartType, instructionType);
3328 3330
3329 accept(HVisitor visitor) => visitor.visitDynamicType(this); 3331 accept(HVisitor visitor) => visitor.visitDynamicType(this);
3330 3332
3331 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; 3333 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE;
3332 3334
3333 bool typeEquals(HInstruction other) => other is HDynamicType; 3335 bool typeEquals(HInstruction other) => other is HDynamicType;
3334 } 3336 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698