Class Variable

java.lang.Object
org.jruby.ir.operands.Operand
org.jruby.ir.operands.Variable
Direct Known Subclasses:
LocalVariable, Self, TemporaryVariable

public abstract class Variable extends Operand
  • Constructor Details

    • Variable

      public Variable()
  • Method Details

    • getId

      public abstract String getId()
    • canCopyPropagate

      public boolean canCopyPropagate()
      Description copied from class: Operand
      Can we replace every use of a variable 'v' that contains the value of this operand with the operand itself? This takes importance when there are at least two uses of 'v' within this scope. Ex: v = [1,2,3]; x = v; y = v In this case, we cannot replace the occurrences of 'v' because we would then get x = [1,2,3]; y = [1,2,3] which would then result in two different array objects being constructed instead of a single one.
      Overrides:
      canCopyPropagate in class Operand
      Returns:
      true if it is safe to copy-propagate the operand.
    • getSimplifiedOperand

      public Operand getSimplifiedOperand(Map<Operand,Operand> valueMap, boolean force)
      Overrides:
      getSimplifiedOperand in class Operand
    • isSelf

      public boolean isSelf()
    • getValue

      public Operand getValue(Map<Operand,Operand> valueMap)
      Overrides:
      getValue in class Operand
    • addUsedVariables

      public void addUsedVariables(List<Variable> l)
      Append the list of variables used in this operand to the input list
      Specified by:
      addUsedVariables in class Operand
    • clone

      public abstract Variable clone(SimpleCloneInfo ii)
    • cloneForInlining

      public Operand cloneForInlining(CloneInfo ii)
      Specified by:
      cloneForInlining in class Operand