Search in sources :

Example 1 with AddressedCorruptDataException

use of com.ibm.j9ddr.AddressedCorruptDataException in project openj9 by eclipse.

the class GCHeapLinkedFreeHeader_V1 method getNext.

@Override
public GCHeapLinkedFreeHeader getNext() throws CorruptDataException {
    UDATA next = getNextImpl();
    if (!next.anyBitsIn(J9Consts.J9_GC_OBJ_HEAP_HOLE_MASK)) {
        throw new AddressedCorruptDataException(heapLinkedFreeHeaderPointer.getAddress(), "Next pointer not tagged");
    }
    next = next.bitAnd(~J9Consts.J9_GC_OBJ_HEAP_HOLE_MASK);
    // Presumably code within a version implementation does not need to look up the required version
    return new GCHeapLinkedFreeHeader_V1(next);
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) AddressedCorruptDataException(com.ibm.j9ddr.AddressedCorruptDataException)

Example 2 with AddressedCorruptDataException

use of com.ibm.j9ddr.AddressedCorruptDataException in project openj9 by eclipse.

the class J9ClassHelper method getArrayName.

public static String getArrayName(J9ClassPointer clazz) throws CorruptDataException {
    J9ArrayClassPointer arrayClass = J9ArrayClassPointer.cast(clazz);
    StringBuilder name = new StringBuilder();
    int arity = 0;
    try {
        arity = arrayClass.arity().intValue();
    } catch (InvalidDataTypeException e) {
        throw new AddressedCorruptDataException(arrayClass.getAddress(), "Array arity larger than MAXINT");
    }
    if (arity > MAXIMUM_ARRAY_ARITY) {
        // Doubtful
        throw new AddressedCorruptDataException(arrayClass.getAddress(), "Very high arity " + arity + " from array class 0x" + Long.toHexString(arrayClass.getAddress()));
    }
    for (int i = 0; i < arity; i++) {
        name.append('[');
    }
    String elementClassName = J9ClassHelper.getName(arrayClass.leafComponentType());
    Character type = TYPE_MAP.get(elementClassName);
    if (type != null) {
        name.append(type);
    } else {
        name.append('L');
        name.append(elementClassName);
        name.append(";");
    }
    return name.toString();
}
Also used : J9ArrayClassPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ArrayClassPointer) AddressedCorruptDataException(com.ibm.j9ddr.AddressedCorruptDataException) InvalidDataTypeException(com.ibm.j9ddr.InvalidDataTypeException)

Aggregations

AddressedCorruptDataException (com.ibm.j9ddr.AddressedCorruptDataException)2 InvalidDataTypeException (com.ibm.j9ddr.InvalidDataTypeException)1 J9ArrayClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ArrayClassPointer)1 UDATA (com.ibm.j9ddr.vm29.types.UDATA)1