OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 masks; | 5 part of masks; |
6 | 6 |
7 /** | 7 /** |
8 * A [MapTypeMask] is a [TypeMask] for a specific allocation | 8 * A [MapTypeMask] is a [TypeMask] for a specific allocation |
9 * site of a map (currently only internal Map class) that will get specialized | 9 * site of a map (currently only internal Map class) that will get specialized |
10 * once the [TypeGraphInferrer] phase finds a key and/or value type for it. | 10 * once the [TypeGraphInferrer] phase finds a key and/or value type for it. |
11 */ | 11 */ |
12 class MapTypeMask extends ForwardingTypeMask { | 12 class MapTypeMask extends ForwardingTypeMask { |
13 final TypeMask forwardTo; | 13 final TypeMask forwardTo; |
14 | 14 |
15 // The [Node] where this type mask was created. | 15 // The [Node] where this type mask was created. |
16 final Node allocationNode; | 16 final Node allocationNode; |
17 | 17 |
18 // The [Entity] where this type mask was created. | 18 // The [MemberEntity] where this type mask was created. |
19 final Entity allocationElement; | 19 final MemberEntity allocationElement; |
20 | 20 |
21 // The value type of this map. | 21 // The value type of this map. |
22 final TypeMask valueType; | 22 final TypeMask valueType; |
23 | 23 |
24 // The key type of this map. | 24 // The key type of this map. |
25 final TypeMask keyType; | 25 final TypeMask keyType; |
26 | 26 |
27 MapTypeMask(this.forwardTo, this.allocationNode, this.allocationElement, | 27 MapTypeMask(this.forwardTo, this.allocationNode, this.allocationElement, |
28 this.keyType, this.valueType); | 28 this.keyType, this.valueType); |
29 | 29 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 104 |
105 int get hashCode { | 105 int get hashCode { |
106 return computeHashCode( | 106 return computeHashCode( |
107 allocationNode, isNullable, keyType, valueType, forwardTo); | 107 allocationNode, isNullable, keyType, valueType, forwardTo); |
108 } | 108 } |
109 | 109 |
110 String toString() { | 110 String toString() { |
111 return 'Map mask: [$keyType/$valueType] type: $forwardTo'; | 111 return 'Map mask: [$keyType/$valueType] type: $forwardTo'; |
112 } | 112 } |
113 } | 113 } |
OLD | NEW |