use of com.ibm.j9ddr.vm29.types.U32 in project openj9 by eclipse.
the class GCArrayletObjectModelBase_V1 method getDataSizeInBytes.
/**
* Returns the size of data in an indexable object, in bytes, including leaves, excluding the header.
* @param arrayPtr Pointer to the indexable object whose size is required
* @return Size of object in bytes excluding the header
*/
public UDATA getDataSizeInBytes(J9IndexableObjectPointer array) throws CorruptDataException {
J9ArrayClassPointer clazz = J9IndexableObjectHelper.clazz(array);
U32 arrayShape = J9ROMArrayClassPointer.cast(clazz.romClass()).arrayShape();
UDATA numberOfElements = getSizeInElements(array);
UDATA size = numberOfElements.leftShift(arrayShape.bitAnd(0x0000FFFF).intValue());
return UDATA.roundToSizeofUDATA(size);
}
use of com.ibm.j9ddr.vm29.types.U32 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);
}
}
use of com.ibm.j9ddr.vm29.types.U32 in project openj9 by eclipse.
the class GCScavengerForwardedHeader_V1 method getForwardedObjectNoCheck.
protected J9ObjectPointer getForwardedObjectNoCheck() throws CorruptDataException {
if (J9BuildFlags.interp_compressedObjectHeader && !J9BuildFlags.env_littleEndian) {
/* compressed big endian - read two halves separately */
U32 low = U32Pointer.cast(objectPointer.clazzEA()).at(0).bitAnd(~ALL_TAGS);
U32 high = U32Pointer.cast(objectPointer.clazzEA()).at(1);
J9ObjectPointer forwardedObject = J9ObjectPointer.cast(new UDATA(low).bitOr(new UDATA(high).leftShift(32)));
return forwardedObject;
} else {
/* Little endian or not compressed - read all UDATA bytes at once */
J9ObjectPointer forwardedObject = J9ObjectPointer.cast(UDATAPointer.cast(objectPointer.clazzEA()).at(0));
return forwardedObject.untag(ALL_TAGS);
}
}
use of com.ibm.j9ddr.vm29.types.U32 in project openj9 by eclipse.
the class MemoryCategoryIterator method iterateCategoryRootSet.
public static Iterator<? extends OMRMemCategoryPointer> iterateCategoryRootSet(J9PortLibraryPointer portLibrary) throws CorruptDataException {
Map<U32, OMRMemCategoryPointer> rootSetMap = new HashMap<U32, OMRMemCategoryPointer>();
Iterator<? extends OMRMemCategoryPointer> categoryIt = iterateAllCategories(portLibrary);
/* Store all categories in a map */
while (categoryIt.hasNext()) {
OMRMemCategoryPointer thisCategory = categoryIt.next();
rootSetMap.put(thisCategory.categoryCode(), thisCategory);
}
/* Remove any categories that are listed as children of any other category */
categoryIt = iterateAllCategories(portLibrary);
while (categoryIt.hasNext()) {
OMRMemCategoryPointer thisCategory = categoryIt.next();
final int numberOfChildren = thisCategory.numberOfChildren().intValue();
for (int i = 0; i < numberOfChildren; i++) {
U32 childCode = thisCategory.children().at(i);
rootSetMap.remove(childCode);
}
}
return Collections.unmodifiableCollection(rootSetMap.values()).iterator();
}
use of com.ibm.j9ddr.vm29.types.U32 in project openj9 by eclipse.
the class J9ROMFieldShapeHelper method getFieldAnnotationLocation.
private static U32Pointer getFieldAnnotationLocation(J9ROMFieldShapePointer fieldShapePointer) throws CorruptDataException {
long size = 0;
if ((fieldShapePointer.modifiers().allBitsIn(J9FieldFlagConstant))) {
size += ((fieldShapePointer.modifiers().allBitsIn(J9FieldSizeDouble)) ? U64.SIZEOF : U32.SIZEOF);
}
if (fieldShapePointer.modifiers().allBitsIn(J9FieldFlagHasGenericSignature)) {
size += U32.SIZEOF;
}
// move past J9ROMFieldShape struct and then add size in bytes
U32Pointer fieldAnnotationOffset = U32Pointer.cast(fieldShapePointer.add(1)).addOffset(size);
return fieldAnnotationOffset;
}
Aggregations