Search in sources :

Example 1 with GCJNIGlobalReferenceIterator

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

the class RootScanner method scanJNIGlobalReferences.

protected void scanJNIGlobalReferences() throws CorruptDataException {
    setReachability(Reachability.STRONG);
    GCJNIGlobalReferenceIterator jniGlobalReferenceIterator = GCJNIGlobalReferenceIterator.from();
    GCJNIGlobalReferenceIterator addressIterator = GCJNIGlobalReferenceIterator.from();
    while (jniGlobalReferenceIterator.hasNext()) {
        doJNIGlobalReferenceSlot(jniGlobalReferenceIterator.next(), addressIterator.nextAddress());
    }
}
Also used : GCJNIGlobalReferenceIterator(com.ibm.j9ddr.vm29.j9.gc.GCJNIGlobalReferenceIterator)

Example 2 with GCJNIGlobalReferenceIterator

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

the class CheckJNIGlobalReferences method print.

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

Example 3 with GCJNIGlobalReferenceIterator

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

the class CheckJNIGlobalReferences method check.

@Override
public void check() {
    try {
        VoidPointer globalRefs = VoidPointer.cast(getJavaVM().jniGlobalReferences());
        GCJNIGlobalReferenceIterator jniGlobalReferenceIterator = GCJNIGlobalReferenceIterator.from();
        while (jniGlobalReferenceIterator.hasNext()) {
            PointerPointer slot = PointerPointer.cast(jniGlobalReferenceIterator.nextAddress());
            if (slot.notNull()) {
                if (_engine.checkSlotPool(slot, globalRefs) != J9MODRON_SLOT_ITERATOR_OK) {
                    return;
                }
            }
        }
    } catch (CorruptDataException e) {
    // TODO: handle exception
    }
}
Also used : GCJNIGlobalReferenceIterator(com.ibm.j9ddr.vm29.j9.gc.GCJNIGlobalReferenceIterator) VoidPointer(com.ibm.j9ddr.vm29.pointer.VoidPointer) PointerPointer(com.ibm.j9ddr.vm29.pointer.PointerPointer) CorruptDataException(com.ibm.j9ddr.CorruptDataException)

Aggregations

GCJNIGlobalReferenceIterator (com.ibm.j9ddr.vm29.j9.gc.GCJNIGlobalReferenceIterator)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