Search in sources :

Example 6 with U32

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);
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) U32(com.ibm.j9ddr.vm29.types.U32) J9ArrayClassPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ArrayClassPointer)

Example 7 with U32

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

Example 8 with U32

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

Example 9 with U32

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();
}
Also used : OMRMemCategoryPointer(com.ibm.j9ddr.vm29.pointer.generated.OMRMemCategoryPointer) U32(com.ibm.j9ddr.vm29.types.U32) HashMap(java.util.HashMap)

Example 10 with U32

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

Aggregations

U32 (com.ibm.j9ddr.vm29.types.U32)44 UDATA (com.ibm.j9ddr.vm29.types.UDATA)16 U32Pointer (com.ibm.j9ddr.vm29.pointer.U32Pointer)9 CorruptDataException (com.ibm.j9ddr.CorruptDataException)6 J9ObjectFieldOffset (com.ibm.j9ddr.vm29.j9.J9ObjectFieldOffset)6 U8Pointer (com.ibm.j9ddr.vm29.pointer.U8Pointer)6 J9ROMFieldShapePointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMFieldShapePointer)6 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)5 J9UTF8Pointer (com.ibm.j9ddr.vm29.pointer.generated.J9UTF8Pointer)5 OMRMemCategoryPointer (com.ibm.j9ddr.vm29.pointer.generated.OMRMemCategoryPointer)4 UDATAPointer (com.ibm.j9ddr.vm29.pointer.UDATAPointer)3 J9ArrayClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ArrayClassPointer)3 J9ROMClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMClassPointer)3 J9ROMMethodPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMMethodPointer)3 J9ROMNameAndSignaturePointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMNameAndSignaturePointer)3 U16 (com.ibm.j9ddr.vm29.types.U16)3 U8 (com.ibm.j9ddr.vm29.types.U8)3 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)2 J9ROMFieldShapeIterator (com.ibm.j9ddr.vm29.j9.J9ROMFieldShapeIterator)2 SelfRelativePointer (com.ibm.j9ddr.vm29.pointer.SelfRelativePointer)2