void printInstruction(InstructionHandle h, int depth) {
printDepth(depth);
printLabel(labelMap.get(h), depth);
Instruction inst = h.getInstruction();
if (inst.isConstantPoolInstruction()) {
out.print(Constants.OPCODE_NAMES[inst.opcode].toUpperCase());
out.print(" ");
out.print(pool.constantToString(pool.getConstant(inst.getIndex())));
} else if (inst instanceof InstructionSelect) {
InstructionSelect sinst = (InstructionSelect) inst;
out.println(Constants.OPCODE_NAMES[sinst.opcode].toUpperCase());
int[] matches = sinst.getMatchs();
InstructionHandle[] targets = sinst.getTargets();
InstructionHandle defaultTarget = sinst.getTarget();
for (int i = 0, len = matches.length; i < len; i++) {
printDepth(depth);
printLabel(null, depth);
out.print(" ");
out.print(matches[i]);
out.print(": \t");
out.println(labelMap.get(targets[i]));
}
printDepth(depth);
printLabel(null, depth);
out.print(" ");
out.print("default: \t");
out.print(labelMap.get(defaultTarget));
} else if (inst instanceof InstructionBranch) {
InstructionBranch brinst = (InstructionBranch) inst;
out.print(Constants.OPCODE_NAMES[brinst.getOpcode()].toUpperCase());
out.print(" ");
out.print(labelMap.get(brinst.getTarget()));
} else if (inst.isLocalVariableInstruction()) {
// LocalVariableInstruction lvinst = (LocalVariableInstruction)
// inst;
out.print(inst.toString(false).toUpperCase());
int index = inst.getIndex();
LocalVariableTag tag = getLocalVariableTag(h, index);
if (tag != null) {
out.print(" // ");
out.print(tag.getType());
out.print(" ");
out.print(tag.getName());
}
} else {
out.print(inst.toString(false).toUpperCase());
}
}