Search in sources :

Example 21 with U8Pointer

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

the class DTFJJavaRuntime method getServiceLevel.

private String getServiceLevel() {
    try {
        U8Pointer serviceLevelPointer = DataType.getJ9RASPointer().serviceLevel();
        String serviceLevel = serviceLevelPointer.getCStringAtOffset(0);
        if (serviceLevel != null && serviceLevel.length() > 0) {
            return serviceLevel;
        }
    } catch (Throwable t) {
        // If we can't access the memory then we'll have to go with "unknown".
        J9DDRDTFJUtils.handleAsCorruptDataException(DTFJContext.getProcess(), t);
    }
    return "unknown";
}
Also used : U8Pointer(com.ibm.j9ddr.vm29.pointer.U8Pointer)

Example 22 with U8Pointer

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

the class GCCardTable method cleanCardsInRegion.

public void cleanCardsInRegion(GCHeapRegionDescriptor region, GCCardCleaner cardCleaner) throws CorruptDataException {
    U8Pointer lowCard = heapAddrToCardAddr(region.getLowAddress());
    U8Pointer highCard = heapAddrToCardAddr(region.getHighAddress());
    cleanRange(lowCard, highCard, cardCleaner);
}
Also used : U8Pointer(com.ibm.j9ddr.vm29.pointer.U8Pointer)

Example 23 with U8Pointer

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

the class GCCardTable method cardAddrToHeapAddr.

public VoidPointer cardAddrToHeapAddr(U8Pointer cardAddr) {
    /* Check passed card address is within the card table  */
    // Assert_MM_true((void *)cardAddr >= getCardTableStart());
    // Assert_MM_true((void *)cardAddr < _cardTableMemory->getHeapTop());
    UDATA index = UDATA.cast(cardAddr).sub(UDATA.cast(_cardTableStart));
    UDATA delta = index.leftShift(CARD_SIZE_SHIFT);
    return _heapBase.addOffset(delta);
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA)

Example 24 with U8Pointer

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

the class GCMemoryPool method freeEntryCheckGeneric.

/**
 * Check individual entries. This check is the same for ALL collectors
 * @param freeListEntry A structure to a free entry for all collectors (except Balanced)
 * @throws CorruptFreeEntryException This needs to be caught by a listener to be of any use
 * @return None. This function throws exceptions which are caught by the listener in checkFreeLists()
 */
protected void freeEntryCheckGeneric(GCHeapLinkedFreeHeader freeListEntry) throws CorruptDataException, CorruptFreeEntryException {
    MM_HeapLinkedFreeHeaderPointer freeListEntryAddress = freeListEntry.getHeader();
    UDATA size = freeListEntry.getSize();
    GCHeapRegionDescriptor region = getRegion();
    U8Pointer entryEndingAddressInclusive = U8Pointer.cast(freeListEntry.getHeader()).add(size.sub(1));
    if (freeListEntry.getHeader().isNull()) {
        throw new CorruptFreeEntryException("freeEntryCorrupt", freeListEntryAddress);
    }
    /* Make sure its a multi-slot dead object */
    if (!(ObjectModel.isDeadObject(freeListEntry.getObject()) && !ObjectModel.isSingleSlotDeadObject(freeListEntry.getObject()))) {
        throw new CorruptFreeEntryException("freeEntryCorrupt", freeListEntryAddress);
    }
    /* Self checks */
    if (!region.isAddressInRegion(VoidPointer.cast(freeListEntryAddress))) {
        throw new CorruptFreeEntryException("freeEntryCorrupt", freeListEntryAddress);
    }
    if (!region.isAddressInRegion(VoidPointer.cast(entryEndingAddressInclusive))) {
        throw new CorruptFreeEntryException("sizeFieldInvalid", freeListEntryAddress);
    }
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) MM_HeapLinkedFreeHeaderPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapLinkedFreeHeaderPointer) U8Pointer(com.ibm.j9ddr.vm29.pointer.U8Pointer)

Example 25 with U8Pointer

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

the class J9JavaVMHelper method getMethodFromPC.

/*
	 * Returns a program space pointer to the matching J9Method for the
	 * specified PC.
	 */
public static J9MethodPointer getMethodFromPC(J9JavaVMPointer vmPtr, U8Pointer pc) throws CorruptDataException {
    GCClassLoaderIterator it = GCClassLoaderIterator.from();
    while (it.hasNext()) {
        J9ClassLoaderPointer loader = it.next();
        Iterator<J9ClassPointer> classIt = ClassIterator.fromJ9Classloader(loader);
        while (classIt.hasNext()) {
            J9ClassPointer clazz = classIt.next();
            J9MethodPointer result = J9ClassHelper.getMethodFromPCAndClass(clazz, pc);
            if (!result.isNull()) {
                return result;
            }
        }
    }
    return J9MethodPointer.NULL;
}
Also used : J9MethodPointer(com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer) J9ClassPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer) GCClassLoaderIterator(com.ibm.j9ddr.vm29.j9.gc.GCClassLoaderIterator) J9ClassLoaderPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ClassLoaderPointer)

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