use of com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer 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;
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer in project openj9 by eclipse.
the class MarkMapCommand method isMarked.
protected void isMarked(String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {
try {
long address = CommandUtils.parsePointer(args[1], J9BuildFlags.env_data64);
J9ObjectPointer object = J9ObjectPointer.cast(address);
MarkedObject result = markMap.queryObject(object);
if (result != null) {
if (result.wasRelocated()) {
out.format("Object %s is marked and relocated to %s\n", result.object.getHexAddress(), result.relocatedObject.getHexAddress());
} else {
out.format("Object %s is marked\n", result.object.getHexAddress());
}
} else {
out.format("Object %s is not marked\n", object.getHexAddress());
}
} catch (CorruptDataException e) {
throw new DDRInteractiveCommandException(e);
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer in project openj9 by eclipse.
the class ObjectRefsCommand method dumpLiveReferences.
private void dumpLiveReferences(J9JavaVMPointer vm, J9ObjectPointer targetObject, PrintStream out) throws CorruptDataException {
MM_HeapRegionManagerPointer hrmPointer = MM_GCExtensionsPointer.cast(vm.gcExtensions()).heapRegionManager();
GCHeapRegionManager heapRegionManager = GCHeapRegionManager.fromHeapRegionManager(hrmPointer);
Table table = new Table("All Live Objects That Refer To !j9object " + targetObject.getHexAddress());
table.row("Object");
LiveSetWalker.walkLiveSet(new LiveReferenceVisitor(heapRegionManager, targetObject, table));
table.render(out);
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer in project openj9 by eclipse.
the class ObjectSizeInfo method scanObjects.
private void scanObjects(GCHeapRegionDescriptor region) throws CorruptDataException {
GCObjectHeapIterator heapIterator = GCObjectHeapIterator.fromHeapRegionDescriptor(region, true, true);
while (heapIterator.hasNext()) {
J9ObjectPointer object = heapIterator.next();
J9ClassPointer objClass = J9ObjectHelper.clazz(object);
if (!objClass.isNull() && (!J9ClassHelper.isArrayClass(objClass) || includeArrays)) {
String objClassString = J9ClassHelper.getJavaName(objClass);
if ((null == className) || className.equals(objClassString)) {
ClassFieldInfo cfInfo = fieldStats.get(objClassString);
if (null == cfInfo) {
cfInfo = new ClassFieldInfo(objClass);
fieldStats.put(objClassString, cfInfo);
}
cfInfo.addInstance(object);
}
}
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9ObjectPointer in project openj9 by eclipse.
the class MonitorsCommand method tablePrintHelper.
/**
* Helper to print monitor tables.
*
* @param filter
* @param builder
* @param objectMonitorPointer
* @return
* @throws DDRInteractiveCommandException
*/
private ObjectMonitor tablePrintHelper(FilterOptions filter, StringBuilder builder, J9ObjectMonitorPointer objectMonitorPointer) throws DDRInteractiveCommandException {
try {
J9ThreadMonitorPointer threadMonitorPointer = objectMonitorPointer.monitor();
J9ThreadAbstractMonitorPointer lock = J9ThreadAbstractMonitorPointer.cast(threadMonitorPointer);
if (lock.flags().allBitsIn(J9ThreadAbstractMonitor.J9THREAD_MONITOR_OBJECT)) {
if (!lock.userData().eq(0)) {
// this is an object monitor in the system monitor table
J9ObjectPointer obj = J9ObjectPointer.cast(lock.userData());
ObjectMonitor objMon = ObjectAccessBarrier.getMonitor(obj);
if (null != objMon) {
writeObjectMonitorToBuffer(filter, objMon, builder);
return objMon;
}
}
}
} catch (CorruptDataException e) {
throw new DDRInteractiveCommandException(e);
}
return null;
}
Aggregations