use of com.ibm.j9ddr.vm29.j9.StringTable in project openj9 by eclipse.
the class CheckStringTable method check.
@Override
public void check() {
// TODO : wouldn't it be easier to use the iterator?
try {
MM_StringTablePointer stringTable = getGCExtensions().stringTable();
long tableCount = stringTable._tableCount().longValue();
for (long tableIndex = 0; tableIndex < tableCount; tableIndex++) {
J9HashTablePointer hashTable = J9HashTablePointer.cast(stringTable._table().at(tableIndex));
SlotIterator<PointerPointer> stringTableIterator = HashTable.fromJ9HashTable(hashTable, true, PointerPointer.class, new StringTable.StringHashFunction<PointerPointer>(), new StringTable.StringComparatorFunction<PointerPointer>()).iterator();
while (stringTableIterator.hasNext()) {
PointerPointer slot = stringTableIterator.next();
if (slot.notNull()) {
if (_engine.checkSlotPool(slot, VoidPointer.cast(hashTable)) != J9MODRON_SLOT_ITERATOR_OK) {
return;
}
}
}
}
} catch (CorruptDataException e) {
// TODO: handle exception
}
// TODO : what about the cache?
}
use of com.ibm.j9ddr.vm29.j9.StringTable in project openj9 by eclipse.
the class CheckStringTable method print.
@Override
public void print() {
// TODO : wouldn't it be easier to use the iterator?
try {
MM_StringTablePointer stringTable = getGCExtensions().stringTable();
long tableCount = stringTable._tableCount().longValue();
ScanFormatter formatter = new ScanFormatter(this, "StringTable", stringTable);
for (long tableIndex = 0; tableIndex < tableCount; tableIndex++) {
J9HashTablePointer hashTablePtr = J9HashTablePointer.cast(stringTable._table().at(tableIndex));
HashTable<PointerPointer> hashTable = HashTable.fromJ9HashTable(hashTablePtr, true, PointerPointer.class, new StringTable.StringHashFunction<PointerPointer>(), new StringTable.StringComparatorFunction<PointerPointer>());
SlotIterator<PointerPointer> stringTableIterator = hashTable.iterator();
while (stringTableIterator.hasNext()) {
PointerPointer slot = stringTableIterator.next();
if (slot.notNull()) {
formatter.entry(slot.at(0));
}
}
}
formatter.end("StringTable", stringTable);
} catch (CorruptDataException e) {
// TODO: handle exception
}
// TODO : what about the cache?
}
Aggregations