Search in sources :

Example 11 with J9MethodPointer

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

the class J9MethodStructureFormatter method writeJ9ROMClassAddress.

private static void writeJ9ROMClassAddress(J9MethodPointer method, PrintStream out) {
    out.print("ROM Method: ");
    try {
        J9ROMMethodPointer j9romMethod = J9MethodHelper.romMethod(method);
        out.print("!j9rommethod ");
        out.print(j9romMethod.getHexAddress());
    } catch (CorruptDataException e) {
        out.print("<FAULT>");
    } finally {
        out.println();
    }
}
Also used : J9ROMMethodPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ROMMethodPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 12 with J9MethodPointer

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

the class J9MethodStructureFormatter method writeMethodName.

private static void writeMethodName(J9MethodPointer method, PrintStream out) {
    out.print("Signature: ");
    try {
        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));
        out.print(" !bytecodes ");
        out.print(method.getHexAddress());
    } catch (CorruptDataException ex) {
        out.print("<FAULT>");
    } finally {
        out.println();
    }
}
Also used : J9ClassPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer) J9ROMMethodPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ROMMethodPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 13 with J9MethodPointer

use of com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer 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)

Example 14 with J9MethodPointer

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

the class J9MethodHelper method getName.

public static String getName(J9MethodPointer methodPointer) throws CorruptDataException {
    J9ClassPointer className;
    J9ConstantPoolPointer constantPool;
    if (methodPointer.isNull())
        return "bad ramMethod";
    constantPool = ConstantPoolHelpers.J9_CP_FROM_METHOD(methodPointer);
    if (constantPool.isNull()) {
        return "error reading constant pool from ramMethod";
    }
    className = ConstantPoolHelpers.J9_CLASS_FROM_CP(constantPool);
    if (className.isNull()) {
        return "error reading class name from constant pool";
    }
    J9ROMNameAndSignaturePointer nameAndSignature = ROMHelp.J9_ROM_METHOD_FROM_RAM_METHOD(methodPointer).nameAndSignature();
    String name = J9UTF8Helper.stringValue(nameAndSignature.name());
    String signature = J9UTF8Helper.stringValue(nameAndSignature.signature());
    return J9ClassHelper.getName(className) + "." + name + signature;
}
Also used : J9ROMNameAndSignaturePointer(com.ibm.j9ddr.vm29.pointer.generated.J9ROMNameAndSignaturePointer) J9ClassPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer) J9ConstantPoolPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ConstantPoolPointer)

Example 15 with J9MethodPointer

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

the class RamClassWalker method allSlotsInRAMMethodsSectionDo.

private void allSlotsInRAMMethodsSectionDo() throws CorruptDataException {
    final int methodCount = ramClass.romClass().romMethodCount().intValue();
    if (methodCount != 0) {
        final J9MethodPointer methods = ramClass.ramMethods();
        for (int i = 0; i < methodCount; i++) {
            final J9MethodPointer method = methods.add(i);
            classWalkerCallback.addSection(clazz, method, J9Method.SIZEOF, "J9Method", false);
            addObjectsasSlot(method);
        }
        classWalkerCallback.addSection(clazz, ramClass.ramMethods(), methodCount * J9Method.SIZEOF, "RAM methods", false);
    }
}
Also used : J9MethodPointer(com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer)

Aggregations

J9MethodPointer (com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer)17 J9ROMMethodPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMMethodPointer)13 CorruptDataException (com.ibm.j9ddr.CorruptDataException)11 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)9 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)6 U8Pointer (com.ibm.j9ddr.vm29.pointer.U8Pointer)6 J9ROMClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMClassPointer)5 UDATA (com.ibm.j9ddr.vm29.types.UDATA)4 UDATAPointer (com.ibm.j9ddr.vm29.pointer.UDATAPointer)3 J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)3 GCClassLoaderIterator (com.ibm.j9ddr.vm29.j9.gc.GCClassLoaderIterator)2 BaseStackWalkerCallbacks (com.ibm.j9ddr.vm29.j9.stackwalker.BaseStackWalkerCallbacks)2 StackWalkResult (com.ibm.j9ddr.vm29.j9.stackwalker.StackWalkResult)2 WalkState (com.ibm.j9ddr.vm29.j9.stackwalker.WalkState)2 J9ROMClassAndMethod (com.ibm.j9ddr.vm29.j9.walkers.J9ROMClassAndMethod)2 J9ClassLoaderPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassLoaderPointer)2 J9ConstantPoolPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ConstantPoolPointer)2 J9ROMNameAndSignaturePointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMNameAndSignaturePointer)2 J9UTF8Pointer (com.ibm.j9ddr.vm29.pointer.generated.J9UTF8Pointer)2 J9VMEntryLocalStoragePointer (com.ibm.j9ddr.vm29.pointer.generated.J9VMEntryLocalStoragePointer)2