@NoInline
protected final void mark() {
while (!stack.isEmpty()) {
final Object object = stack.pop();
markedObjects++;
VmType vmClass;
try {
vmClass = VmMagic.getObjectType(object);
} catch (NullPointerException ex) {
// This is a symptom of heap corruption
if (object == null) {
helper.die("GCMarkError: null object");
} else {
final Address objAddr = ObjectReference.fromObject(object).toAddress();
Unsafe.debug("Object address is ");
Unsafe.debug(objAddr);
Unsafe.debug(", tib is ");
Object[] tib = VmMagic.getTIB(object);
Unsafe.debug(ObjectReference.fromObject(tib).toAddress());
Unsafe.debug(", flags word is ");
Word flags = VmMagic.getObjectFlags(object);
Unsafe.debug(flags);
Unsafe.debug(", markedObjects is ");
Unsafe.debug(markedObjects);
Unsafe.debug('\n');
helper.die("GCMarkError: NPE");
}
throw ex;
}
if (vmClass == null) {
Unsafe.debug("Oops vmClass == null in (");
Unsafe.debug(markedObjects);
Unsafe.debug(")");
helper.die("vmClass == null in mark()");
} else if (vmClass.isArray()) {
if (!vmClass.isPrimitiveArray()) {
markArray(object);
}
} else {
markObject(object, (VmNormalClass) vmClass);
}