Package sootup.callgraph.scope
Interface VirtualCallResolver
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Controls which calls (edges) are expanded during call graph construction, at the post-dispatch
checkpoint: invoked once per dynamic-dispatch candidate after
resolveCall has
resolved it for a statement that passed the CallResolver checkpoint. Here all three
ExplorationVerdict verdicts are distinct: ExplorationVerdict.EXPLORE_METHOD
admits the edge and expands the callee, ExplorationVerdict.STOP_AFTER_CALL admits the
edge but does not expand the callee via this edge, and ExplorationVerdict.STOP drops the
edge entirely.-
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull VirtualCallResolverall()Returns aVirtualCallResolverthat admits and expands every candidate.@NonNull ExplorationVerdicttryAdvanceCall(@NonNull SootMethod caller, @NonNull MethodSignature callee, @NonNull InvokableStmt statement) Decides whether a single already-resolved dynamic-dispatch candidate should be admitted as an edge in the call graph, and whether the callee should be expanded via this edge.
-
Method Details
-
tryAdvanceCall
@NonNull ExplorationVerdict tryAdvanceCall(@NonNull SootMethod caller, @NonNull MethodSignature callee, @NonNull InvokableStmt statement) Decides whether a single already-resolved dynamic-dispatch candidate should be admitted as an edge in the call graph, and whether the callee should be expanded via this edge.calleeis intentionally a bareMethodSignature, not a resolvedSootMethod: most implementations only need identity/name/declaring-class information already present on the signature. Implementations that need method-level metadata (e.g. whether the target is abstract or a library class) should resolve it lazily via their ownViewreference, the same wayDefaultCallResolveralready holds one — this avoids forcing a lookup for every dynamic-dispatch candidate when most resolvers don't need one.- Parameters:
caller- the caller methodcallee- the resolved dynamic-dispatch candidate's signaturestatement- the invokable statement causing the call- Returns:
- the verdict for this edge
-
all
Returns aVirtualCallResolverthat admits and expands every candidate.
-