Class CallSite


  • public class CallSite
    extends Object
    A specific location where one method invokes another, with the invoke type and bytecode offset.
    • Constructor Detail

      • CallSite

        public CallSite​(MethodReference caller,
                        MethodReference target,
                        InvokeType invokeType)
        Creates a call site with no known bytecode offset.
        Parameters:
        caller - the invoking method
        target - the invoked method
        invokeType - the kind of invocation
      • CallSite

        public CallSite​(MethodReference caller,
                        MethodReference target,
                        InvokeType invokeType,
                        int bytecodeOffset)
        Creates a call site at a known bytecode offset.
        Parameters:
        caller - the invoking method
        target - the invoked method
        invokeType - the kind of invocation
        bytecodeOffset - the offset of the invoke instruction, or -1 if unknown
    • Method Detail

      • getInvokeType

        public InvokeType getInvokeType()
        Returns:
        the invoke type
      • getBytecodeOffset

        public int getBytecodeOffset()
        Returns:
        the bytecode offset
      • isPolymorphic

        public boolean isPolymorphic()
        Returns:
        true if this is a virtual/interface call that may have multiple targets
      • isStatic

        public boolean isStatic()
        Returns:
        true if this is a static call
      • isSpecial

        public boolean isSpecial()
        Returns:
        true if this is a special (constructor/super/private) call
      • isDynamic

        public boolean isDynamic()
        Returns:
        true if this is an invokedynamic call
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object