118 }
119
120 /**
121 * Returns the named location identity for an array of the given element kind. Array accesses of
122 * the same kind must have the same location identity unless an alias analysis guarantees that
123 * two distinct arrays are accessed.
124 */
125 public static LocationIdentity getArrayLocation(JavaKind elementKind) {
126 return ARRAY_LOCATIONS.get(elementKind);
127 }
128
129 private static final EnumMap<JavaKind, LocationIdentity> ARRAY_LOCATIONS = initArrayLocations();
130
131 private static EnumMap<JavaKind, LocationIdentity> initArrayLocations() {
132 EnumMap<JavaKind, LocationIdentity> result = new EnumMap<>(JavaKind.class);
133 for (JavaKind kind : JavaKind.values()) {
134 result.put(kind, NamedLocationIdentity.mutable("Array: " + kind.getJavaName()));
135 }
136 return result;
137 }
138 }
|
118 }
119
120 /**
121 * Returns the named location identity for an array of the given element kind. Array accesses of
122 * the same kind must have the same location identity unless an alias analysis guarantees that
123 * two distinct arrays are accessed.
124 */
125 public static LocationIdentity getArrayLocation(JavaKind elementKind) {
126 return ARRAY_LOCATIONS.get(elementKind);
127 }
128
129 private static final EnumMap<JavaKind, LocationIdentity> ARRAY_LOCATIONS = initArrayLocations();
130
131 private static EnumMap<JavaKind, LocationIdentity> initArrayLocations() {
132 EnumMap<JavaKind, LocationIdentity> result = new EnumMap<>(JavaKind.class);
133 for (JavaKind kind : JavaKind.values()) {
134 result.put(kind, NamedLocationIdentity.mutable("Array: " + kind.getJavaName()));
135 }
136 return result;
137 }
138
139 public static boolean isArrayLocation(LocationIdentity l) {
140 return ARRAY_LOCATIONS.containsValue(l);
141 }
142 }
|