java.lang.Object
proguard.analysis.datastructure.callgraph.Call
Direct Known Subclasses:
ConcreteCall, SymbolicCall

public abstract class Call extends Object
Represents a method call. If the call target is a Method that is present in the class pool, a ConcreteCall is instantiated. If the call target is not a known method, a SymbolicCall is the appropriate subclass.
  • Field Details

  • Constructor Details

    • Call

      protected Call(CodeLocation caller, Value instance, List<Value> arguments, Value returnValue, int throwsNullptr, Instruction instruction, boolean controlFlowDependent, boolean runtimeTypeDependent)
  • Method Details

    • isStatic

      public boolean isStatic()
      Check if this call is static (no implicit instance set) or not.
    • getTarget

      public abstract MethodSignature getTarget()
      The MethodSignature of the method that is being called.
    • hasIncompleteTarget

      public abstract boolean hasIncompleteTarget()
      Check if this call's target is fully known or only parts of it (e.g. only the descriptor).
    • getArgumentCount

      public int getArgumentCount()
      Returns the number of arguments.
    • getJvmArgumentSize

      public int getJvmArgumentSize()
      Returns the number of elements that need to be popped from the JVM stack for this call.
    • getArgument

      public Value getArgument(int index)
      Get the value for a specific argument index.

      Note: This is only to be used in implementations of CallHandler.handleCall(Call, TracedStack, TracedVariables). Afterwards, the values will have been cleared to reduce unnecessary memory usage, as argument values are not needed for the full call graph reconstruction.

    • setArguments

      public void setArguments(List<Value> arguments)
    • getInstance

      public Value getInstance()
      If this is a virtual call, this describes the this pointer of the object whose method is called, usually an IdentifiedReferenceValue. For static calls this is null.

      Note: This is only to be used in implementations of CallHandler.handleCall(Call, TracedStack, TracedVariables). Afterwards, the value will have been cleared to reduce unnecessary memory usage, as the instance value is not needed for the full call graph reconstruction.

    • setInstance

      public void setInstance(Value instance)
    • getReturnValue

      public Value getReturnValue()
      Get the return value of this call.

      Note: This is only to be used in implementations of CallHandler.handleCall(Call, TracedStack, TracedVariables). Afterwards, the value will have been cleared to reduce unnecessary memory usage, as the return value is not needed for the full call graph reconstruction.

    • setReturnValue

      public void setReturnValue(Value returnValue)
    • clearValues

      public void clearValues()
      Clear all Value object references from this call.
    • isCertainlyCalled

      public boolean isCertainlyCalled()
      Returns true if this call is always executed, no matter which branch in the methods are taken and which type the called object has during runtime.
    • toString

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

      public String toSimpleString()
      Prints a shorter version of the regular `toString()` without the caller or null pointer information.
    • targetMethodAccept

      public void targetMethodAccept(MemberVisitor memberVisitor)
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object