use of com.ibm.j9ddr.vm29.pointer.PointerPointer in project openj9 by eclipse.
the class CheckEngine method checkSlotRememberedSet.
public int checkSlotRememberedSet(PointerPointer objectIndirect, MM_SublistPuddlePointer puddle) {
J9ObjectPointer object;
try {
object = J9ObjectPointer.cast(objectIndirect.at(0));
if (isMidscavengeFlagSet()) {
/* during a scavenge, some RS entries may be tagged -- remove the tag */
if (object.anyBitsIn(DEFERRED_RS_REMOVE_FLAG)) {
object = object.untag(DEFERRED_RS_REMOVE_FLAG);
}
}
int result = checkObjectIndirect(object);
if (J9MODRON_GCCHK_RC_OK != result) {
CheckError error = new CheckError(puddle, objectIndirect, _cycle, _currentCheck, result, _cycle.nextErrorCount());
_reporter.report(error);
return J9MODRON_SLOT_ITERATOR_OK;
}
/* Additional checks for the remembered set */
if (object.notNull()) {
GCHeapRegionDescriptor objectRegion = findRegionForPointer(object, null);
if (objectRegion == null) {
/* shouldn't happen, since checkObjectIndirect() already verified this object */
CheckError error = new CheckError(puddle, objectIndirect, _cycle, _currentCheck, J9MODRON_GCCHK_RC_NOT_FOUND, _cycle.nextErrorCount());
_reporter.report(error);
return J9MODRON_SLOT_ITERATOR_OK;
}
/* we shouldn't have newspace references in the remembered set */
if (objectRegion.getTypeFlags().allBitsIn(MEMORY_TYPE_NEW)) {
CheckError error = new CheckError(puddle, objectIndirect, _cycle, _currentCheck, J9MODRON_GCCHK_RC_REMEMBERED_SET_WRONG_SEGMENT, _cycle.nextErrorCount());
_reporter.report(error);
return J9MODRON_SLOT_ITERATOR_OK;
}
boolean skipObject = false;
if (isScavengerBackoutFlagSet()) {
GCScavengerForwardedHeader scavengerForwardedHeader = GCScavengerForwardedHeader.fromJ9Object(object);
if (scavengerForwardedHeader.isReverseForwardedPointer()) {
/* There is no reason to check object - is gone */
skipObject = true;
}
}
if (!skipObject) {
/* content of Remembered Set should be Old and Remembered */
if (!ObjectModel.isOld(object) || !ObjectModel.isRemembered(object)) {
CheckError error = new CheckError(puddle, objectIndirect, _cycle, _currentCheck, J9MODRON_GCCHK_RC_REMEMBERED_SET_FLAGS, _cycle.nextErrorCount());
_reporter.report(error);
_reporter.reportObjectHeader(error, object, null);
return J9MODRON_SLOT_ITERATOR_OK;
}
}
}
} catch (CorruptDataException e) {
// TODO : cde should be part of the error
CheckError error = new CheckError(puddle, objectIndirect, _cycle, _currentCheck, J9MODRON_GCCHK_RC_CORRUPT_DATA_EXCEPTION, _cycle.nextErrorCount());
_reporter.report(error);
}
return J9MODRON_SLOT_ITERATOR_OK;
}
use of com.ibm.j9ddr.vm29.pointer.PointerPointer in project openj9 by eclipse.
the class CheckEngine method checkSlot.
public int checkSlot(PointerPointer objectIndirect, VoidPointer objectIndirectBase, int objectType) {
J9ObjectPointer object;
try {
object = J9ObjectPointer.cast(objectIndirect.at(0));
int result = checkObjectIndirect(object);
if (J9MODRON_GCCHK_RC_OK != result) {
CheckError error = new CheckError(objectIndirectBase, objectIndirect, _cycle, _currentCheck, result, _cycle.nextErrorCount(), objectType);
_reporter.report(error);
}
} catch (CorruptDataException e) {
// TODO : cde should be part of the error
CheckError error = new CheckError(objectIndirectBase, objectIndirect, _cycle, _currentCheck, J9MODRON_GCCHK_RC_CORRUPT_DATA_EXCEPTION, _cycle.nextErrorCount(), objectType);
_reporter.report(error);
}
return J9MODRON_SLOT_ITERATOR_OK;
}
use of com.ibm.j9ddr.vm29.pointer.PointerPointer in project openj9 by eclipse.
the class CheckRememberedSet method check.
@Override
public void check() {
try {
/* no point checking if the scavenger wasn't turned on */
if (!J9BuildFlags.gc_modronScavenger || !_extensions.scavengerEnabled()) {
return;
}
GCRememberedSetIterator remSetIterator = GCRememberedSetIterator.from();
while (remSetIterator.hasNext()) {
MM_SublistPuddlePointer puddle = remSetIterator.next();
GCRememberedSetSlotIterator remSetSlotIterator = GCRememberedSetSlotIterator.fromSublistPuddle(puddle);
while (remSetSlotIterator.hasNext()) {
PointerPointer objectIndirect = PointerPointer.cast(remSetSlotIterator.nextAddress());
if (_engine.checkSlotRememberedSet(objectIndirect, puddle) != J9MODRON_SLOT_ITERATOR_OK) {
return;
}
}
}
} catch (CorruptDataException e) {
// TODO: handle exception
}
}
use of com.ibm.j9ddr.vm29.pointer.PointerPointer in project openj9 by eclipse.
the class CheckJNIWeakGlobalReferences method check.
@Override
public void check() {
try {
VoidPointer weakRefs = VoidPointer.cast(getJavaVM().jniWeakGlobalReferences());
GCJNIWeakGlobalReferenceIterator jniWeakGlobalReferenceIterator = GCJNIWeakGlobalReferenceIterator.from();
while (jniWeakGlobalReferenceIterator.hasNext()) {
PointerPointer slot = PointerPointer.cast(jniWeakGlobalReferenceIterator.nextAddress());
if (slot.notNull()) {
if (_engine.checkSlotPool(slot, weakRefs) != J9MODRON_SLOT_ITERATOR_OK) {
return;
}
}
}
} catch (CorruptDataException e) {
// TODO: handle exception
}
}
use of com.ibm.j9ddr.vm29.pointer.PointerPointer in project openj9 by eclipse.
the class CheckJVMTIObjectTagTables method check.
@Override
public void check() {
try {
J9JVMTIDataPointer jvmtiData = J9JVMTIDataPointer.cast(getJavaVM().jvmtiData());
if (jvmtiData.notNull()) {
GCJVMTIObjectTagTableListIterator objectTagTableList = GCJVMTIObjectTagTableListIterator.fromJ9JVMTIData(jvmtiData);
while (objectTagTableList.hasNext()) {
J9JVMTIEnvPointer list = objectTagTableList.next();
VoidPointer objectTagTable = VoidPointer.cast(list.objectTagTable());
GCJVMTIObjectTagTableIterator objectTagTableIterator = GCJVMTIObjectTagTableIterator.fromJ9JVMTIEnv(list);
while (objectTagTableIterator.hasNext()) {
PointerPointer slot = PointerPointer.cast(objectTagTableIterator.nextAddress());
if (slot.notNull()) {
if (_engine.checkSlotPool(slot, objectTagTable) != J9MODRON_SLOT_ITERATOR_OK) {
return;
}
}
}
}
}
} catch (CorruptDataException e) {
// TODO: handle exception
}
}
Aggregations