Search in sources :

Example 11 with UDATA

use of com.ibm.j9ddr.vm29.types.UDATA in project openj9 by eclipse.

the class GCArrayletObjectModelBase_V1 method getSpineSize.

/**
 * Get the spine size for an arraylet with these properties
 * @param J9Class The class of the array.
 * @param layout The layout of the indexable object
 * @param numberArraylets Number of arraylets for this indexable object
 * @param dataSize How many elements are in the indexable object
 * @param alignData Should the data section be aligned
 * @return spineSize The actual size in byte of the spine
 */
protected UDATA getSpineSize(long layout, UDATA numberArraylets, UDATA dataSize, boolean alignData) throws CorruptDataException {
    UDATA headerSize = getHeaderSize(layout);
    UDATA spineSizeWithoutHeader = getSpineSizeWithoutHeader(layout, numberArraylets, dataSize, alignData);
    return spineSizeWithoutHeader.add(headerSize);
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA)

Example 12 with UDATA

use of com.ibm.j9ddr.vm29.types.UDATA in project openj9 by eclipse.

the class GCArrayletObjectModelBase_V1 method getElementAddress.

@Override
public VoidPointer getElementAddress(J9IndexableObjectPointer array, int elementIndex, int elementSize) throws CorruptDataException {
    boolean isInlineContiguous = isInlineContiguousArraylet(array);
    UDATA byteOffsetIntoData = new UDATA(elementIndex * (long) elementSize);
    if (isInlineContiguous) {
        return VoidPointer.cast(getDataPointerForContiguous(array).addOffset(byteOffsetIntoData));
    } else {
        ObjectReferencePointer arrayoid = getArrayoidPointer(array);
        UDATA arrayletIndex = byteOffsetIntoData.rightShift(arrayletLeafLogSize);
        VoidPointer arrayletLeafBaseAddress = VoidPointer.cast(arrayoid.at(arrayletIndex));
        if (arrayletLeafBaseAddress.isNull()) {
            /* this can happen if the arraylet wasn't fully initialized */
            throw new NoSuchElementException("Arraylet leaf not yet initialized");
        }
        UDATA indexIntoArraylet = byteOffsetIntoData.bitAnd(arrayletLeafSizeMask);
        return arrayletLeafBaseAddress.addOffset(indexIntoArraylet);
    }
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) ObjectReferencePointer(com.ibm.j9ddr.vm29.pointer.ObjectReferencePointer) NoSuchElementException(java.util.NoSuchElementException)

Example 13 with UDATA

use of com.ibm.j9ddr.vm29.types.UDATA in project openj9 by eclipse.

the class GCArrayletObjectModelBase_V1 method numExternalArraylets.

/**
 * Return the total number of arraylets for an indexable object, not including the arraylet in the spine.
 * Note that discontiugous arrays always have an empty leaf contained in the spine.
 * @param array pointer to array
 * @return the number of leaf arraylets
 */
protected UDATA numExternalArraylets(J9IndexableObjectPointer array) throws CorruptDataException {
    UDATA numberOfArraylets = new UDATA(0);
    if ((getArrayLayout(array) != GC_ArrayletObjectModelBase$ArrayLayout.InlineContiguous)) {
        numberOfArraylets = numArraylets(getDataSizeInBytes(array));
        numberOfArraylets = numberOfArraylets.sub(1);
    }
    return numberOfArraylets;
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA)

Example 14 with UDATA

use of com.ibm.j9ddr.vm29.types.UDATA 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 15 with UDATA

use of com.ibm.j9ddr.vm29.types.UDATA in project openj9 by eclipse.

the class GCHeapLinkedFreeHeader_V1 method getNextImpl.

private UDATA getNextImpl() throws CorruptDataException {
    Pointer nextEA = heapLinkedFreeHeaderPointer._nextEA();
    if (J9BuildFlags.interp_compressedObjectHeader) {
        U32Pointer nextPointer = U32Pointer.cast(nextEA);
        U32 lowBits = nextPointer.at(0);
        U32 highBits = nextPointer.at(1);
        return new UDATA(highBits).leftShift(32).bitOr(lowBits);
    } else {
        return UDATAPointer.cast(nextEA).at(0);
    }
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) U32(com.ibm.j9ddr.vm29.types.U32) MM_HeapLinkedFreeHeaderPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapLinkedFreeHeaderPointer) Pointer(com.ibm.j9ddr.vm29.pointer.Pointer) UDATAPointer(com.ibm.j9ddr.vm29.pointer.UDATAPointer) U32Pointer(com.ibm.j9ddr.vm29.pointer.U32Pointer) U32Pointer(com.ibm.j9ddr.vm29.pointer.U32Pointer)

Aggregations

UDATA (com.ibm.j9ddr.vm29.types.UDATA)86 CorruptDataException (com.ibm.j9ddr.CorruptDataException)22 U32 (com.ibm.j9ddr.vm29.types.U32)16 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)14 U8Pointer (com.ibm.j9ddr.vm29.pointer.U8Pointer)10 J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)10 UDATAPointer (com.ibm.j9ddr.vm29.pointer.UDATAPointer)9 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)8 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)8 VoidPointer (com.ibm.j9ddr.vm29.pointer.VoidPointer)7 J9VMThreadPointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer)6 PointerPointer (com.ibm.j9ddr.vm29.pointer.PointerPointer)5 J9ROMMethodPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMMethodPointer)4 U16 (com.ibm.j9ddr.vm29.types.U16)4 J9ObjectFieldOffset (com.ibm.j9ddr.vm29.j9.J9ObjectFieldOffset)3 GCHeapRegionDescriptor (com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionDescriptor)3 J9ArrayClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ArrayClassPointer)3 J9JITExceptionTablePointer (com.ibm.j9ddr.vm29.pointer.generated.J9JITExceptionTablePointer)3 J9MethodPointer (com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer)3 IDATA (com.ibm.j9ddr.vm29.types.IDATA)3