public EnsureBlockInfo(IRScope s, RescueNode n, IRLoop l, Label bodyRescuer) { regionStart = s.getNewLabel(); start = s.getNewLabel(); end = s.getNewLabel(); dummyRescueBlockLabel = s.getNewLabel(); instrs = new ArrayList<>(); savedGlobalException = null; innermostLoop = l; matchingRescueNode = n; this.bodyRescuer = bodyRescuer; needsBacktrace = true; }
public EnsureBlockInfo(IRScope s, RescueNode n, IRLoop l, Label bodyRescuer) { regionStart = s.getNewLabel(); start = s.getNewLabel(); end = s.getNewLabel(); dummyRescueBlockLabel = s.getNewLabel(); instrs = new ArrayList<>(); savedGlobalException = null; innermostLoop = l; matchingRescueNode = n; this.bodyRescuer = bodyRescuer; needsBacktrace = true; }
public EnsureBlockInfo(IRScope s, RescueNode n, IRLoop l) { regionStart = s.getNewLabel(); start = s.getNewLabel(); end = s.getNewLabel(); returnAddr = s.getNewTemporaryVariable(); dummyRescueBlockLabel = s.getNewLabel(); savedGlobalException = null; innermostLoop = l; matchingRescueNode = n; }
public EnsureBlockInfo(IRScope s, RescueNode n, IRLoop l) { regionStart = s.getNewLabel(); start = s.getNewLabel(); end = s.getNewLabel(); returnAddr = s.getNewTemporaryVariable(); dummyRescueBlockLabel = s.getNewLabel(); savedGlobalException = null; innermostLoop = l; matchingRescueNode = n; }
public IRLoop(IRScope s, IRLoop outerLoop) { container = s; parentLoop = outerLoop; loopStartLabel = s.getNewLabel("_LOOP_BEGIN"); loopEndLabel = s.getNewLabel("_LOOP_END"); iterStartLabel = s.getNewLabel("_ITER_BEGIN"); iterEndLabel = s.getNewLabel("_ITER_END"); loopResult = s.createTemporaryVariable(); s.setHasLoopsFlag(); } }
public IRLoop(IRScope s, IRLoop outerLoop) { container = s; parentLoop = outerLoop; loopStartLabel = s.getNewLabel("_LOOP_BEGIN"); loopEndLabel = s.getNewLabel("_LOOP_END"); iterStartLabel = s.getNewLabel("_ITER_BEGIN"); iterEndLabel = s.getNewLabel("_ITER_END"); loopResult = s.getNewTemporaryVariable(); s.setHasLoopsFlag(true); } }
public IRLoop(IRScope s, IRLoop outerLoop) { container = s; parentLoop = outerLoop; loopStartLabel = s.getNewLabel("_LOOP_BEGIN"); loopEndLabel = s.getNewLabel("_LOOP_END"); iterStartLabel = s.getNewLabel("_ITER_BEGIN"); iterEndLabel = s.getNewLabel("_ITER_END"); loopResult = s.createTemporaryVariable(); s.setHasLoopsFlag(); } }
public IRLoop(IRScope s, IRLoop outerLoop) { container = s; parentLoop = outerLoop; loopStartLabel = s.getNewLabel("_LOOP_BEGIN"); loopEndLabel = s.getNewLabel("_LOOP_END"); iterStartLabel = s.getNewLabel("_ITER_BEGIN"); iterEndLabel = s.getNewLabel("_ITER_END"); loopResult = s.getNewTemporaryVariable(); s.setHasLoopsFlag(true); } }
public void renameLabel(Label l) { labelRenameMap.put(l, getScope().getNewLabel()); } }
protected Label getRenamedLabelSimple(Label l) { return getHostScope().getNewLabel(); }
public Label getRenamedLabel(Label l) { Label newLbl = this.lblRenameMap.get(l); if (newLbl == null) { newLbl = inClosureCloneMode ? l.clone() : getInlineHostScope().getNewLabel(); this.lblRenameMap.put(l, newLbl); } return newLbl; }
public Label getRenamedLabel(Label l) { Label newLbl = this.lblRenameMap.get(l); if (newLbl == null) { newLbl = inClosureCloneMode ? l.clone() : getInlineHostScope().getNewLabel(); this.lblRenameMap.put(l, newLbl); } return newLbl; }
private Operand searchConstInInheritanceHierarchy(IRScope s, Operand startingModule, String name) { Variable constVal = s.getNewTemporaryVariable(); genInheritanceSearchInstrs(s, startingModule, constVal, s.getNewLabel(), true, name); return constVal; }
private Operand searchConstInInheritanceHierarchy(IRScope s, Operand startingModule, String name) { Variable constVal = s.getNewTemporaryVariable(); genInheritanceSearchInstrs(s, startingModule, constVal, s.getNewLabel(), true, name); return constVal; }
protected Variable buildDefinitionCheck(IRScope s, ResultInstr definedInstr, String definedReturnValue) { Label undefLabel = s.getNewLabel(); s.addInstr((Instr) definedInstr); s.addInstr(BEQInstr.create(definedInstr.getResult(), manager.getFalse(), undefLabel)); return buildDefnCheckIfThenPaths(s, undefLabel, new StringLiteral(definedReturnValue)); }
protected Variable buildDefinitionCheck(IRScope s, ResultInstr definedInstr, String definedReturnValue) { Label undefLabel = s.getNewLabel(); s.addInstr((Instr) definedInstr); s.addInstr(BEQInstr.create(definedInstr.getResult(), manager.getFalse(), undefLabel)); return buildDefnCheckIfThenPaths(s, undefLabel, new StringLiteral(definedReturnValue)); }
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; }
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; }
public Operand buildOpAsgnAnd(OpAsgnAndNode andNode, IRScope s) { Label l = s.getNewLabel(); Operand v1 = build(andNode.getFirstNode(), s); Variable result = getValueInTemporaryVariable(s, v1); s.addInstr(BEQInstr.create(v1, manager.getFalse(), l)); Operand v2 = build(andNode.getSecondNode(), s); // This does the assignment! s.addInstr(new CopyInstr(result, v2)); s.addInstr(new LabelInstr(l)); return result; }
public Operand buildOpAsgnAnd(OpAsgnAndNode andNode, IRScope s) { Label l = s.getNewLabel(); Operand v1 = build(andNode.getFirstNode(), s); Variable result = getValueInTemporaryVariable(s, v1); s.addInstr(BEQInstr.create(v1, manager.getFalse(), l)); Operand v2 = build(andNode.getSecondNode(), s); // This does the assignment! s.addInstr(new CopyInstr(result, v2)); s.addInstr(new LabelInstr(l)); return result; }