8199865: Avoid initializing ShortCache in ProxyGenerator

Reviewed-by: mchung
This commit is contained in:
Claes Redestad 2018-03-21 10:13:14 +01:00
parent 2c73c97dd0
commit 74827c6a87

@ -1726,7 +1726,7 @@ class ProxyGenerator {
* This map is used to look up the index of an existing entry for
* values of all types.
*/
private Map<Object,Short> map = new HashMap<>(16);
private Map<Object,Integer> map = new HashMap<>(16);
/** true if no new constant pool entries may be added */
private boolean readOnly = false;
@ -1878,7 +1878,7 @@ class ProxyGenerator {
* java.lang.Double CONSTANT_DOUBLE
*/
private short getValue(Object key) {
Short index = map.get(key);
Integer index = map.get(key);
if (index != null) {
return index.shortValue();
} else {
@ -1887,7 +1887,7 @@ class ProxyGenerator {
"late constant pool addition: " + key);
}
short i = addEntry(new ValueEntry(key));
map.put(key, i);
map.put(key, (int)i);
return i;
}
}
@ -1897,7 +1897,7 @@ class ProxyGenerator {
* references to other constant pool entries.
*/
private short getIndirect(IndirectEntry e) {
Short index = map.get(e);
Integer index = map.get(e);
if (index != null) {
return index.shortValue();
} else {
@ -1905,7 +1905,7 @@ class ProxyGenerator {
throw new InternalError("late constant pool addition");
}
short i = addEntry(e);
map.put(e, i);
map.put(e, (int)i);
return i;
}
}