use of com.ibm.j9ddr.vm29.types.UDATA in project openj9 by eclipse.
the class CheckReporterTTY method report.
@Override
public void report(CheckError error) {
if (!shouldReport(error)) {
return;
}
try {
/* If slot is NULL, we are not scanning the slots of an object, but looking directly at an object/class on the heap. */
if ((error._slot != null) && (error._slot.notNull())) {
VoidPointer slot = error._slot;
UDATA slotValue;
switch(error._objectType) {
case check_type_object:
J9ObjectPointer fieldValue = ObjectReferencePointer.cast(slot).at(0);
slotValue = UDATA.cast(fieldValue);
break;
case check_type_thread:
slotValue = UDATAPointer.cast(slot).at(0);
slot = error._stackLocation;
break;
case check_type_unfinalized:
// In this case, there isn't really a "slot", only the value
// TODO kmt : This probably shouldn't use the object(offset) format.
slotValue = UDATA.cast(slot);
slot = VoidPointer.NULL;
break;
default:
slotValue = UDATAPointer.cast(slot).at(0);
}
out.println(String.format(" <gc check (%d): %s: %s: %sslot %x(%x) -> %x: %s>", error._errorNumber, "from debugger", error._check.getCheckName(), error._elementName, error._object.getAddress(), slot.getAddress(), slotValue.longValue(), getErrorType(error._errorCode)));
} else {
out.println(String.format(" <gc check (%d): %s: %s: %s%x: %s>", error._errorNumber, "from debugger", error._check.getCheckName(), error._elementName, error._object.getAddress(), getErrorType(error._errorCode)));
/* If the basic checks have been made (alignment, etc.) display header info. */
if (error._objectType == check_type_object) {
reportObjectHeader(error, J9ObjectPointer.cast(error._object), "");
}
}
} catch (CorruptDataException cde) {
out.println(String.format(" <gc check (%d): %s: %s: %s%x: %s>", error._errorNumber, "from debugger", error._check.getCheckName(), error._elementName, error._object.getAddress(), getErrorType(error._errorCode)));
}
}
use of com.ibm.j9ddr.vm29.types.UDATA in project openj9 by eclipse.
the class J9ObjectStructureFormatter method printJ9ObjectFields.
private void printJ9ObjectFields(PrintStream out, int tabLevel, J9ClassPointer localClazz, U8Pointer dataStart, J9ObjectPointer localObject) throws CorruptDataException {
J9ClassPointer instanceClass = localClazz;
long superclassIndex;
long depth;
J9ClassPointer previousSuperclass = J9ClassPointer.NULL;
boolean lockwordPrinted = false;
if (J9BuildFlags.thr_lockNursery) {
lockwordPrinted = false;
}
/* print individual fields */
J9UTF8Pointer classNameUTF = instanceClass.romClass().className();
padding(out, tabLevel);
out.println(String.format("struct J9Class* clazz = !j9class 0x%X // %s", localClazz.getAddress(), J9UTF8Helper.stringValue(classNameUTF)));
padding(out, tabLevel);
out.println(String.format("Object flags = %s;", J9ObjectHelper.flags(localObject).getHexValue()));
if (!J9BuildFlags.thr_lockNursery) {
UDATA lockword = J9ObjectHelper.monitor(localObject);
if (lockword != null) {
padding(out, tabLevel);
out.println(String.format("j9objectmonitor_t monitor = %s;", lockword.getHexValue()));
}
}
depth = J9ClassHelper.classDepth(instanceClass).longValue();
for (superclassIndex = 0; superclassIndex <= depth; superclassIndex++) {
J9ClassPointer superclass;
if (superclassIndex == depth) {
superclass = instanceClass;
} else {
superclass = J9ClassPointer.cast(instanceClass.superclasses().at(superclassIndex));
}
U32 flags = new U32(J9VM_FIELD_OFFSET_WALK_INCLUDE_INSTANCE | J9VM_FIELD_OFFSET_WALK_INCLUDE_HIDDEN);
Iterator<J9ObjectFieldOffset> iterator = J9ObjectFieldOffsetIterator.J9ObjectFieldOffsetIteratorFor(superclass.romClass(), instanceClass, previousSuperclass, flags);
while (iterator.hasNext()) {
J9ObjectFieldOffset result = iterator.next();
boolean printField = true;
boolean isHiddenField = result.isHidden();
if (J9BuildFlags.thr_lockNursery) {
boolean isLockword = (isHiddenField && ((result.getOffsetOrAddress().add(J9Object.SIZEOF).eq(superclass.lockOffset()))));
if (isLockword) {
/* Print the lockword field if it is indeed the lockword for this instanceClass and we haven't printed it yet. */
printField = (!lockwordPrinted && (instanceClass.lockOffset().eq(superclass.lockOffset())));
if (printField) {
lockwordPrinted = true;
}
}
}
if (printField) {
printObjectField(out, tabLevel, localClazz, dataStart, superclass, result);
out.println();
}
}
previousSuperclass = superclass;
}
}
use of com.ibm.j9ddr.vm29.types.UDATA in project openj9 by eclipse.
the class DTFJContext method cacheJITMethodAddresses.
private static void cacheJITMethodAddresses() {
jitMethodCache = new HashMap<J9MethodPointer, List<J9JITExceptionTablePointer>>();
try {
J9MemorySegmentListPointer dataCacheList = getVm().jitConfig().dataCacheList();
J9MemorySegmentPointer dataCache = dataCacheList.nextSegment();
while (dataCache.notNull()) {
UDATA current = UDATA.cast(dataCache.heapBase());
UDATA end = UDATA.cast(dataCache.heapAlloc());
while (current.lt(end)) {
J9JITDataCacheHeaderPointer hdr = J9JITDataCacheHeaderPointer.cast(current);
if (hdr.type().longValue() == J9DataTypeExceptionInfo) {
J9JITExceptionTablePointer metaData = J9JITExceptionTablePointer.cast(current.add(J9JITDataCacheHeader.SIZEOF));
addMetaData(metaData);
}
current = current.add(hdr.size());
}
dataCache = dataCache.nextSegment();
}
} catch (CorruptDataException e) {
return;
}
}
Aggregations