use of com.ibm.j9ddr.vm29.pointer.generated.MM_SublistPuddlePointer in project openj9 by eclipse.
the class RootScanner method scanRememberedSet.
protected void scanRememberedSet() throws CorruptDataException {
if (!J9BuildFlags.gc_modronScavenger)
return;
setReachability(Reachability.WEAK);
GCRememberedSetIterator rememberedSetIterator = GCRememberedSetIterator.from();
while (rememberedSetIterator.hasNext()) {
MM_SublistPuddlePointer puddle = rememberedSetIterator.next();
GCRememberedSetSlotIterator rememberedSetSlotIterator = GCRememberedSetSlotIterator.fromSublistPuddle(puddle);
GCRememberedSetSlotIterator addressIterator = GCRememberedSetSlotIterator.fromSublistPuddle(puddle);
while (rememberedSetSlotIterator.hasNext()) {
doRememberedSlot(rememberedSetSlotIterator.next(), addressIterator.nextAddress());
}
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.MM_SublistPuddlePointer in project openj9 by eclipse.
the class MMSublistIterator method next.
public MM_SublistPuddlePointer next() {
try {
if (hasNext()) {
MM_SublistPuddlePointer nextPuddle = currentPuddle;
currentPuddle = currentPuddle._next();
return nextPuddle;
} else {
throw new NoSuchElementException("There are no more items available through this iterator");
}
} catch (CorruptDataException e) {
// can try to recover from this
raiseCorruptDataEvent("Error getting next item", e, false);
return null;
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.MM_SublistPuddlePointer in project openj9 by eclipse.
the class CheckRememberedSet method print.
@Override
public void print() {
try {
GCRememberedSetIterator remSetIterator = GCRememberedSetIterator.from();
ScanFormatter formatter = new ScanFormatter(this, "RememberedSet Sublist", getGCExtensions().rememberedSetEA());
while (remSetIterator.hasNext()) {
MM_SublistPuddlePointer puddle = remSetIterator.next();
formatter.section("puddle", puddle);
GCRememberedSetSlotIterator remSetSlotIterator = GCRememberedSetSlotIterator.fromSublistPuddle(puddle);
while (remSetSlotIterator.hasNext()) {
formatter.entry(remSetSlotIterator.next());
}
formatter.endSection();
}
formatter.end("RememberedSet Sublist", getGCExtensions().rememberedSetEA());
} catch (CorruptDataException e) {
// TODO: handle exception
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.MM_SublistPuddlePointer 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.MM_SublistPuddlePointer 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
}
}
Aggregations