use of com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer in project openj9 by eclipse.
the class CheckEngine method checkSlotOwnableSynchronizerList.
public int checkSlotOwnableSynchronizerList(J9ObjectPointer object, MM_OwnableSynchronizerObjectListPointer currentList) {
if (needVerifyOwnableSynchronizerConsistency()) {
_ownableSynchronizerObjectCountOnList += 1;
}
try {
int result = checkObjectIndirect(object);
if (J9MODRON_GCCHK_RC_OK != result) {
CheckError error = new CheckError(currentList, object, _cycle, _currentCheck, result, _cycle.nextErrorCount());
_reporter.report(error);
_reporter.reportHeapWalkError(error, _lastHeapObject1, _lastHeapObject2, _lastHeapObject3);
return J9MODRON_SLOT_ITERATOR_UNRECOVERABLE_ERROR;
}
J9ClassPointer instanceClass = J9ObjectHelper.clazz(object);
if (J9ClassHelper.classFlags(instanceClass).bitAnd(J9AccClassOwnableSynchronizer).eq(0)) {
CheckError error = new CheckError(currentList, object, _cycle, _currentCheck, J9MODRON_GCCHK_RC_INVALID_FLAGS, _cycle.nextErrorCount());
_reporter.report(error);
}
} catch (CorruptDataException e) {
CheckError error = new CheckError(currentList, object, _cycle, _currentCheck, J9MODRON_GCCHK_RC_CORRUPT_DATA_EXCEPTION, _cycle.nextErrorCount());
_reporter.report(error);
_reporter.reportHeapWalkError(error, _lastHeapObject1, _lastHeapObject2, _lastHeapObject3);
return J9MODRON_SLOT_ITERATOR_UNRECOVERABLE_ERROR;
}
return J9MODRON_SLOT_ITERATOR_OK;
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer 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.generated.J9ObjectPointer 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.generated.J9ObjectPointer in project openj9 by eclipse.
the class CheckOwnableSynchronizerList method print.
@Override
public void print() {
try {
MM_OwnableSynchronizerObjectListPointer ownableSynchronizerObjectList = getGCExtensions().ownableSynchronizerObjectLists();
ScanFormatter formatter = new ScanFormatter(this, "ownableSynchronizerObjectList");
while (ownableSynchronizerObjectList.notNull()) {
formatter.section("list", ownableSynchronizerObjectList);
J9ObjectPointer object = ownableSynchronizerObjectList._head();
while (object.notNull()) {
formatter.entry(object);
object = ObjectAccessBarrier.getOwnableSynchronizerLink(object);
}
formatter.endSection();
ownableSynchronizerObjectList = ownableSynchronizerObjectList._nextList();
}
formatter.end("ownableSynchronizerObjectList");
} catch (CorruptDataException e) {
// TODO: handle exception
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer in project openj9 by eclipse.
the class CheckOwnableSynchronizerList method check.
@Override
public void check() {
try {
MM_HeapRegionManagerPointer heapRegionManager = getGCExtensions().heapRegionManager();
long maximumOwnableSynchronizerCountOnHeap = heapRegionManager._totalHeapSize().longValue() / J9Consts.J9_GC_MINIMUM_OBJECT_SIZE;
MM_OwnableSynchronizerObjectListPointer ownableSynchronizerObjectList = getGCExtensions().ownableSynchronizerObjectLists();
while (ownableSynchronizerObjectList.notNull()) {
J9ObjectPointer object = ownableSynchronizerObjectList._head();
long ownableSynchronizerCount = 0;
_engine.clearPreviousObjects();
while (object.notNull()) {
if (_engine.checkSlotOwnableSynchronizerList(object, ownableSynchronizerObjectList) != CheckBase.J9MODRON_SLOT_ITERATOR_OK) {
break;
}
ownableSynchronizerCount += 1;
if (ownableSynchronizerCount > maximumOwnableSynchronizerCountOnHeap) {
_engine.reportOwnableSynchronizerCircularReferenceError(object, ownableSynchronizerObjectList);
break;
}
_engine.pushPreviousObject(object);
object = ObjectAccessBarrier.getOwnableSynchronizerLink(object);
}
ownableSynchronizerObjectList = ownableSynchronizerObjectList._nextList();
}
} catch (CorruptDataException e) {
// TODO: handle exception
}
if (_engine.needVerifyOwnableSynchronizerConsistency()) {
/* call verifyOwnableSynchronizerObjectCounts() only at the end of CheckOwnableSynchronizerList,
* verifyOwnableSynchronizerObjectCounts need both the count calculated in CheckObjectHeap and in CheckOwnableSynchronizerList
* assumption: CheckOwnableSynchronizerList always happens after CheckObjectHeap in CheckCycle
*/
_engine.verifyOwnableSynchronizerObjectCounts();
}
}
Aggregations