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