8245120: JFR: Parser unable to return typed version

Reviewed-by: mgronlun
This commit is contained in:
Erik Gahlin 2020-05-25 16:36:34 +02:00
parent 36c4b11bc6
commit ad940d3154
2 changed files with 13 additions and 0 deletions

View File

@ -77,6 +77,13 @@ public final class LongMap<T> {
bitSet.set(bitSetIndex, false); bitSet.set(bitSetIndex, false);
} }
public void clearId(long id) {
int bitSetIndex = bitSetIndex(tableIndexOf(id), 0);
for (int i = 0; i < bitCount; i++) {
bitSet.set(bitSetIndex + i, false);
}
}
public boolean isSetId(long id, int bitIndex) { public boolean isSetId(long id, int bitIndex) {
int bitSetIndex = bitSetIndex(tableIndexOf(id), bitIndex); int bitSetIndex = bitSetIndex(tableIndexOf(id), bitIndex);
return bitSet.get(bitSetIndex); return bitSet.get(bitSetIndex);
@ -103,6 +110,9 @@ public final class LongMap<T> {
} }
public boolean hasKey(long id) { public boolean hasKey(long id) {
if (keys == EMPTY_KEYS) {
return false;
}
int index = index(id); int index = index(id);
while (true) { while (true) {
if (objects[index] == null) { if (objects[index] == null) {

View File

@ -156,6 +156,9 @@ final class ConstantMap {
} }
public void put(long key, Object value) { public void put(long key, Object value) {
if (objects.hasKey(key)) {
objects.clearId(key);
}
objects.put(key, value); objects.put(key, value);
} }