use of com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer in project openj9 by eclipse.
the class GCHeapRegionIterator method from.
public static GCHeapRegionIterator from() throws CorruptDataException {
J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
MM_GCExtensionsPointer gcext = GCExtensions.getGCExtensionsPointer();
MM_HeapRegionManagerPointer hrm = gcext.heapRegionManager();
return fromMMHeapRegionManager(hrm, true, true);
}
use of com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer 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.MM_HeapRegionManagerPointer in project openj9 by eclipse.
the class DTFJJavaHeap method initRegions.
@SuppressWarnings("unchecked")
private void initRegions() throws com.ibm.j9ddr.CorruptDataException {
MM_GCExtensionsPointer gcext = GCExtensions.getGCExtensionsPointer();
MM_HeapRegionManagerPointer hrm = gcext.heapRegionManager();
regions = IteratorHelpers.toList(GCHeapRegionIterator.fromMMHeapRegionManager(hrm, space, true, true));
}
use of com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer in project openj9 by eclipse.
the class HeapWalker method initializeFlatLockedMonitors.
private static void initializeFlatLockedMonitors() throws CorruptDataException {
J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
MM_GCExtensionsPointer gcext = GCExtensions.getGCExtensionsPointer();
MM_HeapRegionManagerPointer hrm = gcext.heapRegionManager();
flatLockedMonitors = new TreeSet<ObjectMonitor>();
GCHeapRegionIterator regions = GCHeapRegionIterator.fromMMHeapRegionManager(hrm, true, true);
while (regions.hasNext()) {
GCHeapRegionDescriptor region = regions.next();
if (!flatLockedMonitorsByRegion.containsKey(region)) {
runFlatLockMonitorRegionWalk(vm, region);
}
/* Running the walk should have populated the flatLockedMonitors map */
assert (flatLockedMonitorsByRegion.containsKey(region));
flatLockedMonitors.addAll(flatLockedMonitorsByRegion.get(region));
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.MM_HeapRegionManagerPointer in project openj9 by eclipse.
the class ACCommand method run.
public void run(String command, String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {
try {
J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
if (command.equalsIgnoreCase("!acforobject")) {
if (null == heapRegionManager) {
MM_HeapRegionManagerPointer hrmPointer;
hrmPointer = MM_GCExtensionsPointer.cast(vm.gcExtensions()).heapRegionManager();
heapRegionManager = GCHeapRegionManager.fromHeapRegionManager(hrmPointer);
}
if (args.length < 1) {
throw new DDRInteractiveCommandException("Invalid number of arguments specified.");
}
long addr = Long.decode(args[0]);
J9ObjectPointer objectPointer = J9ObjectPointer.cast(addr);
dumpACForObject(vm, objectPointer, out);
} else {
MM_GCExtensionsPointer gcExtensions = MM_GCExtensionsPointer.cast(vm.gcExtensions());
if (args.length < 1) {
throw new DDRInteractiveCommandException("Invalid number of arguments specified.");
}
boolean dumpACExternalReferences = false;
boolean dumpOwnedRegions = false;
for (int i = 1; i < args.length; i++) {
String arg = args[i];
if (arg.equalsIgnoreCase("xrefs")) {
dumpACExternalReferences = true;
} else if (arg.equalsIgnoreCase("ownedRegions")) {
dumpOwnedRegions = true;
} else {
throw new DDRInteractiveCommandException("Unrecognized acforobject subcommand -->" + arg);
}
}
long addr = Long.decode(args[0]);
MM_AllocationContextPointer ac = MM_AllocationContextPointer.cast(addr);
if (dumpACExternalReferences) {
// TODO: handle other AC types
if (GCExtensions.isVLHGC()) {
context.execute("!mm_allocationcontexttarok", new String[] { args[0] }, out);
}
dumpLiveReferences(vm, ac, out);
}
if (dumpOwnedRegions) {
dumpOwnedRegions(vm, ac, out);
}
}
} catch (DDRInteractiveCommandException e) {
throw e;
} catch (Throwable e) {
e.printStackTrace(out);
throw new DDRInteractiveCommandException(e);
}
}
Aggregations