public static LabelInstr decode(IRReaderDecoder d) { return new LabelInstr(d.decodeLabel()); }
@Override public Instr clone(CloneInfo ii) { return new LabelInstr(ii.getRenamedLabel(getLabel())); }
public Label getLabel() { return (Label) getOperand1(); }
@Override public void encode(IRWriterEncoder e) { super.encode(e); e.encode(getLabel()); }
case INSTANCE_SUPER: return InstanceSuperInstr.decode(this); case JUMP: return JumpInstr.decode(this); case LABEL: return LabelInstr.decode(this); case LAMBDA: return BuildLambdaInstr.decode(this); case LEXICAL_SEARCH_CONST: return LexicalSearchConstInstr.decode(this);
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; }
case INSTANCE_SUPER: return InstanceSuperInstr.decode(this); case JUMP: return JumpInstr.decode(this); case LABEL: return LabelInstr.decode(this); case LAMBDA: return BuildLambdaInstr.decode(this); case LEXICAL_SEARCH_CONST: return LexicalSearchConstInstr.decode(this);
public static LabelInstr decode(IRReaderDecoder d) { return new LabelInstr(d.decodeLabel()); }
@Override public Instr clone(CloneInfo ii) { return new LabelInstr(ii.getRenamedLabel(getLabel())); }
@Override public void encode(IRWriterEncoder e) { super.encode(e); e.encode(getLabel()); }
public Label getLabel() { return (Label) getOperand1(); }
public void emitBody(IRBuilder b) { b.addInstr(new LabelInstr(start)); for (Instr i: instrs) { b.addInstr(i); } }
if (i instanceof LabelInstr) ii.renameLabel(((LabelInstr)i).getLabel()); builder.addInstr(new LabelInstr(ii.getRenamedLabel(start))); builder.addInstr(new ExceptionRegionStartMarkerInstr(bodyRescuer)); for (Instr instr: instrs) {
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; }
public void emitBody(IRBuilder b) { b.addInstr(new LabelInstr(start)); for (Instr i: instrs) { b.addInstr(i); } }
if (i instanceof LabelInstr) ii.renameLabel(((LabelInstr)i).getLabel()); builder.addInstr(new LabelInstr(ii.getRenamedLabel(start))); builder.addInstr(new ExceptionRegionStartMarkerInstr(bodyRescuer)); for (Instr instr: instrs) {
@Override public void LabelInstr(LabelInstr labelinstr) { jvm.method().mark(getJVMLabel(labelinstr.getLabel())); }
protected Variable buildDefnCheckIfThenPaths(Label undefLabel, Operand defVal) { Label defLabel = getNewLabel(); Variable tmpVar = getValueInTemporaryVariable(defVal); addInstr(new JumpInstr(defLabel)); addInstr(new LabelInstr(undefLabel)); addInstr(new CopyInstr(tmpVar, manager.getNil())); addInstr(new LabelInstr(defLabel)); return tmpVar; }
@Override public void LabelInstr(LabelInstr labelinstr) { jvm.method().mark(getJVMLabel(labelinstr.getLabel())); }
protected Variable buildDefnCheckIfThenPaths(IRScope s, Label undefLabel, Operand defVal) { Label defLabel = s.getNewLabel(); Variable tmpVar = getValueInTemporaryVariable(s, defVal); s.addInstr(new JumpInstr(defLabel)); s.addInstr(new LabelInstr(undefLabel)); s.addInstr(new CopyInstr(tmpVar, manager.getNil())); s.addInstr(new LabelInstr(defLabel)); return tmpVar; }