Search in sources :

Example 16 with J9ROMMethodPointer

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

the class DTFJJavaMethod method getBytecodeSections.

@SuppressWarnings("rawtypes")
public Iterator getBytecodeSections() {
    if (byteCodeSections == null) {
        byteCodeSections = new ArrayList<Object>();
        try {
            J9ROMMethodPointer originalRomMethod = ROMHelp.getOriginalROMMethod(j9ramMethod);
            if (!originalRomMethod.modifiers().anyBitsIn(J9JavaAccessFlags.J9AccNative)) {
                U8Pointer bcStart = ROMHelp.J9_BYTECODE_START_FROM_ROM_METHOD(originalRomMethod);
                UDATA bcSize = ROMHelp.J9_BYTECODE_SIZE_FROM_ROM_METHOD(originalRomMethod);
                J9DDRImageSection is = DTFJContext.getImageSection(bcStart.getAddress(), "bytecode section at " + j9ramMethod.bytecodes().getAddress());
                is.setSize(bcSize.longValue());
                byteCodeSections.add(is);
                if (!j9romMethod.equals(originalRomMethod)) {
                    is = DTFJContext.getImageSection(j9ramMethod.bytecodes().getAddress(), "bytecode section at " + j9ramMethod.bytecodes().getAddress());
                    is.setSize(bcSize.longValue());
                    byteCodeSections.add(is);
                }
            }
        } catch (Throwable t) {
            CorruptData cd = J9DDRDTFJUtils.handleAsCorruptData(DTFJContext.getProcess(), t);
            byteCodeSections.add(cd);
        }
    }
    return byteCodeSections.iterator();
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) U8Pointer(com.ibm.j9ddr.vm29.pointer.U8Pointer) J9ROMMethodPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ROMMethodPointer) CorruptData(com.ibm.dtfj.image.CorruptData) J9DDRImageSection(com.ibm.j9ddr.view.dtfj.image.J9DDRImageSection)

Example 17 with J9ROMMethodPointer

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

the class FilteredROMMethodsIterator method next.

public J9ROMClassAndMethod next() {
    J9ROMClassAndMethod result = nextMethod;
    /* hasNext may have already go the next method */
    nextMethod = null;
    /* destructive read */
    if (null == result) {
        do {
            try {
                if ((null != currentRomMethod) && (remainingMethods > 0)) {
                    J9ROMMethodPointer romMethod = currentRomMethod;
                    J9ROMNameAndSignaturePointer nameAndSignature = romMethod.nameAndSignature();
                    J9UTF8Pointer methNameUTF = nameAndSignature.name();
                    String methName = J9UTF8Helper.stringValue(methNameUTF);
                    if (methodPattern.isMatch(methName)) {
                        String methSig = J9UTF8Helper.stringValue(nameAndSignature.signature());
                        if (signaturePattern.isMatch(methSig)) {
                            result = new J9ROMClassAndMethod(romMethod, currentRomClass);
                        }
                    }
                    currentRomMethod = ROMHelp.nextROMMethod(currentRomMethod);
                    --remainingMethods;
                } else {
                    if (!goToNextClass()) {
                        break;
                    /* ran out of classes */
                    }
                }
            } catch (CorruptDataException e) {
                throw new NoSuchElementException();
            }
        } while (null == result);
    }
    return result;
}
Also used : J9ROMNameAndSignaturePointer(com.ibm.j9ddr.vm29.pointer.generated.J9ROMNameAndSignaturePointer) J9ROMMethodPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ROMMethodPointer) J9UTF8Pointer(com.ibm.j9ddr.vm29.pointer.generated.J9UTF8Pointer) PatternString(com.ibm.j9ddr.util.PatternString) CorruptDataException(com.ibm.j9ddr.CorruptDataException) NoSuchElementException(java.util.NoSuchElementException) J9ROMClassAndMethod(com.ibm.j9ddr.vm29.j9.walkers.J9ROMClassAndMethod)

Example 18 with J9ROMMethodPointer

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

the class RomClassWalker method allSlotsInROMMethodsSectionDo.

private void allSlotsInROMMethodsSectionDo() throws CorruptDataException {
    int count;
    J9ROMMethodPointer firstMethod;
    J9ROMMethodPointer nextMethod;
    J9ROMMethodPointer methodCursor;
    methodCursor = firstMethod = romClass.romMethods();
    for (count = romClass.romMethodCount().intValue(); (methodCursor.notNull()) && (count > 0); count--) {
        nextMethod = allSlotsInROMMethodDo(methodCursor);
        classWalkerCallback.addSection(clazz, methodCursor, nextMethod.getAddress() - methodCursor.getAddress(), "method", true);
        methodCursor = nextMethod;
    }
    classWalkerCallback.addSection(clazz, firstMethod, methodCursor.getAddress() - firstMethod.getAddress(), "methods", true);
}
Also used : J9ROMMethodPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ROMMethodPointer)

Example 19 with J9ROMMethodPointer

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

the class J9ROMMethodHelper method hasMethodTypeAnnotations.

public static boolean hasMethodTypeAnnotations(J9ROMMethodPointer method) throws CorruptDataException {
    boolean result = false;
    if (0 != romHelpVersion) {
        U32 extendedModifiers = getExtendedModifiersDataFromROMMethod(method);
        result = extendedModifiers.allBitsIn(J9CfrClassFile.CFR_METHOD_EXT_HAS_METHOD_TYPE_ANNOTATIONS);
    } else {
        result = method.modifiers().allBitsIn(J9JavaAccessFlags.J9AccMethodHasTypeAnnotations);
    /* J9AccMethodHasExtendedModifiers was J9AccMethodHasTypeAnnotations */
    }
    return result;
}
Also used : U32(com.ibm.j9ddr.vm29.types.U32)

Example 20 with J9ROMMethodPointer

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

the class J9ROMMethodHelper method hasCodeTypeAnnotations.

public static boolean hasCodeTypeAnnotations(J9ROMMethodPointer method) throws CorruptDataException {
    boolean result = false;
    if (0 != romHelpVersion) {
        U32 extendedModifiers = getExtendedModifiersDataFromROMMethod(method);
        result = extendedModifiers.allBitsIn(J9CfrClassFile.CFR_METHOD_EXT_HAS_CODE_TYPE_ANNOTATIONS);
    }
    return result;
}
Also used : U32(com.ibm.j9ddr.vm29.types.U32)

Aggregations

J9ROMMethodPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMMethodPointer)22 CorruptDataException (com.ibm.j9ddr.CorruptDataException)10 U8Pointer (com.ibm.j9ddr.vm29.pointer.U8Pointer)10 J9MethodPointer (com.ibm.j9ddr.vm29.pointer.generated.J9MethodPointer)9 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)7 J9UTF8Pointer (com.ibm.j9ddr.vm29.pointer.generated.J9UTF8Pointer)7 U32 (com.ibm.j9ddr.vm29.types.U32)6 J9ROMClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMClassPointer)5 J9ROMNameAndSignaturePointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMNameAndSignaturePointer)5 UDATA (com.ibm.j9ddr.vm29.types.UDATA)5 SelfRelativePointer (com.ibm.j9ddr.vm29.pointer.SelfRelativePointer)4 U32Pointer (com.ibm.j9ddr.vm29.pointer.U32Pointer)4 DDRInteractiveCommandException (com.ibm.j9ddr.tools.ddrinteractive.DDRInteractiveCommandException)3 J9ROMClassAndMethod (com.ibm.j9ddr.vm29.j9.walkers.J9ROMClassAndMethod)3 U16 (com.ibm.j9ddr.vm29.types.U16)3 U8 (com.ibm.j9ddr.vm29.types.U8)3 J9ROMFieldShapeIterator (com.ibm.j9ddr.vm29.j9.J9ROMFieldShapeIterator)2 J9ExceptionInfoPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ExceptionInfoPointer)2 J9JavaVMPointer (com.ibm.j9ddr.vm29.pointer.generated.J9JavaVMPointer)2 J9ROMConstantPoolItemPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ROMConstantPoolItemPointer)2