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);
}
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);
}
}
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;
}
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);
}
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);
}
}
Aggregations