Class Value

java.lang.Object
kilim.analysis.Value

public class Value extends Object
A SSA value that represents all objects produced at a particular location in the code. Value objects are used by dataflow analysis (@see BasicBlock)
  • Field Details

    • NO_VAL

      public static Object NO_VAL
    • V_UNDEFINED

      public static Value V_UNDEFINED
    • typeDesc

      private String typeDesc
    • constVal

      private Object constVal
    • numSites

      private int numSites
    • sites

      private int[] sites
  • Constructor Details

    • Value

      private Value(int aPos, String aDesc, Object aConst)
    • Value

      private Value(int newNumSites, int[] newSites, String newType, Object newConst)
  • Method Details

    • getNumSites

      public int getNumSites()
    • getCreationSites

      public int[] getCreationSites()
    • getTypeDesc

      public String getTypeDesc()
    • getConstVal

      public Object getConstVal()
    • merge

      public Value merge(Detector det, Value other)
      Produces a new value (if necessary), if the instructions are different or the types are different. The types are merged to form a least common upper bound, and the instruction sets are unioned.
      Parameters:
      vb -
      Returns:
      this if the result of the merge is no different, or the new value
    • mergeSites

      private int mergeSites(int[] newSites, Value other)
    • addTo

      private int addTo(int[] newSites, int site)
    • equals

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

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

      public static Value make(int pos, String desc)
      create a new Value with the given position and type and no constant value
      Parameters:
      pos - the position in the method for the corresponding instruction, or a unique value for method params
      desc - the type descriptor
      Returns:
      the new Value
    • make

      public static Value make(int pos, String desc, Object aConstVal)
      create a new Value
      Parameters:
      pos - the position in the method for the corresponding instruction, or a unique value for method params
      desc - the type descriptor
      aConstVal - the constant value
      Returns:
      the new Value
    • isCategory2

      public boolean isCategory2()
    • isCategory1

      public boolean isCategory1()
    • toString

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

      public boolean isConstant()
    • category

      public int category()