Package

org.opalj.ai.analyses

cg

Permalink

package cg

Visibility
  1. Public
  2. All

Type Members

  1. case class AdditionalCallTargets(project: SomeProject, method: Method, pc: PC, callTargets: Iterable[Method]) extends CallGraphDifferenceReport with Product with Serializable

    Permalink
  2. class BasicVTACallGraphAlgorithmConfiguration extends VTACallGraphAlgorithmConfiguration

    Permalink
  3. class BasicVTACallGraphDomain[Source] extends CorrelationalDomain with DefaultDomainValueBinding with ThrowAllPotentialExceptionsConfiguration with TheProject with TheMethod with DefaultHandlingOfMethodResults with IgnoreSynchronization with DefaultTypeLevelLongValues with DefaultTypeLevelFloatValues with DefaultTypeLevelDoubleValues with DefaultTypeLevelIntegerValues with TypeLevelPrimitiveValuesConversions with TypeLevelLongValuesShiftOperators with DefaultReferenceValuesBinding with TypeLevelInvokeInstructions with TypeLevelFieldAccessInstructions

    Permalink

    Domain object which is used to calculate the call graph using variable type analysis.

  4. class BasicVTAWithPreAnalysisCallGraphAlgorithmConfiguration extends VTAWithPreAnalysisCallGraphAlgorithmConfiguration

    Permalink
  5. class BasicVTAWithPreAnalysisCallGraphDomain[Source] extends CorrelationalDomain with DefaultDomainValueBinding with ThrowAllPotentialExceptionsConfiguration with TheProject with TheMethod with DefaultHandlingOfMethodResults with IgnoreSynchronization with DefaultTypeLevelLongValues with DefaultTypeLevelFloatValues with DefaultTypeLevelDoubleValues with DefaultTypeLevelIntegerValues with TypeLevelPrimitiveValuesConversions with TypeLevelLongValuesShiftOperators with DefaultReferenceValuesBinding with TypeLevelInvokeInstructions with RefinedTypeLevelInvokeInstructions with RefinedTypeLevelFieldAccessInstructions

    Permalink

    Domain object which is used to calculate the call graph using variable type analysis.

  6. class CFACallGraphAlgorithmConfiguration extends VTAWithPreAnalysisCallGraphAlgorithmConfiguration

    Permalink

    Configuration of a call graph algorithm that uses "variable type analysis".

    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's create method.

  7. class CFACallGraphDomain[Source] extends CorrelationalDomain with DefaultDomainValueBinding with ThrowAllPotentialExceptionsConfiguration with TheProject with TheMethod with DefaultHandlingOfMethodResults with IgnoreSynchronization with DefaultReferenceValuesBinding with NullPropertyRefinement with DefaultIntegerRangeValues with DefaultTypeLevelLongValues with TypeLevelPrimitiveValuesConversions with TypeLevelLongValuesShiftOperators with DefaultTypeLevelFloatValues with DefaultTypeLevelDoubleValues with MaxArrayLengthRefinement with TypeLevelInvokeInstructions with RefinedTypeLevelInvokeInstructions with SpecialMethodsHandling with RefinedTypeLevelFieldAccessInstructions with PerformInvocationsWithBasicVirtualMethodCallResolution with DefaultRecordMethodCallResults

    Permalink

    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.

  8. class CHACallGraphAlgorithmConfiguration extends DefaultCallGraphAlgorithmConfiguration

    Permalink

    Configuration of a call graph algorithm that uses CHA.

    Configuration of a call graph algorithm that uses CHA.

    Thread Safety

    This class is thread-safe (it contains no mutable state.)

    Usage

    Instances of this class are passed to a CallGraphFactory's create method.

  9. class CHACallGraphExtractor extends CallGraphExtractor

    Permalink

    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.)

  10. class CHACallGraphExtractorWithCBS extends CHACallGraphExtractor

    Permalink

    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.)

  11. class CallGraph extends AnyRef

    Permalink

    Basic representation of a (calculated) call graph.

    Basic representation of a (calculated) call graph.

    Terminology

    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.

    Thread Safety

    The call graph is effectively immutable and can be accessed by multiple threads concurrently. Calls will never block.

    Call Graph Construction

    The call graph is constructed by the CallGraphFactory.

  12. trait CallGraphAlgorithmConfiguration extends AnyRef

    Permalink

    Configuration of a specific org.opalj.ai.analyses.cg.CallGraphExtractor call graph algorithm.

    Configuration of a specific 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.

  13. class CallGraphBuilder extends AnyRef

    Permalink

    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.

    Thread Safety

    This class is not thread-safe.

    Usage

    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.

  14. class CallGraphCache[Contour, Value] extends AnyRef

    Permalink

    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 Maps where the keys of the first map are ObjectTypes and which return values that are maps where the keys are Contours 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 ObjectTypes. 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!

    Example Usage

    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)
    Note

    Creating a new cache is comparatively expensive and depends on the number of ObjectTypes in a project.

  15. case class CallGraphConstructionException(method: Method, cause: Throwable) extends Product with Serializable

    Permalink

    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.

  16. sealed trait CallGraphDifferenceReport extends AnyRef

    Permalink
  17. trait CallGraphExtractor extends AnyRef

    Permalink

  18. trait Callees extends AnyRef

    Permalink
  19. class ComputedCallGraph extends AnyRef

    Permalink

    Representation of a computed call graph.

  20. class DefaultCHACallGraphDomain[Source] extends Domain with DefaultDomainValueBinding with ThrowAllPotentialExceptionsConfiguration with TheProject with TheMethod with DefaultHandlingOfMethodResults with IgnoreSynchronization with DefaultTypeLevelIntegerValues with DefaultTypeLevelLongValues with DefaultTypeLevelFloatValues with DefaultTypeLevelDoubleValues with TypeLevelPrimitiveValuesConversions with TypeLevelLongValuesShiftOperators with DefaultReferenceValuesBinding with TypeLevelInvokeInstructions with TypeLevelFieldAccessInstructions

    Permalink

    Domain object which is used to calculate the call graph.

  21. abstract class DefaultCallGraphAlgorithmConfiguration extends CallGraphAlgorithmConfiguration

    Permalink

    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.

    Thread Safety

    This class is thread-safe (it contains no mutable state.)

    Usage

    Instances of this class are passed to a CallGraphFactory's create method.

  22. class DefaultVTACallGraphAlgorithmConfiguration extends VTAWithPreAnalysisCallGraphAlgorithmConfiguration

    Permalink
  23. class DefaultVTACallGraphDomain[Source] extends CorrelationalDomain with DefaultDomainValueBinding with ThrowAllPotentialExceptionsConfiguration with TheProject with TheMethod with DefaultHandlingOfMethodResults with IgnoreSynchronization with DefaultTypeLevelLongValues with DefaultTypeLevelFloatValues with DefaultTypeLevelDoubleValues with DefaultTypeLevelIntegerValues with TypeLevelPrimitiveValuesConversions with TypeLevelLongValuesShiftOperators with DefaultReferenceValuesBinding with TypeLevelInvokeInstructions with RefinedTypeLevelInvokeInstructions with RefinedTypeLevelFieldAccessInstructions

    Permalink

    Domain object which is used to calculate the call graph using variable type analysis.

  24. case class EntryPointContainer(declaringClass: String, name: String, descriptor: Option[String]) extends Product with Serializable

    Permalink
  25. class EntryPointInformation extends AnyRef

    Permalink
  26. class ExtVTACallGraphAlgorithmConfiguration extends VTAWithPreAnalysisCallGraphAlgorithmConfiguration

    Permalink
  27. class ExtVTACallGraphDomain[Source] extends CorrelationalDomain with DefaultDomainValueBinding with ThrowAllPotentialExceptionsConfiguration with TheProject with TheMethod with DefaultHandlingOfMethodResults with IgnoreSynchronization with DefaultIntegerRangeValues with DefaultLongSetValues with LongSetValuesShiftOperators with ConcretePrimitiveValuesConversions with DefaultTypeLevelFloatValues with DefaultTypeLevelDoubleValues with DefaultReferenceValuesBinding with MaxArrayLengthRefinement with NullPropertyRefinement with TypeLevelInvokeInstructions with RefinedTypeLevelInvokeInstructions with SpecialMethodsHandling with RefinedTypeLevelFieldAccessInstructions

    Permalink

    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.

  28. case class UnexpectedCallTargets(project: SomeProject, method: Method, pc: PC, callTargets: Iterable[Method]) extends CallGraphDifferenceReport with Product with Serializable

    Permalink
  29. case class UnresolvedMethodCall(caller: Method, pc: PC, calleeClass: ReferenceType, calleeName: String, calleeDescriptor: MethodDescriptor) extends Product with Serializable

    Permalink

    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.

  30. abstract class VTACallGraphAlgorithmConfiguration extends DefaultCallGraphAlgorithmConfiguration

    Permalink

    Configuration of a call graph algorithm that uses "variable type analysis".

    Configuration of a call graph algorithm that uses "variable type analysis".

    Thread Safety

    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.)

    Usage

    Instances of this class are passed to a CallGraphFactory's create method.

  31. class VTACallGraphExtractor[TheDomain <: Domain with TheProject with TheMethod] extends CallGraphExtractor

    Permalink

    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.

  32. abstract class VTAWithPreAnalysisCallGraphAlgorithmConfiguration extends VTACallGraphAlgorithmConfiguration

    Permalink

Value Members

  1. object CallGraphComparison

    Permalink

    Helper functionality to compare two call graphs.

  2. object CallGraphExtractor

    Permalink
  3. object CallGraphFactory

    Permalink

    Factory object to create call graphs.

  4. object ComputedCallGraph

    Permalink
  5. object EntryPointKey extends ProjectInformationKey[EntryPointInformation, Nothing]

    Permalink

    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.

    Examples:
    1. To get the entry point information use the Project's get use:

      val EntryPointInformation = project.get(EntryPointKey)
    2. ,
    3. The example defines at least two methods as entry points:

      • all methods in "com.test.Main" with the name "main", i.e. if more than one method named "main" exists all are added.
      • the method in "com.test.Main" with the name "increase" that requires an integer parameter and also return an integer. If a method descriptor is given, duplicates can't exist.
      org.opalj.callgraph.entryPoints = [
          { declaringClass = "com/test/Main", name = "main" },
          { declaringClass = "com/test/Main", name = "increase", descriptor = "(I)I" }
      ]
    Note

    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.

  6. object VTACallGraphKey extends ProjectInformationKey[ComputedCallGraph, Nothing]

    Permalink

    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.

    Example:
    1. To get the call graph object use the Project's get method and pass in this object.

      val ComputedCallGraph = project.get(VTACallGraphKey)

Ungrouped