Domain object which is used to calculate the call graph using variable type analysis.
Domain object which is used to calculate the call graph using variable type analysis.
Configuration of a call graph algorithm that uses "variable type analysis".
Domain object which can used to calculate a context-sensitive call graph.
Domain object which can used to calculate a context-sensitive call graph. This domain uses advanced domains for tracking primitive values to rule out potential dead branches/method calls on dead branches.
Configuration of a call graph algorithm that uses CHA.
Configuration of a call graph algorithm that uses CHA.
This class is thread-safe (it contains no mutable state.)
Instances of this class are passed to a CallGraphFactory
's create
method.
Domain object that can be used to calculate a call graph using CHA.
Domain object that can be used to calculate a call graph using CHA. This domain basically collects – for all invoke instructions of a method – the potential target methods that may be invoked at runtime.
Virtual calls on Arrays (clone(), toString(),...) are replaced by calls to the
respective methods of java.lang.Object
.
Signature polymorphic methods are correctly resolved (done by the method
lookupImplementingMethod
defined in ClassHierarchy
.)
Domain object that can be used to calculate a call graph using CHA.
Domain object that can be used to calculate a call graph using CHA. This domain basically collects – for all invoke instructions of a method – the potential target methods that may be invoked at runtime.
Virtual calls on Arrays (clone(), toString(),...) are replaced by calls to the
respective methods of java.lang.Object
.
Signature polymorphic methods are correctly resolved (done by the method
lookupImplementingMethod
defined in ClassHierarchy
.)
Basic representation of a (calculated) call graph.
Basic representation of a (calculated) call graph.
A method that calls another method is referred to as the caller
. The method
that is called is called the callee
. Hence, a caller calls a callee.
The call graph is effectively immutable and can be accessed by multiple threads concurrently. Calls will never block.
The call graph is constructed by the CallGraphFactory.
Configuration of a specific import org.opalj.ai.analyses.cg.CallGraphExtractor call graph algorithm.
Configuration of a specific
import org.opalj.ai.analyses.cg.CallGraphExtractor call graph algorithm. Basically, the configuration
consist of the Cache
object that will be used during the
computation of the call graph and the extractor that will be used
for each method that is analyzed during the construction of the graph.
Builds a call graph by first collecting all call graph edges before the final
CallGraph
is created.
Builds a call graph by first collecting all call graph edges before the final
CallGraph
is created.
This class is not thread-safe.
This class is used internally by the methods of the CallGraphFactory
to build
the call graph. That class/those methods takes care of all thread-safety issues.
A thread-safe cache for information that is associated
with a specific ObjectType
and an additional key (Contour
).
A thread-safe cache for information that is associated
with a specific ObjectType
and an additional key (Contour
). Conceptually, the cache
is a Map
of Map
s where the keys of the first map are ObjectType
s and which
return values that are maps where the keys are Contour
s and the values are the
stored/cached information.
To minimize contention the cache's maps are all preinitialized based on the number of
different types that we have seen. This ensure that two
threads can always concurrently access the cache (without blocking)
if the information is associated with two different ObjectType
s. If two threads
want to access information that is associated with the same ObjectType
the
data-structures try to minimize potential contention. Hence, this is not a general
purpose cache. Using this cache is only appropriate if you need/will cache a lot
of information that is associated with different object types.
It is required that the cache object is created before the threads are created that use the cache!
To store the result of the computation of all target methods for a virtual method call (given some declaring class type and a method signature), the cache could be instantiated as follows:
val cache = new CallGraphCache[MethodSignature,Iterable[Method]](project)
Creating a new cache is comparatively expensive and depends
on the number of ObjectType
s in a project.
Encapsulates an exception that is thrown during the creation of the call graph.
Encapsulates an exception that is thrown during the creation of the call graph.
In general, we do not abort the construction of the overall call graph if an exception is thrown.
Representation of a computed call graph.
Domain object which is used to calculate the call graph.
Configuration of a call graph import org.opalj.ai.analyses.cg.CallGraphAlgorithmConfiguration algorithm that uses a cache that depends on the current org.opalj.br.MethodSignature.
Configuration of a call graph import org.opalj.ai.analyses.cg.CallGraphAlgorithmConfiguration algorithm that uses a cache that depends on the current org.opalj.br.MethodSignature.
This class is thread-safe (it contains no mutable state.)
Instances of this class are passed to a CallGraphFactory
's create
method.
Domain object which is used to calculate the call graph using variable type analysis.
Domain object which can used to calculate the call graph using variable type analysis.
Domain object which can used to calculate the call graph using variable type analysis. This domain uses advanced domains for tracking primitive values to rule out potential dead branches/method calls on dead branches.
Represents a method call that could not be resolved; that is, the target of an invoke instruction could not be found.
Represents a method call that could not be resolved; that is, the target of an invoke instruction could not be found. This information is primarily interesting during the development of static analyses.
Configuration of a call graph algorithm that uses "variable type analysis".
Configuration of a call graph algorithm that uses "variable type analysis".
This class is thread-safe import org.opalj.ai.analyses.cg.BasicVTACallGraphDomain import org.opalj.ai.analyses.cg.ExtVTACallGraphDomain import org.opalj.ai.analyses.cg.BasicVTAWithPreAnalysisCallGraphDomain import org.opalj.ai.analyses.cg.DefaultVTACallGraphDomain(it contains no mutable state.)
Instances of this class are passed to a CallGraphFactory
's create
method.
The VTACallGraphExtractor
extracts call edges using the type information at hand.
The VTACallGraphExtractor
extracts call edges using the type information at hand.
I.e., it does not use the specified declaring class type, but instead uses the
type information about the receiver value that are available.
Helper functionality to compare two call graphs.
Factory object to create call graphs.
The key object to get the entry point(s) of a project.
The key object to get the entry point(s) of a project. The entry points are computed w.r.t. to the analysis mode of the project.
To get the entry point information use the Project
's get
use:
val EntryPointInformation = project.get(EntryPointKey)
The example defines at least two methods as entry points:
org.opalj.callgraph.entryPoints = [ { declaringClass = "com/test/Main", name = "main" }, { declaringClass = "com/test/Main", name = "increase", descriptor = "(I)I" } ]
The entry point analysis is not sufficient when it comes – for example – to
non-traceable callbacks; i.e., calls that are implicitly triggered by the JVM,
a custom framework, a custom web server or others.
To overcome that limitation, the key provides a mechanism to specify individual
entry points via the configuration file. To use that mechanism, it's required to add
the following config key to the configuration file.
The general format of the JSON key that can be added to the application.conf
or
reference.conf
.
org.opalj.callgraph.entryPoints = [ { declaringClass = "" , methodName = "name", descriptor = "" } # OPTIONAL ]
As the previous definition suggests, each entry point definition consists of the
declaringClass
and name
. The optional third parameter is the method descriptor.
The key object to get a call graph that was calculated using the VTA algorithm.
The key object to get a call graph that was calculated using the VTA algorithm.
You can assume that – in general – the call graph calculated using the VTA algorithm is more precise than the call graph calculated using the CHA algorithm. Depending on the project, the performance may be better, equal or worse.
To get the call graph object use the Project
's get
method and pass in
this
object.
val ComputedCallGraph = project.get(VTACallGraphKey)
Configuration of a call graph algorithm that uses "variable type analysis".
Thread Safety
This class is thread-safe (it contains no mutable state.)
Usage
Instances of this class are passed to a
CallGraphFactory
'screate
method.