use of com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer in project openj9 by eclipse.
the class RootScanner method scanOwnableSynchronizerObjects.
protected void scanOwnableSynchronizerObjects() throws CorruptDataException {
setReachability(Reachability.WEAK);
GCOwnableSynchronizerObjectListIterator ownableSynchronizerObjectListIterator = GCOwnableSynchronizerObjectListIterator.from();
while (ownableSynchronizerObjectListIterator.hasNext()) {
J9ObjectPointer ownableSynchronizerObject = ownableSynchronizerObjectListIterator.next();
doOwnableSynchronizerObject(ownableSynchronizerObject);
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer in project openj9 by eclipse.
the class StringTable method cacheIterator.
public SlotIterator<J9ObjectPointer> cacheIterator() {
return new SlotIterator<J9ObjectPointer>() {
private UDATA cacheTableIndex;
private UDATA cacheSize;
private PointerPointer cache;
{
// Instance initialiser
cacheTableIndex = new UDATA(0);
try {
cacheSize = getCacheSize();
cache = _stringTable._cacheEA();
} catch (CorruptDataException e) {
raiseCorruptDataEvent("Error getting next item", e, false);
cacheSize = new UDATA(0);
}
}
public boolean hasNext() {
while (cacheTableIndex.lt(cacheSize)) {
try {
if (cache.at(cacheTableIndex).notNull()) {
return true;
}
} catch (CorruptDataException e) {
raiseCorruptDataEvent("Error getting next item", e, false);
}
cacheTableIndex = cacheTableIndex.add(1);
}
return false;
}
public J9ObjectPointer next() {
if (hasNext()) {
try {
J9ObjectPointer cachedString = J9ObjectPointer.cast(cache.at(cacheTableIndex));
cacheTableIndex = cacheTableIndex.add(1);
return cachedString;
} catch (CorruptDataException e) {
raiseCorruptDataEvent("Error getting next item", e, false);
return null;
}
} else {
throw new NoSuchElementException("There are no more items available through this iterator");
}
}
public VoidPointer nextAddress() {
if (hasNext()) {
VoidPointer address = VoidPointer.cast(cache.add(cacheTableIndex));
cacheTableIndex = cacheTableIndex.add(1);
return address;
} else {
throw new NoSuchElementException("There are no more items available through this iterator");
}
}
public void remove() {
throw new UnsupportedOperationException("The image is read only and cannot be modified.");
}
};
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer in project openj9 by eclipse.
the class GCClassIterator method next.
public J9ObjectPointer next() {
if (hasNext()) {
switch(state) {
case state_statics:
return staticsIterator.next();
case state_constant_pool:
return constantPoolSlotIterator.next();
case state_slots:
if (clazz != null) {
J9ObjectPointer classObject = null;
try {
classObject = clazz.classObject();
} catch (CorruptDataException e) {
// can try to recover from this
raiseCorruptDataEvent("Error fetching the class object", e, false);
}
clazz = null;
return classObject;
}
}
}
throw new NoSuchElementException("There are no more items available through this iterator");
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer in project openj9 by eclipse.
the class GCHeapMapWordIterator method next.
public J9ObjectPointer next() {
if (hasNext()) {
J9ObjectPointer objectToReturn = _next;
_next = nextObject();
return objectToReturn;
} else {
throw new NoSuchElementException("There are no more items available through this iterator");
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer in project openj9 by eclipse.
the class GCHeapMapWordIterator method nextObject.
private J9ObjectPointer nextObject() {
J9ObjectPointer nextObject = null;
if (!_cache.eq(0)) {
/* TODO: lpnguyen, Note that numberOfTrailingZeros in java refers == numberOfLeadingZeros in C verison of this.. */
int trailingZeros = _cache.numberOfTrailingZeros();
long slotsToSkip = (trailingZeros * MM_HeapMap.J9MODRON_HEAP_SLOTS_PER_HEAPMAP_BIT);
_heapSlotCurrent = _heapSlotCurrent.add(slotsToSkip);
_cache = _cache.rightShift(trailingZeros);
nextObject = J9ObjectPointer.cast(_heapSlotCurrent);
/* skip to the next bit in _heapSlotCurrent and in _cache */
_heapSlotCurrent = _heapSlotCurrent.add(MM_HeapMap.J9MODRON_HEAP_SLOTS_PER_HEAPMAP_BIT);
_cache = _cache.rightShift(1);
}
return nextObject;
}
Aggregations