Mercurial > hg > graal-compiler
annotate graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/NamedLocationIdentity.java @ 21623:d2113f5ae550
Merge.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sun, 31 May 2015 23:58:09 +0200 |
parents | 48c1ebd24120 |
children |
rev | line source |
---|---|
9792
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
1 /* |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
4 * |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
8 * |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
14 * |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
18 * |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
21 * questions. |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
22 */ |
21556
48c1ebd24120
renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21390
diff
changeset
|
23 package com.oracle.jvmci.meta; |
9792
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
24 |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
25 import java.util.*; |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
26 |
21556
48c1ebd24120
renamed com.oracle.graal.api[meta|code] modules to com.oracle.jvmci.[meta|code] (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21390
diff
changeset
|
27 import com.oracle.jvmci.meta.Kind.FormatWithToString; |
18535
ee1b8eb230f7
made NamedLocationIdentity implement FormatWithToString
Doug Simon <doug.simon@oracle.com>
parents:
18317
diff
changeset
|
28 |
9792
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
29 /** |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
30 * A {@link LocationIdentity} with a name. |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
31 */ |
19851
426461951938
Convert LocationIdentity from an interface into an abstract class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18535
diff
changeset
|
32 public final class NamedLocationIdentity extends LocationIdentity implements FormatWithToString { |
18259
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
33 |
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
34 /** |
18317
c83efc00f6cc
made LocationIdentity values support .equals() instead of identity (i.e. '==') for equality comparisons (and as hash map keys)
Doug Simon <doug.simon@oracle.com>
parents:
18307
diff
changeset
|
35 * Map for asserting all {@link NamedLocationIdentity} instances have a unique name. |
18259
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
36 */ |
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
37 static class DB { |
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
38 private static final HashMap<String, NamedLocationIdentity> map = new HashMap<>(); |
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
39 |
18317
c83efc00f6cc
made LocationIdentity values support .equals() instead of identity (i.e. '==') for equality comparisons (and as hash map keys)
Doug Simon <doug.simon@oracle.com>
parents:
18307
diff
changeset
|
40 static boolean checkUnique(NamedLocationIdentity identity) { |
18259
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
41 NamedLocationIdentity oldValue = map.put(identity.name, identity); |
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
42 if (oldValue != null) { |
18317
c83efc00f6cc
made LocationIdentity values support .equals() instead of identity (i.e. '==') for equality comparisons (and as hash map keys)
Doug Simon <doug.simon@oracle.com>
parents:
18307
diff
changeset
|
43 throw new AssertionError("identity " + identity + " already exists"); |
18259
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
44 } |
18317
c83efc00f6cc
made LocationIdentity values support .equals() instead of identity (i.e. '==') for equality comparisons (and as hash map keys)
Doug Simon <doug.simon@oracle.com>
parents:
18307
diff
changeset
|
45 return true; |
18259
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
46 } |
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
47 } |
9792
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
48 |
21390
f9024b74dd9e
Allow subclasses of LocationIdentity to provide immuatability information
Christian Wimmer <christian.wimmer@oracle.com>
parents:
19997
diff
changeset
|
49 private final String name; |
f9024b74dd9e
Allow subclasses of LocationIdentity to provide immuatability information
Christian Wimmer <christian.wimmer@oracle.com>
parents:
19997
diff
changeset
|
50 private final boolean immutable; |
9792
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
51 |
18259
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
52 private NamedLocationIdentity(String name, boolean immutable) { |
9792
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
53 this.name = name; |
21390
f9024b74dd9e
Allow subclasses of LocationIdentity to provide immuatability information
Christian Wimmer <christian.wimmer@oracle.com>
parents:
19997
diff
changeset
|
54 this.immutable = immutable; |
18231
70df63b02309
Use LocationIdentity.isImmutable instead of testing against FINAL_LOCATION
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
9792
diff
changeset
|
55 } |
70df63b02309
Use LocationIdentity.isImmutable instead of testing against FINAL_LOCATION
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
9792
diff
changeset
|
56 |
70df63b02309
Use LocationIdentity.isImmutable instead of testing against FINAL_LOCATION
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
9792
diff
changeset
|
57 /** |
18307
85f5227a7a37
add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18259
diff
changeset
|
58 * Creates a named unique location identity for read and write operations against mutable |
85f5227a7a37
add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18259
diff
changeset
|
59 * memory. |
18231
70df63b02309
Use LocationIdentity.isImmutable instead of testing against FINAL_LOCATION
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
9792
diff
changeset
|
60 * |
70df63b02309
Use LocationIdentity.isImmutable instead of testing against FINAL_LOCATION
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
9792
diff
changeset
|
61 * @param name the name of the new location identity |
70df63b02309
Use LocationIdentity.isImmutable instead of testing against FINAL_LOCATION
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
9792
diff
changeset
|
62 */ |
18307
85f5227a7a37
add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18259
diff
changeset
|
63 public static NamedLocationIdentity mutable(String name) { |
18259
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
64 return create(name, false); |
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
65 } |
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
66 |
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
67 /** |
18307
85f5227a7a37
add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18259
diff
changeset
|
68 * Creates a named unique location identity for read operations against immutable memory. |
85f5227a7a37
add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18259
diff
changeset
|
69 * Immutable memory will never have a visible write in the graph, which is more restictive than |
85f5227a7a37
add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18259
diff
changeset
|
70 * Java final. |
85f5227a7a37
add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18259
diff
changeset
|
71 * |
85f5227a7a37
add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18259
diff
changeset
|
72 * @param name the name of the new location identity |
85f5227a7a37
add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18259
diff
changeset
|
73 */ |
85f5227a7a37
add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18259
diff
changeset
|
74 public static NamedLocationIdentity immutable(String name) { |
85f5227a7a37
add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18259
diff
changeset
|
75 return create(name, true); |
85f5227a7a37
add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18259
diff
changeset
|
76 } |
85f5227a7a37
add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18259
diff
changeset
|
77 |
85f5227a7a37
add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18259
diff
changeset
|
78 /** |
18259
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
79 * Creates a named unique location identity for read and write operations. |
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
80 * |
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
81 * @param name the name of the new location identity |
18307
85f5227a7a37
add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18259
diff
changeset
|
82 * @param immutable true if the location is immutable |
18259
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
83 */ |
18307
85f5227a7a37
add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18259
diff
changeset
|
84 private static NamedLocationIdentity create(String name, boolean immutable) { |
18317
c83efc00f6cc
made LocationIdentity values support .equals() instead of identity (i.e. '==') for equality comparisons (and as hash map keys)
Doug Simon <doug.simon@oracle.com>
parents:
18307
diff
changeset
|
85 NamedLocationIdentity id = new NamedLocationIdentity(name, immutable); |
c83efc00f6cc
made LocationIdentity values support .equals() instead of identity (i.e. '==') for equality comparisons (and as hash map keys)
Doug Simon <doug.simon@oracle.com>
parents:
18307
diff
changeset
|
86 assert DB.checkUnique(id); |
c83efc00f6cc
made LocationIdentity values support .equals() instead of identity (i.e. '==') for equality comparisons (and as hash map keys)
Doug Simon <doug.simon@oracle.com>
parents:
18307
diff
changeset
|
87 return id; |
18259
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
88 } |
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
89 |
e1b2489393f4
added global map to ensure each NamedLocationIdentity object has a unique name which can be used for implementing .equals() and .hashCode()
Doug Simon <doug.simon@oracle.com>
parents:
18231
diff
changeset
|
90 @Override |
21390
f9024b74dd9e
Allow subclasses of LocationIdentity to provide immuatability information
Christian Wimmer <christian.wimmer@oracle.com>
parents:
19997
diff
changeset
|
91 public boolean isImmutable() { |
f9024b74dd9e
Allow subclasses of LocationIdentity to provide immuatability information
Christian Wimmer <christian.wimmer@oracle.com>
parents:
19997
diff
changeset
|
92 return immutable; |
f9024b74dd9e
Allow subclasses of LocationIdentity to provide immuatability information
Christian Wimmer <christian.wimmer@oracle.com>
parents:
19997
diff
changeset
|
93 } |
f9024b74dd9e
Allow subclasses of LocationIdentity to provide immuatability information
Christian Wimmer <christian.wimmer@oracle.com>
parents:
19997
diff
changeset
|
94 |
f9024b74dd9e
Allow subclasses of LocationIdentity to provide immuatability information
Christian Wimmer <christian.wimmer@oracle.com>
parents:
19997
diff
changeset
|
95 @Override |
9792
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
96 public String toString() { |
19997
58f2aad37d0e
Further improvements to IGV. Make displayed names of nodes shorter.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
19858
diff
changeset
|
97 return name + (isImmutable() ? ":final" : ""); |
18231
70df63b02309
Use LocationIdentity.isImmutable instead of testing against FINAL_LOCATION
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
9792
diff
changeset
|
98 } |
70df63b02309
Use LocationIdentity.isImmutable instead of testing against FINAL_LOCATION
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
9792
diff
changeset
|
99 |
9792
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
100 /** |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
101 * Returns the named location identity for an array of the given element kind. Array accesses of |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
102 * the same kind must have the same location identity unless an alias analysis guarantees that |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
103 * two distinct arrays are accessed. |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
104 */ |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
105 public static LocationIdentity getArrayLocation(Kind elementKind) { |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
106 return ARRAY_LOCATIONS.get(elementKind); |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
107 } |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
108 |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
109 private static final EnumMap<Kind, LocationIdentity> ARRAY_LOCATIONS = initArrayLocations(); |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
110 |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
111 private static EnumMap<Kind, LocationIdentity> initArrayLocations() { |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
112 EnumMap<Kind, LocationIdentity> result = new EnumMap<>(Kind.class); |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
113 for (Kind kind : Kind.values()) { |
18307
85f5227a7a37
add mutable/immutable factory methods to NamedLocationIdentity
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
18259
diff
changeset
|
114 result.put(kind, NamedLocationIdentity.mutable("Array: " + kind.getJavaName())); |
9792
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
115 } |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
116 return result; |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
117 } |
06dc2d2324d6
pulled LocationIdentity into a top level class and moved it to the api.meta project
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
118 } |