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();
}
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;
}
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);
}
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;
}
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;
}
Aggregations