Search in sources :

Example 1 with GCJNIWeakGlobalReferenceIterator

use of com.ibm.j9ddr.vm29.j9.gc.GCJNIWeakGlobalReferenceIterator in project openj9 by eclipse.

the class RootScanner method scanJNIWeakGlobalReferences.

protected void scanJNIWeakGlobalReferences() throws CorruptDataException {
    setReachability(Reachability.WEAK);
    GCJNIWeakGlobalReferenceIterator jniWeakGlobalReferenceIterator = GCJNIWeakGlobalReferenceIterator.from();
    GCJNIWeakGlobalReferenceIterator addressIterator = GCJNIWeakGlobalReferenceIterator.from();
    while (jniWeakGlobalReferenceIterator.hasNext()) {
        doJNIWeakGlobalReference(jniWeakGlobalReferenceIterator.next(), addressIterator.nextAddress());
    }
}
Also used : GCJNIWeakGlobalReferenceIterator(com.ibm.j9ddr.vm29.j9.gc.GCJNIWeakGlobalReferenceIterator)

Example 2 with GCJNIWeakGlobalReferenceIterator

use of com.ibm.j9ddr.vm29.j9.gc.GCJNIWeakGlobalReferenceIterator in project openj9 by eclipse.

the class CheckJNIWeakGlobalReferences method print.

@Override
public void print() {
    try {
        VoidPointer weakRefs = VoidPointer.cast(getJavaVM().jniWeakGlobalReferences());
        GCJNIWeakGlobalReferenceIterator jniWeakGlobalReferenceIterator = GCJNIWeakGlobalReferenceIterator.from();
        ScanFormatter formatter = new ScanFormatter(this, "jniWeakGlobalReferences", weakRefs);
        while (jniWeakGlobalReferenceIterator.hasNext()) {
            J9ObjectPointer slot = jniWeakGlobalReferenceIterator.next();
            if (slot.notNull()) {
                formatter.entry(slot);
            }
        }
        formatter.end("jniWeakGlobalReferences", weakRefs);
    } catch (CorruptDataException e) {
    // TODO: handle exception
    }
}
Also used : VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) GCJNIWeakGlobalReferenceIterator(com.ibm.j9ddr.vm29.j9.gc.GCJNIWeakGlobalReferenceIterator) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)

Example 3 with GCJNIWeakGlobalReferenceIterator

use of com.ibm.j9ddr.vm29.j9.gc.GCJNIWeakGlobalReferenceIterator 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
    }
}
Also used : VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) PointerPointer(com.ibm.j9ddr.vm29.pointer.PointerPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException) GCJNIWeakGlobalReferenceIterator(com.ibm.j9ddr.vm29.j9.gc.GCJNIWeakGlobalReferenceIterator)

Aggregations

GCJNIWeakGlobalReferenceIterator (com.ibm.j9ddr.vm29.j9.gc.GCJNIWeakGlobalReferenceIterator)3 CorruptDataException (com.ibm.j9ddr.CorruptDataException)2 VoidPointer (com.ibm.j9ddr.vm29.pointer.VoidPointer)2 PointerPointer (com.ibm.j9ddr.vm29.pointer.PointerPointer)1 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)1