public int getLongestVariable(int longest, ResultInstr i) { Variable result = i.getResult(); longest = Math.max(longest, result.getId().length() + ((result instanceof LocalVariable) ? 1 : 0)); return longest; }
protected static void setResult(Object[] temp, DynamicScope currDynScope, Instr instr, Object result) { if (instr instanceof ResultInstr) { setResult(temp, currDynScope, ((ResultInstr) instr).getResult(), result); } }
private static void setResult(Object[] temp, DynamicScope currDynScope, Instr instr, Object result) { if (instr instanceof ResultInstr) { setResult(temp, currDynScope, ((ResultInstr)instr).getResult(), result); } }
public int getLongestVariable(int longest, ResultInstr i) { Variable result = i.getResult(); longest = Math.max(longest, result.getId().length() + ((result instanceof LocalVariable) ? 1 : 0)); return longest; }
private Variable addResultInstr(ResultInstr instr) { addInstr((Instr) instr); return instr.getResult(); }
protected static void setResult(Object[] temp, DynamicScope currDynScope, Instr instr, Object result) { if (instr instanceof ResultInstr) { setResult(temp, currDynScope, ((ResultInstr) instr).getResult(), result); } }
private static void setResult(Object[] temp, DynamicScope currDynScope, Instr instr, Object result) { if (instr instanceof ResultInstr) { setResult(temp, currDynScope, ((ResultInstr)instr).getResult(), result); } }
public void renameVars(Map<Operand, Operand> renameMap) { simplifyOperands(renameMap, true); if (this instanceof ResultInstr) { ResultInstr ri = (ResultInstr)this; Variable oldVar = ri.getResult(); Variable newVar = (Variable)renameMap.get(oldVar); if (newVar != null) ri.updateResult(newVar); } }
public void renameVars(Map<Operand, Operand> renameMap) { simplifyOperands(renameMap, true); if (this instanceof ResultInstr) { ResultInstr ri = (ResultInstr)this; Variable oldVar = ri.getResult(); Variable newVar = (Variable)renameMap.get(oldVar); if (newVar != null) ri.updateResult(newVar); } }
public void renameVars(Map<Operand, Operand> renameMap) { simplifyOperands(renameMap, true); if (this instanceof ResultInstr) { ResultInstr ri = (ResultInstr)this; Variable oldVar = ri.getResult(); Variable newVar = (Variable)renameMap.get(oldVar); if (newVar != null) ri.updateResult(newVar); } }
public void renameVars(Map<Operand, Operand> renameMap) { simplifyOperands(renameMap, true); if (this instanceof ResultInstr) { ResultInstr ri = (ResultInstr)this; Variable oldVar = ri.getResult(); Variable newVar = (Variable)renameMap.get(oldVar); if (newVar != null) ri.updateResult(newVar); } }
public boolean canBeDeletedFromScope(IRScope s) { if (!isDeletable()) { return false; } if (this instanceof ResultInstr) { Variable r = ((ResultInstr) this).getResult(); // An escaped binding needs to preserve lvars since // consumers of that binding may access lvars. if (s.bindingHasEscaped()) return !(r instanceof LocalVariable); } return true; }
public boolean canBeDeletedFromScope(IRScope s) { if (!isDeletable()) { return false; } if (this instanceof ResultInstr) { Variable r = ((ResultInstr) this).getResult(); // An escaped binding needs to preserve lvars since // consumers of that binding may access lvars. if (s.bindingHasEscaped()) return !(r instanceof LocalVariable); } return true; }
@Override public void buildDataFlowVars(Instr i) { if (i instanceof ResultInstr) addDFVar(((ResultInstr) i).getResult()); for (Variable x: i.getUsedVariables()) { addDFVar(x); } }
@Override public void buildDataFlowVars(Instr i) { if (i instanceof ResultInstr) addDFVar(((ResultInstr) i).getResult()); for (Variable x: i.getUsedVariables()) { addDFVar(x); } }
public void buildDataFlowVars(Instr i) { if (i instanceof ResultInstr) addDFVar(((ResultInstr) i).getResult()); for (Variable x: i.getUsedVariables()) { addDFVar(x); } }
protected Variable buildDefinitionCheck(ResultInstr definedInstr, String definedReturnValue) { Label undefLabel = getNewLabel(); addInstr((Instr) definedInstr); addInstr(createBranch(definedInstr.getResult(), manager.getFalse(), undefLabel)); return buildDefnCheckIfThenPaths(undefLabel, new FrozenString(definedReturnValue)); }
protected Variable buildDefinitionCheck(ResultInstr definedInstr, String definedReturnValue) { Label undefLabel = getNewLabel(); addInstr((Instr) definedInstr); addInstr(createBranch(definedInstr.getResult(), manager.getFalse(), undefLabel)); return buildDefnCheckIfThenPaths(undefLabel, new FrozenString(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 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)); }