private Instr[] prepareBuildInstructions(List<Instr> instructions) { int length = instructions.size(); Instr[] linearizedInstrArray = instructions.toArray(new Instr[length]); for (int ipc = 0; ipc < length; ipc++) { Instr i = linearizedInstrArray[ipc]; if (i instanceof LabelInstr) ((LabelInstr) i).getLabel().setTargetPC(ipc + 1); } Stack<Integer> markers = new Stack(); rescueIPCs = new int[length]; int rpc = -1; for (int ipc = 0; ipc < length; ipc++) { Instr i = linearizedInstrArray[ipc]; if (i instanceof ExceptionRegionStartMarkerInstr) { rpc = ((ExceptionRegionStartMarkerInstr) i).getFirstRescueBlockLabel().getTargetPC(); markers.push(rpc); } else if (i instanceof ExceptionRegionEndMarkerInstr) { markers.pop(); rpc = markers.isEmpty() ? -1 : markers.peek().intValue(); } rescueIPCs[ipc] = rpc; } return linearizedInstrArray; }
@Override public void encode(IRWriterEncoder e) { super.encode(e); e.encode(getLabel()); }
@Override public void encode(IRWriterEncoder e) { super.encode(e); e.encode(getLabel()); }
private Instr[] prepareBuildInstructions(List<Instr> instructions) { int length = instructions.size(); Instr[] linearizedInstrArray = instructions.toArray(new Instr[length]); for (int ipc = 0; ipc < length; ipc++) { Instr i = linearizedInstrArray[ipc]; if (i instanceof LabelInstr) ((LabelInstr) i).getLabel().setTargetPC(ipc + 1); } Stack<Integer> markers = new Stack(); rescueIPCs = new int[length]; int rpc = -1; for (int ipc = 0; ipc < length; ipc++) { Instr i = linearizedInstrArray[ipc]; if (i instanceof ExceptionRegionStartMarkerInstr) { rpc = ((ExceptionRegionStartMarkerInstr) i).getFirstRescueBlockLabel().getTargetPC(); markers.push(rpc); } else if (i instanceof ExceptionRegionEndMarkerInstr) { markers.pop(); rpc = markers.isEmpty() ? -1 : markers.peek().intValue(); } rescueIPCs[ipc] = rpc; } return linearizedInstrArray; }
@Override public Instr clone(CloneInfo ii) { return new LabelInstr(ii.getRenamedLabel(getLabel())); }
@Override public Instr clone(CloneInfo ii) { return new LabelInstr(ii.getRenamedLabel(getLabel())); }
@Override public void LabelInstr(LabelInstr labelinstr) { jvm.method().mark(getJVMLabel(labelinstr.getLabel())); }
@Override public void LabelInstr(LabelInstr labelinstr) { jvm.method().mark(getJVMLabel(labelinstr.getLabel())); }
Instr instr = bbInstrs.get(i); if (!(instr instanceof ReceiveSelfInstr)) { if (instr instanceof LabelInstr) ((LabelInstr) instr).getLabel().setTargetPC(ipc); newInstrs.add(instr); ipc++;
Instr instr = bbInstrs.get(i); if (!(instr instanceof ReceiveSelfInstr)) { if (instr instanceof LabelInstr) ((LabelInstr) instr).getLabel().setTargetPC(ipc); newInstrs.add(instr); ipc++;
Label l = ((LabelInstr) i).getLabel(); newBB = createBB(l, nestedExceptionRegions);
Label l = ((LabelInstr) i).getLabel(); newBB = createBB(l, nestedExceptionRegions);
if (i instanceof LabelInstr) ii.renameLabel(((LabelInstr)i).getLabel());
if (i instanceof LabelInstr) ii.renameLabel(((LabelInstr)i).getLabel());