Class SDGCallNode


  • public class SDGCallNode
    extends PDGNode
    System dependence graph node for a call site, holding the actual-in nodes for its arguments, an optional actual-out node, and a link to the callee entry once resolved.
    • Constructor Detail

      • SDGCallNode

        public SDGCallNode​(int id,
                           InvokeInstruction invokeInstruction,
                           CallSite callSite,
                           IRBlock block)
        Creates a call-site node with no actual-in, actual-out or callee link yet.
        Parameters:
        id - node id
        invokeInstruction - the invoke this node stands for
        callSite - call graph entry for the same invoke
        block - block containing the invoke
    • Method Detail

      • getInvokeInstruction

        public InvokeInstruction getInvokeInstruction()
        Returns:
        the invoke instruction
      • getCallSite

        public CallSite getCallSite()
        Returns:
        the call site
      • setActualOut

        public void setActualOut​(SDGActualOutNode actualOut)
        Attaches the node standing for the value this call returns.
        Parameters:
        actualOut - actual-out node, or null for a void call
      • getTargetEntry

        public SDGEntryNode getTargetEntry()
        Returns:
        the target entry
      • setTargetEntry

        public void setTargetEntry​(SDGEntryNode targetEntry)
        Links this call to the entry node of the resolved callee.
        Parameters:
        targetEntry - callee entry node
      • addActualIn

        public void addActualIn​(SDGActualInNode actualIn)
        Appends an argument node; no check is made for a duplicate parameter index.
        Parameters:
        actualIn - node for one argument of this call
      • getActualIn

        public SDGActualInNode getActualIn​(int parameterIndex)
        Looks up an attached actual-in node by the parameter position it feeds.
        Parameters:
        parameterIndex - parameter position to find
        Returns:
        the matching node, or null if none was added for that position
      • getActualInCount

        public int getActualInCount()
        Returns:
        the number of actual-in nodes attached
      • getActualIns

        public List<SDGActualInNode> getActualIns()
        Returns:
        an unmodifiable view of the actual-in nodes in the order they were added
      • hasActualOut

        public boolean hasActualOut()
        Returns:
        true if the call has a node for its returned value
      • hasTargetEntry

        public boolean hasTargetEntry()
        Returns:
        true once the call has been linked to a callee entry node
      • getTargetOwner

        public String getTargetOwner()
        Returns:
        the owner of the invoked method
      • getTargetName

        public String getTargetName()
        Returns:
        the name of the invoked method
      • getTargetDescriptor

        public String getTargetDescriptor()
        Returns:
        the descriptor of the invoked method
      • getLabel

        public String getLabel()
        Specified by:
        getLabel in class PDGNode
        Returns:
        a short human-readable description of what this node represents
      • getDefinedValue

        public SSAValue getDefinedValue()
        Specified by:
        getDefinedValue in class PDGNode
        Returns:
        the value this node defines, or null if it defines none