Search in sources :

Example 1 with MM_SublistPuddlePointer

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());
        }
    }
}
Also used : GCRememberedSetSlotIterator(com.ibm.j9ddr.vm29.j9.gc.GCRememberedSetSlotIterator) GCRememberedSetIterator(com.ibm.j9ddr.vm29.j9.gc.GCRememberedSetIterator) MM_SublistPuddlePointer(com.ibm.j9ddr.vm29.pointer.generated.MM_SublistPuddlePointer)

Example 2 with MM_SublistPuddlePointer

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;
    }
}
Also used : MM_SublistPuddlePointer(com.ibm.j9ddr.vm29.pointer.generated.MM_SublistPuddlePointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) NoSuchElementException(java.util.NoSuchElementException)

Example 3 with MM_SublistPuddlePointer

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
    }
}
Also used : GCRememberedSetSlotIterator(com.ibm.j9ddr.vm29.j9.gc.GCRememberedSetSlotIterator) GCRememberedSetIterator(com.ibm.j9ddr.vm29.j9.gc.GCRememberedSetIterator) MM_SublistPuddlePointer(com.ibm.j9ddr.vm29.pointer.generated.MM_SublistPuddlePointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 4 with MM_SublistPuddlePointer

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;
}
Also used : GCHeapRegionDescriptor(com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionDescriptor) GCScavengerForwardedHeader(com.ibm.j9ddr.vm29.j9.gc.GCScavengerForwardedHeader) CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)

Example 5 with MM_SublistPuddlePointer

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
    }
}
Also used : PointerPointer(com.ibm.j9ddr.vm29.pointer.PointerPointer) GCRememberedSetSlotIterator(com.ibm.j9ddr.vm29.j9.gc.GCRememberedSetSlotIterator) GCRememberedSetIterator(com.ibm.j9ddr.vm29.j9.gc.GCRememberedSetIterator) MM_SublistPuddlePointer(com.ibm.j9ddr.vm29.pointer.generated.MM_SublistPuddlePointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Aggregations

CorruptDataException (com.ibm.j9ddr.CorruptDataException)4 MM_SublistPuddlePointer (com.ibm.j9ddr.vm29.pointer.generated.MM_SublistPuddlePointer)4 GCRememberedSetIterator (com.ibm.j9ddr.vm29.j9.gc.GCRememberedSetIterator)3 GCRememberedSetSlotIterator (com.ibm.j9ddr.vm29.j9.gc.GCRememberedSetSlotIterator)3 GCHeapRegionDescriptor (com.ibm.j9ddr.vm29.j9.gc.GCHeapRegionDescriptor)1 GCScavengerForwardedHeader (com.ibm.j9ddr.vm29.j9.gc.GCScavengerForwardedHeader)1 PointerPointer (com.ibm.j9ddr.vm29.pointer.PointerPointer)1 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)1 NoSuchElementException (java.util.NoSuchElementException)1