ConcreteMethod meth =
new ConcreteMethod((Method) member, classFile, true, true);
TranslationAdvice advice = DexTranslationAdvice.THE_ONE;
RopMethod rmeth = Ropper.convert(meth, advice);
SsaMethod ssaMeth = null;
boolean isStatic = AccessFlags.isStatic(meth.getAccessFlags());
int paramWidth = computeParamWidth(meth, isStatic);
if (args.ssaStep == null) {
ssaMeth = Optimizer.debugNoRegisterAllocation(rmeth,
paramWidth, isStatic, true, advice,
EnumSet.allOf(Optimizer.OptionalStep.class));
} else if ("edge-split".equals(args.ssaStep)) {
ssaMeth = Optimizer.debugEdgeSplit(rmeth, paramWidth,
isStatic, true, advice);
} else if ("phi-placement".equals(args.ssaStep)) {
ssaMeth = Optimizer.debugPhiPlacement(
rmeth, paramWidth, isStatic, true, advice);
} else if ("renaming".equals(args.ssaStep)) {
ssaMeth = Optimizer.debugRenaming(
rmeth, paramWidth, isStatic, true, advice);
} else if ("dead-code".equals(args.ssaStep)) {
ssaMeth = Optimizer.debugDeadCodeRemover(
rmeth, paramWidth, isStatic,true, advice);
}
StringBuffer sb = new StringBuffer(2000);
sb.append("first ");
sb.append(Hex.u2(
ssaMeth.blockIndexToRopLabel(ssaMeth.getEntryBlockIndex())));
sb.append('\n');
ArrayList<SsaBasicBlock> blocks = ssaMeth.getBlocks();
ArrayList<SsaBasicBlock> sortedBlocks =
(ArrayList<SsaBasicBlock>) blocks.clone();
Collections.sort(sortedBlocks, SsaBasicBlock.LABEL_COMPARATOR);
for (SsaBasicBlock block : sortedBlocks) {
sb.append("block ")
.append(Hex.u2(block.getRopLabel())).append('\n');
BitSet preds = block.getPredecessors();
for (int i = preds.nextSetBit(0); i >= 0;
i = preds.nextSetBit(i+1)) {
sb.append(" pred ");
sb.append(Hex.u2(ssaMeth.blockIndexToRopLabel(i)));
sb.append('\n');
}
sb.append(" live in:" + block.getLiveInRegs());
sb.append("\n");