Class Label

java.lang.Object
org.jruby.ir.operands.Operand
org.jruby.ir.operands.Label

public class Label extends Operand
  • Field Details

    • UNRESCUED_REGION_LABEL

      public static final Label UNRESCUED_REGION_LABEL
    • prefix

      public final String prefix
    • id

      public final int id
  • Constructor Details

    • Label

      public Label(String prefix, int id)
  • Method Details

    • getGlobalEnsureBlockLabel

      public static Label getGlobalEnsureBlockLabel()
    • getOperandType

      public OperandType getOperandType()
      Specified by:
      getOperandType in class Operand
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • addUsedVariables

      public void addUsedVariables(List<Variable> l)
      Description copied from class: Operand
      Append the list of variables used in this operand to the input list -- force every operand to implement this because a missing implementation can cause bad failures.
      Specified by:
      addUsedVariables in class Operand
    • 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.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • isGlobalEnsureBlockLabel

      public boolean isGlobalEnsureBlockLabel()
    • clone

      public Label clone()
      Overrides:
      clone in class Object
    • cloneForInlining

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

      public void setTargetPC(int i)
    • getTargetPC

      public int getTargetPC()
    • encode

      public void encode(IRWriterEncoder e)
      Overrides:
      encode in class Operand
    • decode

      public static Label decode(IRReaderDecoder d)
    • visit

      public void visit(IRVisitor visitor)
      Overrides:
      visit in class Operand