Search in sources :

Example 41 with UDATA

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

the class CheckEngine method checkJ9Class.

private int checkJ9Class(J9ClassPointer clazz, J9MemorySegmentPointer segment, int checkFlags) throws CorruptDataException {
    if (clazz.isNull()) {
        return J9MODRON_GCCHK_RC_OK;
    }
    if (clazz.anyBitsIn(J9MODRON_GCCHK_J9CLASS_ALIGNMENT_MASK)) {
        return J9MODRON_GCCHK_RC_CLASS_POINTER_UNALIGNED;
    }
    /* Check that the class header containes the expected values */
    int ret = checkJ9ClassHeader(clazz);
    if (J9MODRON_GCCHK_RC_OK != ret) {
        return ret;
    }
    /* Check that class is not unloaded */
    ret = checkJ9ClassIsNotUnloaded(clazz);
    if (J9MODRON_GCCHK_RC_OK != ret) {
        return ret;
    }
    if ((checkFlags & J9MODRON_GCCHK_VERIFY_RANGE) != J9MODRON_GCCHK_VERIFY_RANGE) {
        UDATA delta = UDATA.cast(segment.heapAlloc()).sub(UDATA.cast(clazz));
        /* Basic check that there is enough room for the object header */
        if (delta.lt(J9Class.SIZEOF)) {
            return J9MODRON_GCCHK_RC_CLASS_INVALID_RANGE;
        }
    }
    return J9MODRON_GCCHK_RC_OK;
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA)

Example 42 with UDATA

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

the class CheckEngine method checkIndexableFlag.

private boolean checkIndexableFlag(J9ObjectPointer object) throws CorruptDataException {
    UDATA classShape = ObjectModel.getClassShape(J9ObjectHelper.clazz(object));
    boolean isIndexable = ObjectModel.isIndexable(object);
    if (classShape.eq(OBJECT_HEADER_SHAPE_POINTERS)) {
        return isIndexable;
    }
    if (classShape.eq(OBJECT_HEADER_SHAPE_BYTES)) {
        return isIndexable;
    }
    if (classShape.eq(OBJECT_HEADER_SHAPE_WORDS)) {
        return isIndexable;
    }
    if (classShape.eq(OBJECT_HEADER_SHAPE_LONGS)) {
        return isIndexable;
    }
    if (classShape.eq(OBJECT_HEADER_SHAPE_DOUBLES)) {
        return isIndexable;
    }
    return !isIndexable;
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA)

Example 43 with UDATA

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

the class J9ObjectStructureFormatter method printObjectField.

public void printObjectField(PrintStream out, int tabLevel, J9ClassPointer localClazz, U8Pointer dataStart, J9ClassPointer fromClass, J9ObjectFieldOffset objectFieldOffset) throws CorruptDataException {
    J9ROMFieldShapePointer fieldShape = objectFieldOffset.getField();
    UDATA fieldOffset = objectFieldOffset.getOffsetOrAddress();
    boolean isHiddenField = objectFieldOffset.isHidden();
    String className = J9UTF8Helper.stringValue(fromClass.romClass().className());
    String fieldName = J9UTF8Helper.stringValue(fieldShape.nameAndSignature().name());
    String fieldSignature = J9UTF8Helper.stringValue(fieldShape.nameAndSignature().signature());
    U8Pointer valuePtr = dataStart;
    valuePtr = valuePtr.add(fieldOffset);
    padding(out, tabLevel);
    out.print(String.format("%s %s = ", fieldSignature, fieldName));
    if (fieldShape.modifiers().anyBitsIn(J9FieldSizeDouble)) {
        out.print(U64Pointer.cast(valuePtr).at(0).getHexValue());
    } else if (fieldShape.modifiers().anyBitsIn(J9FieldFlagObject)) {
        AbstractPointer ptr = J9BuildFlags.gc_compressedPointers ? U32Pointer.cast(valuePtr) : UDATAPointer.cast(valuePtr);
        out.print(String.format("!fj9object 0x%x", ptr.at(0).longValue()));
    } else {
        out.print(I32Pointer.cast(valuePtr).at(0).getHexValue());
    }
    out.print(String.format(" (offset=%d) (%s)", fieldOffset.longValue(), className));
    if (isHiddenField) {
        out.print(" <hidden>");
    }
}
Also used : AbstractPointer(com.ibm.j9ddr.vm29.pointer.AbstractPointer) UDATA(com.ibm.j9ddr.vm29.types.UDATA) J9ROMFieldShapePointer(com.ibm.j9ddr.vm29.pointer.generated.J9ROMFieldShapePointer) U8Pointer(com.ibm.j9ddr.vm29.pointer.U8Pointer)

Example 44 with UDATA

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

the class DTFJJavaMethod method getBytecodeSections.

@SuppressWarnings("rawtypes")
public Iterator getBytecodeSections() {
    if (byteCodeSections == null) {
        byteCodeSections = new ArrayList<Object>();
        try {
            J9ROMMethodPointer originalRomMethod = ROMHelp.getOriginalROMMethod(j9ramMethod);
            if (!originalRomMethod.modifiers().anyBitsIn(J9JavaAccessFlags.J9AccNative)) {
                U8Pointer bcStart = ROMHelp.J9_BYTECODE_START_FROM_ROM_METHOD(originalRomMethod);
                UDATA bcSize = ROMHelp.J9_BYTECODE_SIZE_FROM_ROM_METHOD(originalRomMethod);
                J9DDRImageSection is = DTFJContext.getImageSection(bcStart.getAddress(), "bytecode section at " + j9ramMethod.bytecodes().getAddress());
                is.setSize(bcSize.longValue());
                byteCodeSections.add(is);
                if (!j9romMethod.equals(originalRomMethod)) {
                    is = DTFJContext.getImageSection(j9ramMethod.bytecodes().getAddress(), "bytecode section at " + j9ramMethod.bytecodes().getAddress());
                    is.setSize(bcSize.longValue());
                    byteCodeSections.add(is);
                }
            }
        } catch (Throwable t) {
            CorruptData cd = J9DDRDTFJUtils.handleAsCorruptData(DTFJContext.getProcess(), t);
            byteCodeSections.add(cd);
        }
    }
    return byteCodeSections.iterator();
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) U8Pointer(com.ibm.j9ddr.vm29.pointer.U8Pointer) J9ROMMethodPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ROMMethodPointer) CorruptData(com.ibm.dtfj.image.CorruptData) J9DDRImageSection(com.ibm.j9ddr.view.dtfj.image.J9DDRImageSection)

Example 45 with UDATA

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

the class J9ObjectFieldOffsetIterator_V1 method nextField.

private void nextField() throws CorruptDataException {
    boolean walkHiddenFields = false;
    isHidden = false;
    field = null;
    /*
		 * Walk regular ROM fields until we run out of them. Then switch
		 * to hidden instance fields if the caller wants them.
		 */
    if (hiddenInstanceFieldWalkIndex == -1) {
        fieldOffsetsFindNext();
        if (field == null && walkFlags.anyBitsIn(J9VM_FIELD_OFFSET_WALK_INCLUDE_HIDDEN)) {
            walkHiddenFields = true;
            /* Start the walk over the hidden fields array in reverse order. */
            hiddenInstanceFieldWalkIndex = hiddenInstanceFieldList.size();
        }
    } else {
        walkHiddenFields = true;
    }
    if (walkHiddenFields && hiddenInstanceFieldWalkIndex != 0) {
        /* Note: hiddenInstanceFieldWalkIndex is the index of the last hidden instance field that was returned. */
        HiddenInstanceField hiddenField = hiddenInstanceFieldList.get(--hiddenInstanceFieldWalkIndex);
        field = hiddenField.shape();
        isHidden = true;
        /*
			 * This function returns offsets relative to the end of the object header,
			 * whereas fieldOffset is relative to the start of the header.
			 */
        offset = new UDATA(hiddenField.fieldOffset().intValue() - J9Object.SIZEOF);
        /* Hidden fields do not have a valid JVMTI index. */
        index = new UDATA(-1);
    }
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA)

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