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 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 863 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
874 | 874 |
875 /// Does this node potentially affect control flow. | 875 /// Does this node potentially affect control flow. |
876 bool isControlFlow() => false; | 876 bool isControlFlow() => false; |
877 | 877 |
878 bool isExact() => instructionType.isExact || isNull(); | 878 bool isExact() => instructionType.isExact || isNull(); |
879 | 879 |
880 bool isValue() => instructionType.isValue; | 880 bool isValue() => instructionType.isValue; |
881 | 881 |
882 bool canBeNull() => instructionType.isNullable; | 882 bool canBeNull() => instructionType.isNullable; |
883 | 883 |
884 bool isNull() => instructionType.isEmpty && instructionType.isNullable; | 884 bool isNull() => instructionType.isNull; |
885 bool isConflicting() { | 885 |
886 return instructionType.isEmpty && !instructionType.isNullable; | 886 bool isConflicting() => instructionType.isEmpty; |
887 } | |
888 | 887 |
889 /// Returns `true` if [typeMask] contains [cls]. | 888 /// Returns `true` if [typeMask] contains [cls]. |
890 static bool containsType( | 889 static bool containsType( |
891 TypeMask typeMask, | 890 TypeMask typeMask, |
892 ClassElement cls, | 891 ClassElement cls, |
893 ClassWorld classWorld) { | 892 ClassWorld classWorld) { |
894 return classWorld.isInstantiated(cls) && typeMask.contains(cls, classWorld); | 893 return classWorld.isInstantiated(cls) && typeMask.contains(cls, classWorld); |
895 } | 894 } |
896 | 895 |
897 /// Returns `true` if [typeMask] contains only [cls]. | 896 /// Returns `true` if [typeMask] contains only [cls]. |
(...skipping 2444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3342 class HDynamicType extends HRuntimeType { | 3341 class HDynamicType extends HRuntimeType { |
3343 HDynamicType(DynamicType dartType, TypeMask instructionType) | 3342 HDynamicType(DynamicType dartType, TypeMask instructionType) |
3344 : super(const <HInstruction>[], dartType, instructionType); | 3343 : super(const <HInstruction>[], dartType, instructionType); |
3345 | 3344 |
3346 accept(HVisitor visitor) => visitor.visitDynamicType(this); | 3345 accept(HVisitor visitor) => visitor.visitDynamicType(this); |
3347 | 3346 |
3348 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; | 3347 int typeCode() => HInstruction.DYNAMIC_TYPE_TYPECODE; |
3349 | 3348 |
3350 bool typeEquals(HInstruction other) => other is HDynamicType; | 3349 bool typeEquals(HInstruction other) => other is HDynamicType; |
3351 } | 3350 } |
OLD | NEW |