Search in sources :

Example 1 with J9EnclosingObjectPointer

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

the class J9BCUtil method dumpEnclosingMethod.

private static void dumpEnclosingMethod(PrintStream out, J9ROMClassPointer romClass, long flags) throws CorruptDataException {
    J9EnclosingObjectPointer enclosingMethodForROMClass = OptInfo.getEnclosingMethodForROMClass(romClass);
    if (!enclosingMethodForROMClass.isNull()) {
        J9ROMConstantPoolItemPointer constantPool = ConstantPoolHelpers.J9_ROM_CP_FROM_ROM_CLASS(romClass);
        J9ROMClassRefPointer romClassRefPointer = J9ROMClassRefPointer.cast(constantPool);
        String className = romClassRefPointer.name().toString();
        J9ROMNameAndSignaturePointer nameAndSignature = enclosingMethodForROMClass.nameAndSignature();
        if (!nameAndSignature.isNull()) {
            out.append(String.format("Enclosing Method: %s%s%s", className, J9UTF8Helper.stringValue(nameAndSignature.name()), J9UTF8Helper.stringValue(nameAndSignature.signature())));
        } else {
            out.append(String.format("Enclosing Class: %s", className));
        }
    }
}
Also used : J9ROMNameAndSignaturePointer(com.ibm.j9ddr.vm29.pointer.generated.J9ROMNameAndSignaturePointer) J9ROMClassRefPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ROMClassRefPointer) J9ROMConstantPoolItemPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ROMConstantPoolItemPointer) J9EnclosingObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9EnclosingObjectPointer)

Aggregations

J9EnclosingObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9EnclosingObjectPointer)1 J9ROMClassRefPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMClassRefPointer)1 J9ROMConstantPoolItemPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMConstantPoolItemPointer)1 J9ROMNameAndSignaturePointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMNameAndSignaturePointer)1