use of com.ibm.j9ddr.vm29.tools.ddrinteractive.LinearDumper.J9ClassRegionNode in project openj9 by eclipse.
the class AnalyseRomClassUTF8Command method run.
public void run(String command, String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {
try {
boolean printUTF8WeightList = false;
int maxDistributionPercent = 85;
if ((args.length >= 1) && (args[0].equals("UTF8WeightList"))) {
printUTF8WeightList = true;
}
for (int i = 0; i < args.length; i++) {
if (args[i].endsWith("%")) {
try {
// Parses the maxDistribution string such as 85%
maxDistributionPercent = DecimalFormat.getInstance().parse(args[i]).intValue();
} catch (ParseException e) {
out.println("Usage: !analyseromClassutf8 [UTF8WeightList] [maxDistribution%] maxDistribution defaults to 85%");
}
}
}
Statistics statistics = new Statistics();
J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
ROMClassesIterator classSegmentIterator = new ROMClassesIterator(out, vm.classMemorySegments());
J9ObjectPointer bootstraploader = vm.systemClassLoader().classLoaderObject();
while (classSegmentIterator.hasNext()) {
J9ROMClassPointer classPointer = (J9ROMClassPointer) classSegmentIterator.next();
ClassWalker classWalker = new RomClassWalker(classPointer, context);
LinearDumper linearDumper = new LinearDumper();
J9ClassRegionNode allRegionsNode = linearDumper.getAllRegions(classWalker);
statistics.add(allRegionsNode, classSegmentIterator, bootstraploader);
}
statistics.getResult(printUTF8WeightList, maxDistributionPercent, out);
} catch (CorruptDataException e) {
throw new DDRInteractiveCommandException(e);
}
}
use of com.ibm.j9ddr.vm29.tools.ddrinteractive.LinearDumper.J9ClassRegionNode in project openj9 by eclipse.
the class QueryRomClassCommand method run.
public void run(String command, String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {
if (args.length == 0) {
printUsage(out);
return;
}
try {
String[] queries = args[0].split(",");
long address = CommandUtils.parsePointer(queries[0], J9BuildFlags.env_data64);
J9ROMClassPointer romClass = J9ROMClassPointer.cast(address);
queries[0] = "";
ClassWalker classWalker = new RomClassWalker(romClass, context);
LinearDumper linearDumper = new LinearDumper();
J9ClassRegionNode allRegionsNode = linearDumper.getAllRegions(classWalker);
for (String query : queries) {
if (query.length() != 0) {
queryROMClass(out, romClass, query, allRegionsNode);
}
}
} catch (CorruptDataException e) {
throw new DDRInteractiveCommandException(e);
}
}
Aggregations