Class Variables

java.lang.Object
proguard.evaluation.Variables
Direct Known Subclasses:
TracedVariables

public class Variables extends Object
This class represents a local variable frame that contains Value instances. Values are generalizations of all values that have been stored in the respective variables.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int
     
    protected Value[]
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Variables(int size)
    Creates a new Variables object with a given maximum number of variables.
    Variables(Variables variables)
    Creates a Variables object that is a copy of the given Variables object.
  • Method Summary

    Modifier and Type
    Method
    Description
    aload(int index)
    Loads the ReferenceValue from the variable with the given index.
    dload(int index)
    Loads the DoubleValue from the variable with the given index.
    boolean
    equals(Object object)
     
    fload(int index)
    Loads the FloatValue from the variable with the given index.
    boolean
    generalize(Variables other, boolean clearConflictingOtherVariables)
    Generalizes the values of this Variables object with the values of the given Variables object.
    getValue(int index)
    Gets the Value of the variable with the given index, without disturbing it.
    Gets the Values of the variables array, without disturbing it.
    int
     
    iload(int index)
    Loads the IntegerValue from the variable with the given index.
    void
    Initializes the values of this Variables object with the values of the given Variables object.
    lload(int index)
    Loads the LongValue from the variable with the given index.
    load(int index)
    Loads the Value from the variable with the given index.
    oload(int index)
    Loads the InstructionOffsetValue from the variable with the given index.
    void
    replaceReferences(Value toReplace, Value replacement)
    Replaces all the references to with references to .
    void
    Apply to all values that match .
    void
    reset(int size)
    Resets this Variables object, so that it can be reused.
    int
    Returns the number of variables.
    void
    store(int index, Value value)
    Stores the given Value at the given variable index.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • values

      protected Value[] values
    • size

      protected int size
  • Constructor Details

    • Variables

      public Variables(int size)
      Creates a new Variables object with a given maximum number of variables.
    • Variables

      public Variables(Variables variables)
      Creates a Variables object that is a copy of the given Variables object.
  • Method Details

    • reset

      public void reset(int size)
      Resets this Variables object, so that it can be reused.
    • initialize

      public void initialize(Variables other)
      Initializes the values of this Variables object with the values of the given Variables object. The other object may have fewer values, in which case the remaining values are left unchanged.
    • generalize

      public boolean generalize(Variables other, boolean clearConflictingOtherVariables)
      Generalizes the values of this Variables object with the values of the given Variables object.
      Parameters:
      clearConflictingOtherVariables - specifies whether the other variables should be cleared too, in case of conflicts.
      Returns:
      whether the generalization has made any difference.
    • size

      public int size()
      Returns the number of variables.
    • getValue

      public Value getValue(int index)
      Gets the Value of the variable with the given index, without disturbing it.
    • getValues

      public Value[] getValues()
      Gets the Values of the variables array, without disturbing it.
    • store

      public void store(int index, Value value)
      Stores the given Value at the given variable index.
    • load

      public Value load(int index)
      Loads the Value from the variable with the given index.
    • iload

      public IntegerValue iload(int index)
      Loads the IntegerValue from the variable with the given index.
    • lload

      public LongValue lload(int index)
      Loads the LongValue from the variable with the given index.
    • fload

      public FloatValue fload(int index)
      Loads the FloatValue from the variable with the given index.
    • dload

      public DoubleValue dload(int index)
      Loads the DoubleValue from the variable with the given index.
    • aload

      public ReferenceValue aload(int index)
      Loads the ReferenceValue from the variable with the given index.
    • oload

      public InstructionOffsetValue oload(int index)
      Loads the InstructionOffsetValue from the variable with the given index.
    • replaceReferences

      public void replaceReferences(Value toReplace, Value replacement)
      Replaces all the references to with references to .
    • replaceReferencesIf

      public void replaceReferencesIf(Predicate<Value> predicate, UnaryOperator<Value> op)
      Apply to all values that match .
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object