Class Value


  • public class Value
    extends java.lang.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)
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Value​(int newNumSites, int[] newSites, java.lang.String newType, java.lang.Object newConst)  
      private Value​(int aPos, java.lang.String aDesc, java.lang.Object aConst)  
    • Field Detail

      • NO_VAL

        public static java.lang.Object NO_VAL
      • V_UNDEFINED

        public static Value V_UNDEFINED
      • typeDesc

        private java.lang.String typeDesc
      • constVal

        private java.lang.Object constVal
      • numSites

        private int numSites
      • sites

        private int[] sites
    • Constructor Detail

      • Value

        private Value​(int aPos,
                      java.lang.String aDesc,
                      java.lang.Object aConst)
      • Value

        private Value​(int newNumSites,
                      int[] newSites,
                      java.lang.String newType,
                      java.lang.Object newConst)
    • Method Detail

      • getNumSites

        public int getNumSites()
      • getCreationSites

        public int[] getCreationSites()
      • getTypeDesc

        public java.lang.String getTypeDesc()
      • getConstVal

        public java.lang.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​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public static Value make​(int pos,
                                 java.lang.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,
                                 java.lang.String desc,
                                 java.lang.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 java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isConstant

        public boolean isConstant()
      • category

        public int category()