@Interp
protected Instr[] prepareInstructions() {
setupLinearization();
SimpleCloneInfo cloneInfo = new SimpleCloneInfo(this, false);
// FIXME: If CFG (or linearizedBBList) knew number of instrs we could end up allocing better
// FIXME: Clone CFG in debug mode so interpreter can get matching info to instrs it is interp'ing
// Pass 1. Set up IPCs for labels and instructions and build linear instr list
List<Instr> newInstrs = new ArrayList<>();
int ipc = 0;
for (BasicBlock b: linearizedBBList) {
// All same-named labels must be same Java instance for this to work or we would need
// to examine all Label operands and update this as well which would be expensive.
b.getLabel().setTargetPC(ipc);
// Set all renamed labels (simple clone makes a new copy) to their proper ipc
cloneInfo.getRenamedLabel(b.getLabel()).setTargetPC(ipc);
List<Instr> bbInstrs = b.getInstrs();
int bbInstrsLength = bbInstrs.size();
for (int i = 0; i < bbInstrsLength; i++) {
Instr instr = bbInstrs.get(i);