Search in sources :

Example 36 with PointerPointer

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;
}
Also used : CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)

Example 37 with PointerPointer

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?
}
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 38 with PointerPointer

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?
}
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)

Example 39 with PointerPointer

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;
}
Also used : PointerPointer(com.ibm.j9ddr.vm29.pointer.PointerPointer) J9ClassPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)

Aggregations

PointerPointer (com.ibm.j9ddr.vm29.pointer.PointerPointer)31 CorruptDataException (com.ibm.j9ddr.CorruptDataException)22 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)10 VoidPointer (com.ibm.j9ddr.vm29.pointer.VoidPointer)9 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)6 UDATA (com.ibm.j9ddr.vm29.types.UDATA)5 U32Pointer (com.ibm.j9ddr.vm29.pointer.U32Pointer)4 GCVMThreadListIterator (com.ibm.j9ddr.vm29.j9.gc.GCVMThreadListIterator)3 J9HashTablePointer (com.ibm.j9ddr.vm29.pointer.generated.J9HashTablePointer)3 J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)3 J9ROMClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMClassPointer)3 J9VMThreadPointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer)3 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)2 BaseStackWalkerCallbacks (com.ibm.j9ddr.vm29.j9.stackwalker.BaseStackWalkerCallbacks)2 WalkState (com.ibm.j9ddr.vm29.j9.stackwalker.WalkState)2 AbstractPointer (com.ibm.j9ddr.vm29.pointer.AbstractPointer)2 J9ConstantPoolPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ConstantPoolPointer)2 J9RAMClassRefPointer (com.ibm.j9ddr.vm29.pointer.generated.J9RAMClassRefPointer)2 J9RAMMethodHandleRefPointer (com.ibm.j9ddr.vm29.pointer.generated.J9RAMMethodHandleRefPointer)2 J9RAMMethodTypeRefPointer (com.ibm.j9ddr.vm29.pointer.generated.J9RAMMethodTypeRefPointer)2