use of com.ibm.j9ddr.vm29.pointer.PointerPointer in project openj9 by eclipse.
the class CheckEngine method checkSlotPool.
public int checkSlotPool(PointerPointer objectIndirect, VoidPointer objectIndirectBase) {
J9ObjectPointer object;
try {
object = J9ObjectPointer.cast(objectIndirect.at(0));
int result = checkObjectIndirect(object);
if (J9MODRON_GCCHK_RC_OK != result) {
CheckError error = new CheckError(objectIndirectBase, objectIndirect, _cycle, _currentCheck, result, _cycle.nextErrorCount(), CheckError.check_type_other);
_reporter.report(error);
}
} catch (CorruptDataException e) {
// TODO : cde should be part of the error
CheckError error = new CheckError(objectIndirectBase, objectIndirect, _cycle, _currentCheck, J9MODRON_GCCHK_RC_CORRUPT_DATA_EXCEPTION, _cycle.nextErrorCount(), CheckError.check_type_other);
_reporter.report(error);
}
return J9MODRON_SLOT_ITERATOR_OK;
}
use of com.ibm.j9ddr.vm29.pointer.PointerPointer 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.pointer.PointerPointer 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?
}
use of com.ibm.j9ddr.vm29.pointer.PointerPointer in project openj9 by eclipse.
the class J9ClassFieldFormatter method postFormat.
@Override
public FormatWalkResult postFormat(String name, String type, String declaredType, int typeCode, long address, PrintStream out, Context context, IStructureFormatter structureFormatter) throws CorruptDataException {
if (typeCode == TYPE_STRUCTURE_POINTER && StructureCommandUtil.typeToCommand(type).equals("!j9class")) {
PointerPointer slotPtr = PointerPointer.cast(address);
J9ClassPointer clazz = J9ClassPointer.cast(slotPtr.at(0));
if (clazz.isNull()) {
return FormatWalkResult.KEEP_WALKING;
}
out.print(" // ");
if (J9ClassHelper.isArrayClass(clazz)) {
out.print(J9ClassHelper.getArrayName(clazz));
} else {
out.print(J9ClassHelper.getName(clazz));
}
}
return FormatWalkResult.KEEP_WALKING;
}
Aggregations