Search in sources :

Example 66 with UDATA

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

the class J9MemTagHelper method j9mem_get_footer_padding.

/**
 * Given the address of the headerEyecatcher for the memory block, return
 * the address of the footer padding.
 *
 * Note that there not be any padding, in which case this returns the same
 * as @ref j9mem_get_footer_tag(), the address of the footer tag.
 *
 * @throws CorruptDataException
 */
public static VoidPointer j9mem_get_footer_padding(J9MemTagPointer headerEyeCatcherAddress) throws CorruptDataException {
    UDATA cursor = UDATA.cast(U8Pointer.cast(headerEyeCatcherAddress).add(J9MemTag.SIZEOF));
    U8Pointer padding = U8Pointer.cast(cursor.add(headerEyeCatcherAddress.allocSize()));
    return VoidPointer.cast(padding);
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) U8Pointer(com.ibm.j9ddr.vm29.pointer.U8Pointer)

Example 67 with UDATA

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

the class LinearDumper method groupSectionByName.

/**
 * Find the first and the last section and group them in another section with the same name ending with a "s".
 * For example, it will group all of the methodDebugInfo in a section named methodDebugInfos
 * It is important to note that the function does not check if the sections grouped are contiguous, it will
 * group all sections between the first and the last section even if their names doesn't match.
 *
 * @param clazz
 * @param name name of sections to group
 * @param computePadding
 * @throws CorruptDataException
 */
private void groupSectionByName(final StructurePointer clazz, String name, boolean computePadding) throws CorruptDataException {
    AbstractPointer firstMethodDebugInfo = null;
    AbstractPointer lastMethodDebugInfo = null;
    for (J9ClassRegion region : classRegions) {
        if (SlotType.J9_SECTION_START == region.getType() && region.getName().equals(name)) {
            if (firstMethodDebugInfo == null || region.getSlotPtr().lt(firstMethodDebugInfo)) {
                firstMethodDebugInfo = region.getSlotPtr();
            }
            if (lastMethodDebugInfo == null || region.getSlotPtr().add(region.getLength()).gt(lastMethodDebugInfo)) {
                lastMethodDebugInfo = region.getSlotPtr().addOffset(region.getLength());
            }
        }
    }
    if (firstMethodDebugInfo != null && lastMethodDebugInfo != null) {
        UDATA length = UDATA.cast(lastMethodDebugInfo).sub(UDATA.cast(firstMethodDebugInfo));
        addSection(clazz, PointerPointer.cast(firstMethodDebugInfo), length.longValue(), name + "s", computePadding);
    }
}
Also used : AbstractPointer(com.ibm.j9ddr.vm29.pointer.AbstractPointer) UDATA(com.ibm.j9ddr.vm29.types.UDATA)

Example 68 with UDATA

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

the class RamClassWalker method allSlotsInRAMSuperClassesDo.

private void allSlotsInRAMSuperClassesDo() throws CorruptDataException {
    /* The classDepth represent the number of superclasses */
    final long classDepth = J9ClassHelper.classDepth(ramClass).longValue();
    /*
		 * The superclasses is an array, ramClass.superclasses() points to the
		 * head and we get the next superclasses by moving the pointer.
		 * superclasses.add(i) adds sizeof(UDATA) to the value of the
		 * superclass'pointer
		 */
    final PointerPointer superclasses = ramClass.superclasses();
    for (int i = 0; i < classDepth; i++) {
        classWalkerCallback.addSlot(clazz, SlotType.J9_UDATA, superclasses.add(i), "SuperClass address", "!j9class");
    }
    classWalkerCallback.addSection(clazz, superclasses, classDepth * PointerPointer.SIZEOF, "Superclasses", false);
}
Also used : PointerPointer(com.ibm.j9ddr.vm29.pointer.PointerPointer)

Example 69 with UDATA

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

the class J9ROMFieldShapeHelper method romFieldSizeOf.

public static UDATA romFieldSizeOf(J9ROMFieldShapePointer fieldShapePointer) throws CorruptDataException {
    long size = J9ROMFieldShape.SIZEOF;
    U32 modifiers = fieldShapePointer.modifiers();
    if ((modifiers.anyBitsIn(J9FieldFlagConstant))) {
        size += ((modifiers.allBitsIn(J9FieldSizeDouble)) ? U64.SIZEOF : U32.SIZEOF);
    }
    if (modifiers.anyBitsIn(J9FieldFlagHasGenericSignature)) {
        size += U32.SIZEOF;
    }
    if (modifiers.anyBitsIn(J9FieldFlagHasFieldAnnotations)) {
        long bytesToPad = 0;
        // long annotationSize = U32Pointer.cast(address + size).at(0).longValue();
        long annotationSize = U32Pointer.cast(fieldShapePointer.addOffset(size)).at(0).longValue();
        /* add the length of annotation data */
        size += annotationSize;
        /* add the size of the size of the annotation data */
        size += U32.SIZEOF;
        bytesToPad = U32.SIZEOF - (annotationSize % U32.SIZEOF);
        if (U32.SIZEOF == bytesToPad) {
            bytesToPad = 0;
        }
        /* add the padding */
        size += bytesToPad;
    }
    if (modifiers.anyBitsIn(J9FieldFlagHasTypeAnnotations)) {
        long bytesToPad = 0;
        long annotationSize = U32Pointer.cast(fieldShapePointer.addOffset(size)).at(0).longValue();
        /* add the length of annotation data */
        size += annotationSize;
        /* add the size of the size of the annotation data */
        size += U32.SIZEOF;
        bytesToPad = U32.SIZEOF - (annotationSize % U32.SIZEOF);
        if (U32.SIZEOF == bytesToPad) {
            bytesToPad = 0;
        }
        /* add the padding */
        size += bytesToPad;
    }
    return new UDATA(size);
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) U32(com.ibm.j9ddr.vm29.types.U32)

Example 70 with UDATA

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

the class ByteCodeDumper method dumpBytecodes.

public static IDATA dumpBytecodes(PrintStream out, J9ROMClassPointer romClass, J9ROMMethodPointer romMethod, U32 flags) throws Exception {
    U16 temp;
    UDATA length;
    out.append(String.format("  Argument Count: %d", romMethod.argCount().intValue()));
    out.append(nl);
    temp = romMethod.tempCount();
    out.append(String.format("  Temp Count: %d", temp.intValue()));
    out.append(nl);
    out.append(nl);
    length = ROMHelp.J9_BYTECODE_SIZE_FROM_ROM_METHOD(romMethod);
    if (length.eq(0)) {
        return new IDATA(BCT_ERR_NO_ERROR);
    /* catch abstract methods */
    }
    return j9bcutil_dumpBytecodes(out, romClass, ROMHelp.J9_BYTECODE_START_FROM_ROM_METHOD(romMethod), new UDATA(0), length.sub(1), flags, "");
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) IDATA(com.ibm.j9ddr.vm29.types.IDATA) U16(com.ibm.j9ddr.vm29.types.U16)

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