Search in sources :

Example 1 with U8Pointer

use of com.ibm.j9ddr.vm29.pointer.U8Pointer in project openj9 by eclipse.

the class GCCardTable method cleanRange.

public void cleanRange(U8Pointer lowCard, U8Pointer highCard, GCCardCleaner cardCleaner) throws CorruptDataException {
    U8Pointer thisCard = lowCard;
    U8Pointer endCard = highCard;
    while (thisCard.lt(endCard)) {
        try {
            U8 card = thisCard.at(0);
            if (!card.eq(J9ModroncoreConstants.CARD_CLEAN)) {
                VoidPointer lowAddress = cardAddrToHeapAddr(thisCard);
                VoidPointer highAddress = lowAddress.addOffset(J9ModroncoreConstants.CARD_SIZE);
                cardCleaner.clean(lowAddress, highAddress, thisCard);
            }
        } catch (CorruptDataException cde) {
            raiseCorruptDataEvent("Corrupt Card", cde, false);
        }
        thisCard = thisCard.add(1);
    }
}
Also used : U8(com.ibm.j9ddr.vm29.types.U8) VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) U8Pointer(com.ibm.j9ddr.vm29.pointer.U8Pointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 2 with U8Pointer

use of com.ibm.j9ddr.vm29.pointer.U8Pointer in project openj9 by eclipse.

the class GCObjectHeapIteratorAddressOrderedList_V1 method advance.

@Override
public void advance(UDATA size) {
    U8Pointer newAddress = scanPtr.addOffset(size);
    if (newAddress.gte(scanPtr) && newAddress.lt(scanPtrTop)) {
        scanPtr = newAddress;
        currentObject = null;
    } else {
        throw new NoSuchElementException("An address to advance is out of range");
    }
}
Also used : U8Pointer(com.ibm.j9ddr.vm29.pointer.U8Pointer) NoSuchElementException(java.util.NoSuchElementException)

Example 3 with U8Pointer

use of com.ibm.j9ddr.vm29.pointer.U8Pointer in project openj9 by eclipse.

the class J9ClassHelper method getMethodFromPCAndClass.

/*
	 * Returns a program space pointer to the matching J9Method for the
	 * specified class and PC.
	 */
public static J9MethodPointer getMethodFromPCAndClass(J9ClassPointer localClass, U8Pointer pc) throws CorruptDataException {
    J9ROMClassPointer localROMClass = localClass.romClass();
    for (int i = 0; i < localROMClass.romMethodCount().longValue(); i++) {
        J9MethodPointer localMethod = localClass.ramMethods().add(i);
        J9ROMMethodPointer romMethod = J9MethodHelper.romMethod(localMethod);
        boolean a = pc.gte(U8Pointer.cast(romMethod));
        boolean b = pc.lte(J9ROMMethodHelper.bytecodeEnd(romMethod).subOffset(1));
        if (a && b) {
            return localMethod;
        }
    }
    return J9MethodPointer.NULL;
}
Also used : J9MethodPointer(com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer) J9ROMClassPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ROMClassPointer) J9ROMMethodPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ROMMethodPointer)

Example 4 with U8Pointer

use of com.ibm.j9ddr.vm29.pointer.U8Pointer in project openj9 by eclipse.

the class RamClassWalker method allSlotsInExtendedMethodBlockDo.

private void allSlotsInExtendedMethodBlockDo() throws CorruptDataException {
    final J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
    /* add in size of method trace array if extended method block active */
    if (vm.runtimeFlags().allBitsIn(J9Consts.J9_RUNTIME_EXTENDED_METHOD_BLOCK)) {
        long extendedMethodBlockSize = 0;
        int romMethodCount = ramClass.romClass().romMethodCount().intValue();
        extendedMethodBlockSize = romMethodCount + (UDATA.SIZEOF - 1);
        extendedMethodBlockSize &= ~(UDATA.SIZEOF - 1);
        /*
			 * Gets the start address of the extended methods. It is just before the ramMethods.
			 */
        U8Pointer extendedMethodStartAddr = U8Pointer.cast(ramClass.ramMethods()).sub(extendedMethodBlockSize);
        classWalkerCallback.addSection(clazz, extendedMethodStartAddr, romMethodCount, "Extended method block", false);
        while (romMethodCount-- > 0) {
            classWalkerCallback.addSlot(clazz, SlotType.J9_U8, extendedMethodStartAddr.add(romMethodCount), "method flag", "!j9extendedmethodflaginfo");
        }
    }
}
Also used : U8Pointer(com.ibm.j9ddr.vm29.pointer.U8Pointer) J9JavaVMPointer(com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)

Example 5 with U8Pointer

use of com.ibm.j9ddr.vm29.pointer.U8Pointer in project openj9 by eclipse.

the class ThreadsCommand method getThreadName.

public static String getThreadName(J9VMThreadPointer thread) throws CorruptDataException {
    U8Pointer threadName = thread.omrVMThread().threadName();
    StringBuffer sb = new StringBuffer();
    if (threadName.isNull()) {
        sb.append("<NULL>");
    } else {
        while (!threadName.at(0).eq(0)) {
            U8 at = threadName.at(0);
            sb.append((char) at.intValue());
            threadName = threadName.add(1);
        }
    }
    return sb.toString();
}
Also used : U8(com.ibm.j9ddr.vm29.types.U8) U8Pointer(com.ibm.j9ddr.vm29.pointer.U8Pointer)

Aggregations

U8Pointer (com.ibm.j9ddr.vm29.pointer.U8Pointer)37 CorruptDataException (com.ibm.j9ddr.CorruptDataException)11 UDATA (com.ibm.j9ddr.vm29.types.UDATA)11 J9MethodPointer (com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer)8 U32 (com.ibm.j9ddr.vm29.types.U32)8 J9ROMMethodPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMMethodPointer)7 U8 (com.ibm.j9ddr.vm29.types.U8)7 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)5 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)5 U16 (com.ibm.j9ddr.vm29.types.U16)5 VoidPointer (com.ibm.j9ddr.vm29.pointer.VoidPointer)4 J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)4 BaseStackWalkerCallbacks (com.ibm.j9ddr.vm29.j9.stackwalker.BaseStackWalkerCallbacks)3 WalkState (com.ibm.j9ddr.vm29.j9.stackwalker.WalkState)3 J9VMThreadPointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer)3 CorruptData (com.ibm.dtfj.image.CorruptData)2 StackWalkResult (com.ibm.j9ddr.vm29.j9.stackwalker.StackWalkResult)2 LocalVariableTable (com.ibm.j9ddr.vm29.j9.walkers.LocalVariableTable)2 LocalVariableTableIterator (com.ibm.j9ddr.vm29.j9.walkers.LocalVariableTableIterator)2 U32Pointer (com.ibm.j9ddr.vm29.pointer.U32Pointer)2