Search in sources :

Example 36 with U32

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

the class StructurePointer method getU32Bitfield.

protected U32 getU32Bitfield(int s, int b) throws CorruptDataException {
    int cell = s / StructureReader.BIT_FIELD_CELL_SIZE;
    U32 cellValue = new U32(getIntAtOffset(cell * StructureReader.BIT_FIELD_CELL_SIZE / 8));
    int n = getStartingBit(s, b);
    U32 returnValue = cellValue.leftShift(StructureReader.BIT_FIELD_CELL_SIZE - n);
    returnValue = returnValue.rightShift(StructureReader.BIT_FIELD_CELL_SIZE - b);
    return returnValue;
}
Also used : U32(com.ibm.j9ddr.vm29.types.U32)

Example 37 with U32

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

the class RomClassWalker method allSlotsInROMFieldDo.

private int allSlotsInROMFieldDo(J9ROMFieldShapePointer field) throws CorruptDataException {
    int fieldLength = 0;
    U32Pointer initialValue;
    U32 modifiers;
    J9ROMNameAndSignaturePointer fieldNAS = field.nameAndSignature();
    classWalkerCallback.addSlot(clazz, SlotType.J9_ROM_UTF8, fieldNAS.nameEA(), "name");
    classWalkerCallback.addSlot(clazz, SlotType.J9_ROM_UTF8, fieldNAS.signatureEA(), "signature");
    classWalkerCallback.addSlot(clazz, SlotType.J9_U32, field.modifiersEA(), "modifiers");
    modifiers = field.modifiers();
    initialValue = U32Pointer.cast(field.add(1));
    if (modifiers.anyBitsIn(J9FieldFlagConstant)) {
        if (modifiers.anyBitsIn(J9FieldSizeDouble)) {
            classWalkerCallback.addSlot(clazz, SlotType.J9_I64, I64Pointer.cast(initialValue), "fieldInitialValue");
            initialValue = initialValue.add(2);
        } else {
            classWalkerCallback.addSlot(clazz, SlotType.J9_I32, initialValue, "fieldInitialValue");
            initialValue = initialValue.add(1);
        }
    }
    if (modifiers.anyBitsIn(J9FieldFlagHasGenericSignature)) {
        classWalkerCallback.addSlot(clazz, SlotType.J9_ROM_UTF8, initialValue, "fieldGenSigUTF8");
        initialValue = initialValue.add(1);
    }
    if (modifiers.allBitsIn(J9FieldFlagHasFieldAnnotations)) {
        initialValue = initialValue.add(allSlotsInAnnotationDo(initialValue, "fieldAnnotation"));
    }
    fieldLength = (int) (initialValue.getAddress() - field.getAddress());
    classWalkerCallback.addSection(clazz, field, fieldLength, "field", true);
    return fieldLength;
}
Also used : J9ROMNameAndSignaturePointer(com.ibm.j9ddr.vm29.pointer.generated.J9ROMNameAndSignaturePointer) U32(com.ibm.j9ddr.vm29.types.U32) U32Pointer(com.ibm.j9ddr.vm29.pointer.U32Pointer)

Example 38 with U32

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

the class OMRMemCategoryHelper method visitMemoryCategoryChildren.

/**
 * Performs a depth-first walk of all the children of startNode, starting with startNode itself
 * @param startNode Node to start walking from
 * @param visitor Visitor object
 */
public static void visitMemoryCategoryChildren(OMRMemCategoryPointer startNode, IOMRMemCategoryVisitor visitor) throws CorruptDataException {
    visitor.visit(startNode);
    final int numberOfChildren = startNode.numberOfChildren().intValue();
    for (int i = 0; i < numberOfChildren; i++) {
        U32 childCode = startNode.children().at(i);
        OMRMemCategoryPointer child = getMemoryCategory(childCode);
        /* getMemoryCategory will map codes to the unknown code if necessary. If we've mapped to another category code,
			 * we don't want to iterate to it
			 */
        if (child.categoryCode().eq(childCode)) {
            visitMemoryCategoryChildren(child, visitor);
        } else {
            U32 thisCategoryCode = null;
            try {
                thisCategoryCode = startNode.categoryCode();
            } catch (CorruptDataException ex) {
            }
            if (thisCategoryCode == null) {
                throw new CorruptDataException("Bad memory category child relationship. Memory Category at " + startNode.getHexAddress() + " references unknown memory category code " + childCode);
            } else {
                throw new CorruptDataException("Bad memory category child relationship. Memory Category at " + startNode.getHexAddress() + " code " + thisCategoryCode + " references unknown memory category code " + childCode);
            }
        }
    }
}
Also used : OMRMemCategoryPointer(com.ibm.j9ddr.vm29.pointer.generated.OMRMemCategoryPointer) U32(com.ibm.j9ddr.vm29.types.U32) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 39 with U32

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

the class J9ROMMethodHelper method hasMethodTypeAnnotations.

public static boolean hasMethodTypeAnnotations(J9ROMMethodPointer method) throws CorruptDataException {
    boolean result = false;
    if (0 != romHelpVersion) {
        U32 extendedModifiers = getExtendedModifiersDataFromROMMethod(method);
        result = extendedModifiers.allBitsIn(J9CfrClassFile.CFR_METHOD_EXT_HAS_METHOD_TYPE_ANNOTATIONS);
    } else {
        result = method.modifiers().allBitsIn(J9JavaAccessFlags.J9AccMethodHasTypeAnnotations);
    /* J9AccMethodHasExtendedModifiers was J9AccMethodHasTypeAnnotations */
    }
    return result;
}
Also used : U32(com.ibm.j9ddr.vm29.types.U32)

Example 40 with U32

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

the class J9ROMMethodHelper method hasCodeTypeAnnotations.

public static boolean hasCodeTypeAnnotations(J9ROMMethodPointer method) throws CorruptDataException {
    boolean result = false;
    if (0 != romHelpVersion) {
        U32 extendedModifiers = getExtendedModifiersDataFromROMMethod(method);
        result = extendedModifiers.allBitsIn(J9CfrClassFile.CFR_METHOD_EXT_HAS_CODE_TYPE_ANNOTATIONS);
    }
    return result;
}
Also used : U32(com.ibm.j9ddr.vm29.types.U32)

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