Class AllocationSite


  • public final class AllocationSite
    extends Object
    The identity of one allocation in the program - class, owning method and instruction index - which bounds points-to analysis to one abstract object per NEW instruction.
    • Method Detail

      • of

        public static AllocationSite of​(String className,
                                        int instructionIndex,
                                        String methodKey)
        Creates a site for an allocation seen in analysed code.
        Parameters:
        className - internal name of the allocated class
        instructionIndex - index of the allocating instruction
        methodKey - key of the method containing the allocation
        Returns:
        the allocation site
        Throws:
        NullPointerException - if className or methodKey is null
      • external

        public static AllocationSite external​(String className)
        Creates a site for an object that entered from outside the analysed code.
        Parameters:
        className - internal name of the object's class
        Returns:
        the allocation site
        Throws:
        NullPointerException - if className is null
      • synthetic

        public static AllocationSite synthetic​(String className,
                                               String description)
        Creates a site for an object the analysis invents rather than one the program allocates.
        Parameters:
        className - internal name of the object's class
        description - what the synthetic object stands for
        Returns:
        the allocation site
        Throws:
        NullPointerException - if className is null
      • getClassName

        public String getClassName()
        Returns:
        the class name
      • getInstructionIndex

        public int getInstructionIndex()
        Returns:
        the instruction index
      • getMethodKey

        public String getMethodKey()
        Returns:
        the method key
      • isExternal

        public boolean isExternal()
        Returns:
        true if this site stands for an object from outside the analysed code
      • isSynthetic

        public boolean isSynthetic()
        Returns:
        true if this site stands for an object invented by the analysis
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object