use of com.ibm.j9ddr.vm29.pointer.PointerPointer in project openj9 by eclipse.
the class J9MethodFieldFormatter method postFormat.
/* (non-Javadoc)
* @see com.ibm.j9ddr.tools.ddrinteractive.IFieldFormatter#postFormat(java.lang.String, java.lang.String, int, long, java.io.PrintStream, com.ibm.j9ddr.tools.ddrinteractive.Context, com.ibm.j9ddr.tools.ddrinteractive.IStructureFormatter)
*/
@Override
public FormatWalkResult postFormat(String name, String type, String declaredType, int typeCode, long address, PrintStream out, Context context, IStructureFormatter structureFormatter) throws CorruptDataException {
if (typeCode == TYPE_STRUCTURE_POINTER && StructureCommandUtil.typeToCommand(type).equals("!j9method")) {
PointerPointer slotPtr = PointerPointer.cast(address);
J9MethodPointer method = J9MethodPointer.cast(slotPtr.at(0));
if (method.isNull()) {
return FormatWalkResult.KEEP_WALKING;
}
out.print(" // ");
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));
}
return FormatWalkResult.KEEP_WALKING;
}
use of com.ibm.j9ddr.vm29.pointer.PointerPointer in project openj9 by eclipse.
the class StructurePointerFormatter method format.
@Override
public FormatWalkResult format(String name, String type, String declaredType, int typeCode, long address, PrintStream out, Context context, IStructureFormatter structureFormatter) throws CorruptDataException {
if (typeCode == TYPE_STRUCTURE_POINTER) {
PointerPointer ptr = PointerPointer.cast(address);
// Design 42819
// To make debugging easier we'll try to figure out the runtime type
// (if this information is available) and print the structure as that type.
type = RuntimeTypeResolutionHelper.findRuntimeType(type, ptr.at(0), context);
type = StructureCommandUtil.typeToCommand(type);
out.print(type);
out.print(" ");
out.print(ptr.at(0).getHexAddress());
return FormatWalkResult.STOP_WALKING;
} else {
return FormatWalkResult.KEEP_WALKING;
}
}
use of com.ibm.j9ddr.vm29.pointer.PointerPointer in project openj9 by eclipse.
the class CheckVMThreads method check.
@Override
public void check() {
try {
GCVMThreadListIterator vmThreadListIterator = GCVMThreadListIterator.from();
while (vmThreadListIterator.hasNext()) {
J9VMThreadPointer walkThread = vmThreadListIterator.next();
GCVMThreadIterator vmthreadIterator = GCVMThreadIterator.fromJ9VMThread(walkThread);
while (vmthreadIterator.hasNext()) {
PointerPointer slot = PointerPointer.cast(vmthreadIterator.nextAddress());
if (_engine.checkSlotVMThread(slot, VoidPointer.cast(walkThread), CheckError.check_type_other, vmthreadIterator.getState()) != J9MODRON_SLOT_ITERATOR_OK) {
continue;
}
}
}
} catch (CorruptDataException e) {
// TODO: handle exception
}
}
use of com.ibm.j9ddr.vm29.pointer.PointerPointer in project openj9 by eclipse.
the class J9ObjectFieldFormatter method postFormat.
@Override
public FormatWalkResult postFormat(String name, String type, String declaredType, int typeCode, long address, PrintStream out, Context context, IStructureFormatter structureFormatter) throws CorruptDataException {
if (typeCode == TYPE_STRUCTURE_POINTER && StructureCommandUtil.typeToCommand(type).equals("!j9object")) {
PointerPointer slotPtr = PointerPointer.cast(address);
J9ObjectPointer object = J9ObjectPointer.cast(slotPtr.at(0));
if (object.isNull()) {
return FormatWalkResult.KEEP_WALKING;
}
J9ClassPointer clazz = J9ObjectHelper.clazz(object);
out.print(" // ");
if (J9ClassHelper.isArrayClass(clazz)) {
out.print(J9ClassHelper.getArrayName(clazz));
} else {
out.print(J9ClassHelper.getName(clazz));
}
}
return FormatWalkResult.KEEP_WALKING;
}
use of com.ibm.j9ddr.vm29.pointer.PointerPointer in project openj9 by eclipse.
the class JITLook method hash_jit_artifact_search.
public static J9JITExceptionTablePointer hash_jit_artifact_search(J9JITHashTablePointer table, UDATA searchValue) throws CorruptDataException {
PointerPointer bucket;
J9JITExceptionTablePointer entry;
if (searchValue.gte(table.start()) && searchValue.lt(table.end())) {
/* The search value is in this hash table */
bucket = DETERMINE_BUCKET(searchValue, table.start(), table.buckets());
if (bucket.at(0).notNull()) {
/* The bucket for this search value is not empty */
if (bucket.at(0).allBitsIn(1)) {
// LOW_BIT_SET
/* The bucket consists of a single low-tagged J9JITExceptionTable pointer */
entry = J9JITExceptionTablePointer.cast(bucket.at(0));
} else {
/* The bucket consists of an array of J9JITExceptionTable pointers,
* the last of which is low-tagged */
/* Search all but the last entry in the array */
bucket = PointerPointer.cast(bucket.at(0));
for (; ; bucket = bucket.add(1)) {
entry = J9JITExceptionTablePointer.cast(bucket.at(0));
if (entry.allBitsIn(1)) {
break;
}
if (searchValue.gte(entry.startPC()) && searchValue.lt(entry.endWarmPC()))
return entry;
if ((entry.startColdPC().longValue() != 0) && searchValue.gte(entry.startColdPC()) && searchValue.lt(entry.endPC()))
return entry;
}
}
/* Search the last (or only) entry in the bucket, which is low-tagged */
entry = J9JITExceptionTablePointer.cast(UDATA.cast(entry).bitAnd(new UDATA(1).bitNot()));
if (searchValue.gte(entry.startPC()) && searchValue.lt(entry.endWarmPC()))
return entry;
if ((entry.startColdPC().longValue() != 0) && searchValue.gte(entry.startColdPC()) && searchValue.lt(entry.endPC()))
return entry;
}
}
return J9JITExceptionTablePointer.NULL;
}
Aggregations