Search in sources :

Example 1 with MM_OwnableSynchronizerObjectListPointer

use of com.ibm.j9ddr.vm29.pointer.generated.MM_OwnableSynchronizerObjectListPointer 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;
}
Also used : J9ClassPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Example 2 with MM_OwnableSynchronizerObjectListPointer

use of com.ibm.j9ddr.vm29.pointer.generated.MM_OwnableSynchronizerObjectListPointer 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
    }
}
Also used : CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer) MM_OwnableSynchronizerObjectListPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_OwnableSynchronizerObjectListPointer)

Example 3 with MM_OwnableSynchronizerObjectListPointer

use of com.ibm.j9ddr.vm29.pointer.generated.MM_OwnableSynchronizerObjectListPointer 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();
    }
}
Also used : MM_HeapRegionManagerPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer) MM_OwnableSynchronizerObjectListPointer(com.ibm.j9ddr.vm29.pointer.generated.MM_OwnableSynchronizerObjectListPointer)

Aggregations

CorruptDataException (com.ibm.j9ddr.CorruptDataException)3 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)2 MM_OwnableSynchronizerObjectListPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_OwnableSynchronizerObjectListPointer)2 J9ClassPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ClassPointer)1 MM_HeapRegionManagerPointer (com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer)1