Search in sources :

Example 16 with PointerPointer

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

the class J9MethodFieldFormatter method postFormat.

/* (non-Javadoc)
	 * @see com.ibm.j9ddr.tools.ddrinteractive.IFieldFormatter#postFormat(java.lang.String, java.lang.String, int, long, java.io.PrintStream, com.ibm.j9ddr.tools.ddrinteractive.Context, com.ibm.j9ddr.tools.ddrinteractive.IStructureFormatter)
	 */
@Override
public FormatWalkResult postFormat(String name, String type, String declaredType, int typeCode, long address, PrintStream out, Context context, IStructureFormatter structureFormatter) throws CorruptDataException {
    if (typeCode == TYPE_STRUCTURE_POINTER && StructureCommandUtil.typeToCommand(type).equals("!j9method")) {
        PointerPointer slotPtr = PointerPointer.cast(address);
        J9MethodPointer method = J9MethodPointer.cast(slotPtr.at(0));
        if (method.isNull()) {
            return FormatWalkResult.KEEP_WALKING;
        }
        out.print(" // ");
        J9ROMMethodPointer j9romMethod = J9MethodHelper.romMethod(method);
        J9ClassPointer clazz = ConstantPoolHelpers.J9_CLASS_FROM_METHOD(method);
        out.print(J9ClassHelper.getName(clazz));
        out.print(".");
        out.print(J9ROMMethodHelper.getName(j9romMethod));
        out.print(J9ROMMethodHelper.getSignature(j9romMethod));
    }
    return FormatWalkResult.KEEP_WALKING;
}
Also used : J9MethodPointer(com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer) PointerPointer(com.ibm.j9ddr.vm29.pointer.PointerPointer) J9ClassPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer) J9ROMMethodPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ROMMethodPointer)

Example 17 with PointerPointer

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

the class StructurePointerFormatter method format.

@Override
public FormatWalkResult format(String name, String type, String declaredType, int typeCode, long address, PrintStream out, Context context, IStructureFormatter structureFormatter) throws CorruptDataException {
    if (typeCode == TYPE_STRUCTURE_POINTER) {
        PointerPointer ptr = PointerPointer.cast(address);
        // Design 42819
        // To make debugging easier we'll try to figure out the runtime type
        // (if this information is available) and print the structure as that type.
        type = RuntimeTypeResolutionHelper.findRuntimeType(type, ptr.at(0), context);
        type = StructureCommandUtil.typeToCommand(type);
        out.print(type);
        out.print(" ");
        out.print(ptr.at(0).getHexAddress());
        return FormatWalkResult.STOP_WALKING;
    } else {
        return FormatWalkResult.KEEP_WALKING;
    }
}
Also used : PointerPointer(com.ibm.j9ddr.vm29.pointer.PointerPointer)

Example 18 with PointerPointer

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

the class CheckVMThreads method check.

@Override
public void check() {
    try {
        GCVMThreadListIterator vmThreadListIterator = GCVMThreadListIterator.from();
        while (vmThreadListIterator.hasNext()) {
            J9VMThreadPointer walkThread = vmThreadListIterator.next();
            GCVMThreadIterator vmthreadIterator = GCVMThreadIterator.fromJ9VMThread(walkThread);
            while (vmthreadIterator.hasNext()) {
                PointerPointer slot = PointerPointer.cast(vmthreadIterator.nextAddress());
                if (_engine.checkSlotVMThread(slot, VoidPointer.cast(walkThread), CheckError.check_type_other, vmthreadIterator.getState()) != J9MODRON_SLOT_ITERATOR_OK) {
                    continue;
                }
            }
        }
    } catch (CorruptDataException e) {
    // TODO: handle exception
    }
}
Also used : GCVMThreadListIterator(com.ibm.j9ddr.vm29.j9.gc.GCVMThreadListIterator) PointerPointer(com.ibm.j9ddr.vm29.pointer.PointerPointer) J9VMThreadPointer(com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) GCVMThreadIterator(com.ibm.j9ddr.vm29.j9.gc.GCVMThreadIterator)

Example 19 with PointerPointer

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

the class J9ObjectFieldFormatter method postFormat.

@Override
public FormatWalkResult postFormat(String name, String type, String declaredType, int typeCode, long address, PrintStream out, Context context, IStructureFormatter structureFormatter) throws CorruptDataException {
    if (typeCode == TYPE_STRUCTURE_POINTER && StructureCommandUtil.typeToCommand(type).equals("!j9object")) {
        PointerPointer slotPtr = PointerPointer.cast(address);
        J9ObjectPointer object = J9ObjectPointer.cast(slotPtr.at(0));
        if (object.isNull()) {
            return FormatWalkResult.KEEP_WALKING;
        }
        J9ClassPointer clazz = J9ObjectHelper.clazz(object);
        out.print(" // ");
        if (J9ClassHelper.isArrayClass(clazz)) {
            out.print(J9ClassHelper.getArrayName(clazz));
        } else {
            out.print(J9ClassHelper.getName(clazz));
        }
    }
    return FormatWalkResult.KEEP_WALKING;
}
Also used : PointerPointer(com.ibm.j9ddr.vm29.pointer.PointerPointer) J9ClassPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)

Example 20 with PointerPointer

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

the class JITLook method hash_jit_artifact_search.

public static J9JITExceptionTablePointer hash_jit_artifact_search(J9JITHashTablePointer table, UDATA searchValue) throws CorruptDataException {
    PointerPointer bucket;
    J9JITExceptionTablePointer entry;
    if (searchValue.gte(table.start()) && searchValue.lt(table.end())) {
        /* The search value is in this hash table */
        bucket = DETERMINE_BUCKET(searchValue, table.start(), table.buckets());
        if (bucket.at(0).notNull()) {
            /* The bucket for this search value is not empty */
            if (bucket.at(0).allBitsIn(1)) {
                // LOW_BIT_SET
                /* The bucket consists of a single low-tagged J9JITExceptionTable pointer */
                entry = J9JITExceptionTablePointer.cast(bucket.at(0));
            } else {
                /* The bucket consists of an array of J9JITExceptionTable pointers,
					 * the last of which is low-tagged */
                /* Search all but the last entry in the array */
                bucket = PointerPointer.cast(bucket.at(0));
                for (; ; bucket = bucket.add(1)) {
                    entry = J9JITExceptionTablePointer.cast(bucket.at(0));
                    if (entry.allBitsIn(1)) {
                        break;
                    }
                    if (searchValue.gte(entry.startPC()) && searchValue.lt(entry.endWarmPC()))
                        return entry;
                    if ((entry.startColdPC().longValue() != 0) && searchValue.gte(entry.startColdPC()) && searchValue.lt(entry.endPC()))
                        return entry;
                }
            }
            /* Search the last (or only) entry in the bucket, which is low-tagged */
            entry = J9JITExceptionTablePointer.cast(UDATA.cast(entry).bitAnd(new UDATA(1).bitNot()));
            if (searchValue.gte(entry.startPC()) && searchValue.lt(entry.endWarmPC()))
                return entry;
            if ((entry.startColdPC().longValue() != 0) && searchValue.gte(entry.startColdPC()) && searchValue.lt(entry.endPC()))
                return entry;
        }
    }
    return J9JITExceptionTablePointer.NULL;
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) PointerPointer(com.ibm.j9ddr.vm29.pointer.PointerPointer) J9JITExceptionTablePointer(com.ibm.j9ddr.vm29.pointer.generated.J9JITExceptionTablePointer)

Aggregations

PointerPointer (com.ibm.j9ddr.vm29.pointer.PointerPointer)31 CorruptDataException (com.ibm.j9ddr.CorruptDataException)22 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)10 VoidPointer (com.ibm.j9ddr.vm29.pointer.VoidPointer)9 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)6 UDATA (com.ibm.j9ddr.vm29.types.UDATA)5 U32Pointer (com.ibm.j9ddr.vm29.pointer.U32Pointer)4 GCVMThreadListIterator (com.ibm.j9ddr.vm29.j9.gc.GCVMThreadListIterator)3 J9HashTablePointer (com.ibm.j9ddr.vm29.pointer.generated.J9HashTablePointer)3 J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)3 J9ROMClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMClassPointer)3 J9VMThreadPointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMThreadPointer)3 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)2 BaseStackWalkerCallbacks (com.ibm.j9ddr.vm29.j9.stackwalker.BaseStackWalkerCallbacks)2 WalkState (com.ibm.j9ddr.vm29.j9.stackwalker.WalkState)2 AbstractPointer (com.ibm.j9ddr.vm29.pointer.AbstractPointer)2 J9ConstantPoolPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ConstantPoolPointer)2 J9RAMClassRefPointer (com.ibm.j9ddr.vm29.pointer.generated.J9RAMClassRefPointer)2 J9RAMMethodHandleRefPointer (com.ibm.j9ddr.vm29.pointer.generated.J9RAMMethodHandleRefPointer)2 J9RAMMethodTypeRefPointer (com.ibm.j9ddr.vm29.pointer.generated.J9RAMMethodTypeRefPointer)2