Search in sources :

Example 1 with MM_StringTablePointer

use of com.ibm.j9ddr.vm29.pointer.generated.MM_StringTablePointer 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?
}
Also used : PointerPointer(com.ibm.j9ddr.vm29.pointer.PointerPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9HashTablePointer(com.ibm.j9ddr.vm29.pointer.generated.J9HashTablePointer) MM_StringTablePointer(com.ibm.j9ddr.vm29.pointer.generated.MM_StringTablePointer)

Example 2 with MM_StringTablePointer

use of com.ibm.j9ddr.vm29.pointer.generated.MM_StringTablePointer 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?
}
Also used : StringTable(com.ibm.j9ddr.vm29.j9.StringTable) PointerPointer(com.ibm.j9ddr.vm29.pointer.PointerPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9HashTablePointer(com.ibm.j9ddr.vm29.pointer.generated.J9HashTablePointer) MM_StringTablePointer(com.ibm.j9ddr.vm29.pointer.generated.MM_StringTablePointer)

Aggregations

CorruptDataException (com.ibm.j9ddr.CorruptDataException)2 PointerPointer (com.ibm.j9ddr.vm29.pointer.PointerPointer)2 J9HashTablePointer (com.ibm.j9ddr.vm29.pointer.generated.J9HashTablePointer)2 MM_StringTablePointer (com.ibm.j9ddr.vm29.pointer.generated.MM_StringTablePointer)2 StringTable (com.ibm.j9ddr.vm29.j9.StringTable)1