Search in sources :

Example 1 with GCStringTableIterator

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

the class DumpStringTableCommand method getStringTableObjects.

private Set<J9ObjectPointer> getStringTableObjects() throws CorruptDataException {
    /* Use sorted set to display string table ordered by address */
    SortedSet<J9ObjectPointer> sortedSet = new TreeSet<J9ObjectPointer>(new Comparator<J9ObjectPointer>() {

        public int compare(J9ObjectPointer o1, J9ObjectPointer o2) {
            if (o1.getAddress() < o2.getAddress()) {
                return -1;
            } else if (o1.getAddress() > o2.getAddress()) {
                return 1;
            } else {
                return 0;
            }
        }
    });
    GCStringTableIterator it = GCStringTableIterator.from();
    while (it.hasNext()) {
        J9ObjectPointer next = it.next();
        sortedSet.add(next);
    }
    return sortedSet;
}
Also used : TreeSet(java.util.TreeSet) GCStringTableIterator(com.ibm.j9ddr.vm29.j9.gc.GCStringTableIterator) J9ObjectPointer(com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)

Example 2 with GCStringTableIterator

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

the class RootScanner method scanStringTable.

protected void scanStringTable() throws CorruptDataException {
    if (_extensions.collectStringConstants()) {
        setReachability(Reachability.WEAK);
    } else {
        setReachability(Reachability.STRONG);
    }
    GCStringTableIterator stringTableIterator = GCStringTableIterator.from();
    GCStringTableIterator stringTableAddressIterator = GCStringTableIterator.from();
    while (stringTableIterator.hasNext()) {
        doStringTableSlot(stringTableIterator.next(), stringTableAddressIterator.nextAddress());
    }
    GCStringCacheTableIterator cacheIterator = GCStringCacheTableIterator.from();
    GCStringCacheTableIterator cacheAddressIterator = GCStringCacheTableIterator.from();
    while (cacheIterator.hasNext()) {
        doStringCacheTableSlot(cacheIterator.next(), cacheAddressIterator.nextAddress());
    }
}
Also used : GCStringTableIterator(com.ibm.j9ddr.vm29.j9.gc.GCStringTableIterator) GCStringCacheTableIterator(com.ibm.j9ddr.vm29.j9.gc.GCStringCacheTableIterator)

Aggregations

GCStringTableIterator (com.ibm.j9ddr.vm29.j9.gc.GCStringTableIterator)2 GCStringCacheTableIterator (com.ibm.j9ddr.vm29.j9.gc.GCStringCacheTableIterator)1 J9ObjectPointer (com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer)1 TreeSet (java.util.TreeSet)1