| 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 abstract class HType { | 5 abstract class HType { |
| 6 const HType(); | 6 const HType(); |
| 7 | 7 |
| 8 /** | 8 /** |
| 9 * Returns an [HType] that represents [type] and all types that have | 9 * Returns an [HType] that represents [type] and all types that have |
| 10 * [type] as supertype. | 10 * [type] as supertype. |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 const HUnknownType() : super("unknown"); | 135 const HUnknownType() : super("unknown"); |
| 136 bool canBePrimitive() => true; | 136 bool canBePrimitive() => true; |
| 137 bool canBeNull() => true; | 137 bool canBeNull() => true; |
| 138 | 138 |
| 139 HType union(HType other) => this; | 139 HType union(HType other) => this; |
| 140 HType intersection(HType other) => other; | 140 HType intersection(HType other) => other; |
| 141 } | 141 } |
| 142 | 142 |
| 143 class HConflictingType extends HAnalysisType { | 143 class HConflictingType extends HAnalysisType { |
| 144 const HConflictingType() : super("conflicting"); | 144 const HConflictingType() : super("conflicting"); |
| 145 bool canBePrimitive() => false; | 145 bool canBePrimitive() => true; |
| 146 bool canBeNull() => false; | 146 bool canBeNull() => true; |
| 147 | 147 |
| 148 HType union(HType other) => other; | 148 HType union(HType other) => other; |
| 149 HType intersection(HType other) => this; | 149 HType intersection(HType other) => this; |
| 150 } | 150 } |
| 151 | 151 |
| 152 abstract class HPrimitiveType extends HType { | 152 abstract class HPrimitiveType extends HType { |
| 153 const HPrimitiveType(); | 153 const HPrimitiveType(); |
| 154 bool isPrimitive() => true; | 154 bool isPrimitive() => true; |
| 155 bool canBePrimitive() => true; | 155 bool canBePrimitive() => true; |
| 156 bool isPrimitiveOrNull() => true; | 156 bool isPrimitiveOrNull() => true; |
| (...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 operator [](HInstruction instruction) { | 819 operator [](HInstruction instruction) { |
| 820 HType result = _map[instruction]; | 820 HType result = _map[instruction]; |
| 821 if (result == null) return instruction.guaranteedType; | 821 if (result == null) return instruction.guaranteedType; |
| 822 return result; | 822 return result; |
| 823 } | 823 } |
| 824 | 824 |
| 825 operator []=(HInstruction instruction, HType value) { | 825 operator []=(HInstruction instruction, HType value) { |
| 826 _map[instruction] = value; | 826 _map[instruction] = value; |
| 827 } | 827 } |
| 828 } | 828 } |
| OLD | NEW |