Packages

  • package root
    Definition Classes
    root
  • package org
    Definition Classes
    root
  • package opalj

    OPAL is a Scala-based framework for the static analysis, manipulation and creation of Java bytecode.

    OPAL is a Scala-based framework for the static analysis, manipulation and creation of Java bytecode. OPAL is designed with performance, scalability and adaptability in mind.

    Its main components are:

    • a library (Common) which provides generally useful data-structures and algorithms for static analyses.
    • a framework for parsing Java bytecode (Bytecode Infrastructure) that can be used to create arbitrary representations.
    • a library to create a one-to-one in-memory representation of Java bytecode (Bytecode Disassembler).
    • a library to create a representation of Java bytecode that facilitates writing simple static analyses (Bytecode Representation - org.opalj.br).
    • a scalable, easily customizable framework for the abstract interpretation of Java bytecode (Abstract Interpretation Framework - org.opalj.ai).
    • a library to extract dependencies between code elements and to facilitate checking architecture definitions.
    • a library for the lightweight manipulation and creation of Java bytecode.

    General Design Decisions

    Thread Safety

    Unless explicitly noted, OPAL is thread safe. I.e., the classes defined by OPAL can be considered to be thread safe unless otherwise stated. (For example, it is possible to read and process class files concurrently without explicit synchronization on the client side.)

    No null Values

    Unless explicitly noted, OPAL does not null values I.e., fields that are accessible will never contain null values and methods will never return null. If a method accepts null as a value for a parameter or returns a null value it is always explicitly documented. In general, the behavior of methods that are passed null values is undefined unless explicitly documented.

    No Typecasts for Collections

    For efficiency reasons, OPAL sometimes uses mutable data-structures internally. After construction time, these data-structures are generally represented using their generic interfaces (e.g., scala.collection.{Set,Map}). However, a downcast (e.g., to add/remove elements) is always forbidden as it would effectively prevent thread-safety. Furthermore, the concrete data-structure is always considered an implementation detail and may change at any time.

    Assertions

    OPAL makes heavy use of Scala's Assertion Facility to facilitate writing correct code. Hence, for production builds (after thorough testing(!)) it is highly recommend to build OPAL again using -Xdisable-assertions.

    Definition Classes
    org
  • package ai

    Implementation of an abstract interpretation (ai) framework – also referred to as OPAL.

    Implementation of an abstract interpretation (ai) framework – also referred to as OPAL.

    Please note, that OPAL/the abstract interpreter just refers to the classes and traits defined in this package (ai). The classes and traits defined in the sub-packages (in particular in domain) are not considered to be part of the core of OPAL/the abstract interpreter.

    Definition Classes
    opalj
    Note

    This framework assumes that the analyzed bytecode is valid; i.e., the JVM's bytecode verifier would be able to verify the code. Furthermore, load-time errors (e.g., LinkageErrors) are – by default – completely ignored to facilitate the analysis of parts of a project. In general, if the presented bytecode is not valid, the result is undefined (i.e., OPAL may report meaningless results, crash or run indefinitely).

    See also

    org.opalj.ai.Domain - The core interface between the abstract interpretation framework and the abstract domain that is responsible for performing the abstract computations.

    org.opalj.ai.AI - Implements the abstract interpreter that processes a methods code and uses an analysis-specific domain to perform the abstract computations.

  • package analyses

  • package cg
  • package common
  • package dataflow

    Supports the specification and solving of data-flow problems.

    Supports the specification and solving of data-flow problems.

    Goal

    To be able to express data-flow problems at a very high-level of abstraction. I.e., that some information flows or not-flows from a well-identified source to a well-identified sink.

    Usage Scenario

    • We want to avoid that information is stored in the database/processed by the backend without being sanitized.
    • We want to specify that certain information is not allowed to flow from one module to another module

    Concept

    1. Select sources
      1. Sources are parameters passed to methods (e.g., doPost(session : Session) (This covers the main method as well as typical callback methods.)
      2. Values returned by methods (e.g., System.in.read) (here, we identify the call site)
    2. Select sinks
      1. A sink is either a field (in which the value is stored)
      2. a method (parameter) which is passed the value
    3. Filtering (Terminating) data-flows
      1. If a specific operation was performed, e.g.,
      2. If a comparison (e.g., against null, > 0 , ...)
      3. An instanceOf/a checkcast
      4. A mathematical operation (e.g. +.-,...)
      5. [OPTIMIZATION] If the value was passed to a specific method (e.g., check(x : X) - throws Exception if the check fails)
      6. [OPTIMIZATION] If the value was returned by a well-identified method (e.g., String sanitized = s.replace(...,...))

    4. Extending data-flows (Side Channels)

    • OPEN: What would be the general strategy if a value influences another value?
    • [SIDE CHANNELS?] What happens if the value is stored in a field of an object and that object is used?
    • [SIDE CHANNELS?] What happens if the value is used during the computation, but does not (directly) influence the output. (e.g., if(x == 0) 1; else 2;

    Furthermore, the framework will automatically handle taint propagation and aliasing. I.e., a tainted value that is stored in a field automatically marks the respective field as tainted.

  • package debug
  • package domain

    This package contains definitions of common domains that can be used for the implementation of analyses.

    This package contains definitions of common domains that can be used for the implementation of analyses.

    Types of Domains

    In general, we distinguish two types of domains. First, domains that define a general interface (on top of the one defined by Domain), but do not directly provide an implementation. Hence, whenever you develop a new Domain you should consider implementing/using these domains to maximize reusability. Second, Domains that implement a specific interface (trait). In this case, we further distinguish between domains that provide a default implementation (per interface only one of these Domains can be used to create a final Domain) and those that can be stacked and basically refine the overall functionality.

    Examples

    • Domains That Define a General Interface
      • Origin defines two types which domains that provide information abou the origin of a value should consider to implement.
      • TheProject defines a standard mechanism how a domain can access the current project.
      • TheClassHierarchy defines a standard mechanism how to get the project's class hierarchy.
      • ...
    • Domains That Provide a Default Implementation
      • Origin defines the functionality to return a value's origin if the value supports that.
      • TheProject default implementation of the TheClassHierarchy trait that uses the project's class hierarchy.
      • DefaultHandlingOfMethodResults basically implements a Domain's methods related to return instructions an uncaught exceptions.
      • ...
    • Domains That Implement Stackable Functionality
      • RecordThrownExceptions records information about all uncaught exceptions by intercepting a Domain's respective methods. However, it does provide a default implementation. Hence, a typical pattern is:
    class MyDomain extends Domain with ...
        with DefaultHandlingOfMethodResults with RecordThrownExceptions

    Thread Safety

    Unless explicitly documented, a domain is never thread-safe. The general programming model is to use one Domain object per code block/method and therefore, thread-safety is not required for Domains that are used for the evaluation of methods. However domains that are used to adapt/transfer values should be thread safe (see ValuesCoordinatingDomain for further details).

  • package fpcf
  • package jdkbug

    Contains definitions that are used by the elements specified in JDKBugs

  • package project
  • package tutorial
  • package util

    Common utility functionality.

  • AI
  • AIAborted
  • AICompleted
  • AIException
  • AIResult
  • AIResultBuilder
  • AITracer
  • BaseAI
  • BaseReferenceValues
  • BoundedInterruptableAI
  • CTC1
  • CTC2
  • CallGraphDiff
  • CallsOfNativeMethodsWithBoundedValues
  • CipherGetInstanceStringUsage
  • Computation
  • ComputationFailed
  • ComputationWithException
  • ComputationWithResult
  • ComputationWithResultAndException
  • ComputationWithSideEffectOnly
  • ComputationWithSideEffectOrException
  • ComputedValue
  • ComputedValueOrException
  • ConfigurableXHTMLTracer
  • Configuration
  • ConsoleEvaluationTracer
  • ConsoleTracer
  • CoreDomainFunctionality
  • CorrelationalDomain
  • CorrelationalDomainSupport
  • CountingAI
  • CustomInitialization
  • Domain
  • DomainException
  • DoubleValuesDomain
  • DoubleValuesFactory
  • ExceptionUsage
  • ExceptionUsageAnalysisDomain
  • ExceptionsFactory
  • ExceptionsRaisedByCalledMethods
  • FieldAccessesDomain
  • FloatValuesDomain
  • FloatValuesFactory
  • FlowEntity
  • GetCallees
  • GlobalLogContextProvider
  • IdentityBasedCorrelationChangeDetection
  • InfiniteRecursion
  • InfiniteRecursions
  • InfiniteRecursionsDomain
  • InstructionCountBoundedAI
  • IntegerRangeValuesFactory
  • IntegerValuesDomain
  • IntegerValuesFactory
  • InterpretMethod
  • InterpretationFailedException
  • InterruptableAI
  • IsBooleanValue
  • IsByteValue
  • IsCharValue
  • IsDoubleValue
  • IsFloatValue
  • IsIntegerValue
  • IsLongValue
  • IsNullValue
  • IsPrimitiveValue
  • IsReferenceValue
  • IsShortValue
  • JoinStabilization
  • KnownType
  • LogContextProvider
  • LongValuesDomain
  • LongValuesFactory
  • MetaInformationUpdate
  • MetaInformationUpdateType
  • MethodCallInformation
  • MethodCallsDomain
  • MethodReturnValuesAnalysis
  • MethodsThatAlwaysReturnAPassedParameter
  • MonitorInstructionsDomain
  • MultiTracer
  • NativeCallWithBoundedMethodParameter
  • NoUpdate
  • NoUpdateType
  • PrimitiveValuesConversionsDomain
  • ReferenceValuesDomain
  • ReferenceValuesFactory
  • RefineableNativeMethods
  • RefinedReturnType
  • ReturnInstructionsDomain
  • SomeUpdate
  • StructuralUpdate
  • StructuralUpdateType
  • SubroutinesDomain
  • TheAI
  • TheClassHierarchy
  • TheCodeStructure
  • TheMemoryLayout
  • ThrowsException
  • TimeBoundedAI
  • TypeInformation
  • TypeOfReferenceValue
  • TypedValuesFactory
  • UnknownType
  • UnusedMethods
  • Update
  • UpdateType
  • UsageKind
  • UselessComputation
  • UselessComputations
  • UselessComputationsMinimal
  • ValuesDomain
  • XHTMLTracer
  • package av
    Definition Classes
    opalj
  • package ba

    Implementation of an eDSL for creating Java bytecode.

    Implementation of an eDSL for creating Java bytecode. The eDSL is designed to facilitate the creation of correct class files; i.e., whenever possible it tries to fill wholes. For example, when an interface is specified the library automatically ensures that the super class type is (initially) set to java.lang.Object as required by the JVM specification.

    This package in particular provides functionality to convert org.opalj.br classes to org.opalj.da classes.

    Definition Classes
    opalj
  • package bc
    Definition Classes
    opalj
  • package bi

    Implementation of a library for parsing Java bytecode and creating arbitrary representations.

    Implementation of a library for parsing Java bytecode and creating arbitrary representations.

    OPAL's primary representation of Java byte code is the org.opalj.br representation which is defined in the respective package. A second representation that represents bytecode one-by-one is found in the org.opalj.da package.

    This Package

    Common constants and type definitions used across OPAL.

    Definition Classes
    opalj
  • package br

    In this representation of Java bytecode references to a Java class file's constant pool and to attributes are replaced by direct references to the corresponding constant pool entries.

    In this representation of Java bytecode references to a Java class file's constant pool and to attributes are replaced by direct references to the corresponding constant pool entries. This facilitates developing analyses and fosters comprehension.

    Based on the fact that indirect reference to constant pool entries are resolved and replaced by direct reference this representation is called the resolved representation.

    This representation of Java bytecode is considered as OPAL's standard representation for writing Scala based analyses. This representation is engineered such that it facilitates writing analyses that use pattern matching.

    Definition Classes
    opalj
  • package bugpicker
    Definition Classes
    opalj
  • package bytecode

    Defines functionality commonly useful when processing Java bytecode.

    Defines functionality commonly useful when processing Java bytecode.

    Definition Classes
    opalj
  • package collection

    Defines helper methods related to Scala's and OPAL's collections APIs.

    Defines helper methods related to Scala's and OPAL's collections APIs.

    Definition Classes
    opalj
  • package concurrent

    Common constants, factory methods and objects used throughout OPAL when performing concurrent computations.

    Common constants, factory methods and objects used throughout OPAL when performing concurrent computations.

    Definition Classes
    opalj
  • package config
    Definition Classes
    opalj
  • package constraints

    Defines helper values and methods related modeling constraints.

    Defines helper values and methods related modeling constraints.

    Definition Classes
    opalj
  • package control

    Defines common control abstractions.

    Defines common control abstractions.

    Definition Classes
    opalj
  • package da

    Defines convenience methods related to representing certain class file elements.

    Defines convenience methods related to representing certain class file elements.

    Definition Classes
    opalj
  • package de

    Functionality to extract dependencies between class files.

    Functionality to extract dependencies between class files.

    Definition Classes
    opalj
  • package fpcf

    The fixpoint computations framework (fpcf) is a general framework to perform fixpoint computations on a fixed set of entities.

    The fixpoint computations framework (fpcf) is a general framework to perform fixpoint computations on a fixed set of entities. The framework in particular supports the development of static analyses. In this case, the fixpoint computations/ static analyses are generally operating on the code and need to be executed until the computation has reached its (implicit) fixpoint. The fixpoint framework explicitly supports cyclic dependencies/computations and performs all computations in parallel. A prime use case of the fixpoint framework are all those analyses that may interact with the results of other analyses.

    For example, an analysis that analyses all field write access to determine if we can refine a field's type (for the purpose of the analysis) can (reuse) the information about the return types of methods, which however may depend on the refined field types.

    The framework is generic enough to facilitate the implementation of anytime algorithms.

    The framework supports two very basic kinds of properties. Those properties that are associated with a specific entity; e.g., a field's real type, and those properties that are shared by a set of entities; e.g., the set of all methods that are entry points. In general, the latter properties can also be modeled using the first mechanism, but this would not be as effective.

    Definition Classes
    opalj
    Note

    The dependency relation is as follows: “A depends on B” === “A is the depender, B is the dependee”. === “B is depended on by A”

  • package graphs

    This package defines graph algorithms as well as factory methods to describe and compute graphs and trees.

    This package defines graph algorithms as well as factory methods to describe and compute graphs and trees.

    This package supports the following types of graphs:

    1. graphs based on explicitly connected nodes (org.opalj.graphs.Node),
    2. graphs where the relationship between the nodes are encoded externally (org.opalj.graphs.Graph).
    Definition Classes
    opalj
  • package hermes
    Definition Classes
    opalj
  • package io

    Various io-related helper methods and classes.

    Various io-related helper methods and classes.

    Definition Classes
    opalj
    Note

    The implementations of the methods rely on Java NIO(2).

  • package issues

    Defines implicit conversions to wrap some types of analyses such that they generate results of type org.opalj.br.analyses.ReportableAnalysisResult.

    Defines implicit conversions to wrap some types of analyses such that they generate results of type org.opalj.br.analyses.ReportableAnalysisResult.

    Definition Classes
    opalj
  • package log
    Definition Classes
    opalj
  • package tac

    Common definitions related to the definition and processing of three address code.

    Common definitions related to the definition and processing of three address code.

    Definition Classes
    opalj
  • package util

    Utility methods.

    Utility methods.

    Definition Classes
    opalj

package ai

Implementation of an abstract interpretation (ai) framework – also referred to as OPAL.

Please note, that OPAL/the abstract interpreter just refers to the classes and traits defined in this package (ai). The classes and traits defined in the sub-packages (in particular in domain) are not considered to be part of the core of OPAL/the abstract interpreter.

Source
package.scala
Note

This framework assumes that the analyzed bytecode is valid; i.e., the JVM's bytecode verifier would be able to verify the code. Furthermore, load-time errors (e.g., LinkageErrors) are – by default – completely ignored to facilitate the analysis of parts of a project. In general, if the presented bytecode is not valid, the result is undefined (i.e., OPAL may report meaningless results, crash or run indefinitely).

See also

org.opalj.ai.Domain - The core interface between the abstract interpretation framework and the abstract domain that is responsible for performing the abstract computations.

org.opalj.ai.AI - Implements the abstract interpreter that processes a methods code and uses an analysis-specific domain to perform the abstract computations.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ai
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract class AI[D <: Domain] extends AnyRef

    A highly-configurable framework for the (abstract) interpretation of Java bytecode that relies on OPAL's resolved representation (org.opalj.br) of Java bytecode.

    A highly-configurable framework for the (abstract) interpretation of Java bytecode that relies on OPAL's resolved representation (org.opalj.br) of Java bytecode.

    This framework basically traverses all instructions of a method in depth-first order until an instruction is hit where multiple control flows potentially join. This instruction is then only analyzed if no further instruction can be evaluated where no paths join (org.opalj.br.Code.cfPCs). Each instruction is then evaluated using a given (abstract) org.opalj.ai.Domain. The evaluation of a subroutine (Java code < 1.5) - in case of an unhandled exception – is always first completed before the evaluation of the parent (sub)routine is continued.

    Interacting with OPAL's Abstract Interpreter

    The primary means how to make use of this framework is to perform an abstract interpretation of a method using a customized Domain. That customized domain can be used, e.g., to build a call graph or to do other intra-/interprocedural analyses while the code is analyzed. Additionally, it is possible to analyze the result of an abstract interpretation.

    Thread Safety

    This class is thread-safe. However, to make it possible to use one abstract interpreter instance for the concurrent abstract interpretation of independent methods, the AITracer (if any) has to be thread-safe too.

    Hence, it is possible to use a single instance to analyze multiple methods in parallel. However, if you want to be able to selectively abort the abstract interpretation of some methods or want to selectively trace the interpretation of some methods, then you should use multiple abstract interpreter instances. Creating new instances is usually extremely cheap as this class does not have any significant associated state.

    Subclasses are not required to be thread-safe and may have more complex state.

    Note

    Useless Joins Avoidance

    OPAL tries to minimize unnecessary joins by using the results of a naive live variables analysis (limited to the registers only!). This analysis helps to prevent unnecessary joins and also helps to reduce the overall number of processing steps. E.g., in the following case the swallowed exceptions that may occur whenever transformIt is called, would lead to an unnecessary join though the exception is not required!

    if (enc != null) {
      try {
        return transformIt(transformIt(enc));
      } catch (RuntimeException re) {}
    }
    return "";

    This analysis leads to an overall reduction in the number of evaluated instruction of about 4,5%. Additionally, it also reduces the effort spent on "expensive" joins which leads to an overall(!) improvement for the l1.DefaultDomain of ~8,5%.

    Dead Variables Elimination based on Definitive Paths

    (STILL IN DESIGN!!!!)

    Idea

    Given an instruction i which may result in a fork of the control-flow (e.g., a conditional branch or an invoke instruction that may throw a catched exception). If the (frist) evaluation of i definitively rules out several possible paths and - on all paths that are taken - some values are dead, but live on some of the other paths, then the respectively current values will never be propagated to the remaining paths, even if the remaining paths are eventually taken! This helps in variety of cases such as, e.g.,

    var s : Object = null
    for{/* it can statically be determined that this path is taken at least once!*/} {
        s = "something else"
    }
    doIt(s); // here, "s" is guaranteed not to reference the orignal value "null"!
    Implementation

    When we have a fork, check if all paths...

    Customizing the Abstract Interpretation Framework

    Customization of the abstract interpreter is done by creating new subclasses that override the relevant methods (in particular: AI#isInterrupted and AI#tracer).

    ,

    OPAL does not make assumptions about the number of domain objects that are used. However, if a single domain object is used by multiple instances of this class and the abstract interpretations are executed concurrently, then the domain has to be thread-safe. The latter is trivially the case when the domain object itself does not have any state; however, most domain objects have some state.

  2. sealed abstract class AIAborted extends AIResult

    Encapsulates the intermediate result of an aborted abstract interpretation of a method.

  3. sealed abstract class AICompleted extends AIResult

    Encapsulates the final result of the successful abstract interpretation of a method.

  4. class AIException extends RuntimeException

    A general, non-recoverable exception occurred during the abstract interpretation of a method.

  5. sealed abstract class AIResult extends AnyRef

    Encapsulates the result of the abstract interpretation of a method.

    Encapsulates the result of the abstract interpretation of a method. If the abstract interpretation was cancelled, the result encapsulates the current state of the evaluation which can be used to continue the abstract interpretation later on if necessary/desired.

  6. trait AITracer extends AnyRef

    Defines the interface between the abstract interpreter and a module for tracing and debugging the interpreter's progress.

    Defines the interface between the abstract interpreter and a module for tracing and debugging the interpreter's progress. In general, a tracer is first registered with an abstract interpreter. After that, when a method is analyzed, the AI calls the tracer's methods at the respective points in time.

    A tracer is registered with an abstract interpreter by creating a new subclass of AI and overriding the method AI.tracer.

    Note

    All data structures passed to the tracer are the original data structures used by the abstract interpreter. Hence, if a value is mutated (e.g., for debugging purposes) it has to be guaranteed that the state remains meaningful. Hence, using the AITracer it is possible to develop a debugger for OPAL and to enable the user to perform certain mutations.

  7. type ALocalsArray[T >: Null <: DomainValue] = Array[Locals[T]]
  8. type AnOperandsArray[T >: Null <: DomainValue] = Array[Operands[T]]
  9. class BaseAI extends AI[Domain]

    A base abstract interpreter that can be used with any domain that has no special requirements on the abstract interpreter.

    A base abstract interpreter that can be used with any domain that has no special requirements on the abstract interpreter. The base interpreter can be interrupted by calling the interrupt method of the AI's thread.

    See also

    BoundedInterruptableAI for an abstract interpreter that can easily be interrupted and which also interrupts itself if a certain threshold is exceeded.

  10. class BoundedInterruptableAI[D <: Domain] extends InstructionCountBoundedAI[D]

    An abstract interpreter that interrupts itself after the evaluation of the given number of instructions or if the callback function doInterrupt returns false or if the maximum allowed time is exceeded.

  11. sealed abstract class Computation[+V, +E] extends AnyRef

    Encapsulates the result of a computation in a domain.

    Encapsulates the result of a computation in a domain. In general, the result is either some value V or some exception(s) E. In some cases, however, when the domain cannot precisely determine the result, it may be both: some exceptional value(s) and a value.

    In the latter case the abstract interpreter will generally follow all possible paths. A computation that declares to return a result (i.e., the type V is not Nothing) must not return a result and/or throw an exception if the computation did not finish.

    Querying Computations

    Before accessing a computation's result (result or exceptions) it first has to be checked whether the computation returned normally (returnsNormally) or threw an exception (throwsException). Only if returnsNormally returns true the methods result and hasResult are defined.

    V

    The result of the computation. Typically a DomainValue; if the computation is executed for its side effect (e.g., as in case of a monitorenter or monitorexit instruction) the type of V maybe Nothing.

    E

    The exception(s) that maybe thrown by the computation. Typically, a DomainValue which represents a reference value with type java.lang.Throwable or a subtype thereof. If multiple exceptions may be thrown it may also be a set or Iterable of DomainValues (e.g., ExceptionValues).

    Note

    The precise requirements on the result of a computation are determined by the Domain object's methods that perform computations.

  12. final case class ComputationWithSideEffectOrException[+E](exceptions: E) extends Computation[Nothing, E] with Product with Serializable

    Encapsulates the result of a computation that returned normally (but which did not return some value) or that threw an exception/multiple exceptions.

  13. final case class ComputedValue[+V](result: V) extends Computation[V, Nothing] with Product with Serializable

    Encapsulates the result of a computation that returned normally and that did not throw an exception.

  14. final case class ComputedValueOrException[+V, +E](result: V, exceptions: E) extends Computation[V, E] with Product with Serializable

    Encapsulates the result of a computation that either returned normally or threw an exception.

  15. class ConfigurableXHTMLTracer extends XHTMLTracer
  16. trait Configuration extends AnyRef

    Centralizes all configuration options related to how a domain should handle situations in which the information about a value is (often) not completely available and which could lead to some kind of exception.

    Centralizes all configuration options related to how a domain should handle situations in which the information about a value is (often) not completely available and which could lead to some kind of exception.

    Basically all domains that perform some kind of abstraction should mix in this trait and query the respective method to decide if a respective exception should be thrown if it is possible that an exception may be thrown.

    Usage

    If you need to adapt a setting just override the respective method in your domain.

    In general, the org.opalj.ai.domain.ThrowAllPotentialExceptionsConfiguration should be used as a foundation as it generates all exceptions that may be thrown; however, configuring the behavior of method calls may be worth while.

  17. trait ConsoleEvaluationTracer extends AITracer

    A tracer that primarily prints out the evaluation order of the instructions on the console.

    A tracer that primarily prints out the evaluation order of the instructions on the console. This tracer is particularly useful to understand the handling of JSR/RET instructions.

    If you want to reuse this tracer to trace evaluations of different methods you should call the reset method between two calls.

    Thread Safety

    This tracer has internal state that is dependent on the state of the evaluation. Hence, this class is not thread safe and a new AI instance should be used per method that is analyzed.

  18. trait ConsoleTracer extends AITracer

    A tracer that prints out a trace's results on the console.

  19. trait CoreDomainFunctionality extends ValuesDomain with SubroutinesDomain

    Defines the core functionality that is shared across all Domains that implement the operations related to different kinds of values and instructions.

    Defines the core functionality that is shared across all Domains that implement the operations related to different kinds of values and instructions. It primarily defines the abstraction for DomainValues.

    Note

    This trait defines concrete methods that facilitate unit testing of partial domains that build on top of this CoreDomain such as the IntegerValuesDomain.

    See also

    Domain For an explanation of the underlying concepts and ideas.

  20. trait CorrelationalDomain extends Domain with CorrelationalDomainSupport

    A Domain that supports the tracking of correlations between values.

  21. trait CorrelationalDomainSupport extends JoinStabilization with IdentityBasedCorrelationChangeDetection

    Provides basic support for tracking the correlation between domain values stored in different registers/in different stack slots.

  22. class CountingAI[D <: Domain] extends InterruptableAI[D]

    An abstract interpreter that counts the number of instruction evaluations that are performed.

    An abstract interpreter that counts the number of instruction evaluations that are performed. This is particularly helpful to determine the effect of optimizations or the choice of the domain.

    Thread Safety

    This class is thread-safe. I.e., one instance can be used to run multiple abstract interpretations in parallel.

  23. trait CustomInitialization extends AnyRef

    Mixin this trait if a domain needs to perform some custom initialization.

    Mixin this trait if a domain needs to perform some custom initialization.

    Usage

    It is sufficient to mixin this trait in a Domain that needs custom initialization. The abstract interpreter will then perform the initialization.

    This information is set immediately before the abstract interpretation is started/continued. I.e., this makes it potentially possible to reuse a Domain object for the interpretation of multiple methods.

  24. trait Domain extends CoreDomainFunctionality with IntegerValuesDomain with LongValuesDomain with FloatValuesDomain with DoubleValuesDomain with ReferenceValuesDomain with FieldAccessesDomain with MethodCallsDomain with MonitorInstructionsDomain with ReturnInstructionsDomain with PrimitiveValuesConversionsDomain with TypedValuesFactory with Configuration

    A domain is the fundamental abstraction mechanism in OPAL that enables the customization of the abstract interpretation framework towards the needs of a specific analysis.

    A domain is the fundamental abstraction mechanism in OPAL that enables the customization of the abstract interpretation framework towards the needs of a specific analysis.

    A domain encodes the semantics of computations (e.g., the addition of two values) with respect to the domain's values (e.g., the representation of integer values). Customizing a domain is the fundamental mechanism of adapting the AI framework to one's needs.

    This trait defines the interface between the abstract interpretation framework and some (user defined) domain. I.e., this interface defines all methods that are needed by OPAL to perform an abstract interpretation.

    Control Flow

    OPAL controls the process of evaluating the code of a method, but requires a domain to perform the actual computations of an instruction's result. E.g., to calculate the result of adding two integer values, or to perform the comparison of two object instances, or to get the result of converting a long value to an int value, the framework always consults the domain.

    Handling of instructions that manipulate the stack (e.g. dup), that move values between the stack and the locals (e.g., Xload_Y) or that determine the control flow is, however, completely embedded into OPAL-AI.

    OPAL uses the following methods to inform a domain about the progress of the abstract interpretation:

    Implementing Abstract Domains

    While it is perfectly possible to implement a new domain by inheriting from this trait, it is recommended to first study the already implemented domains and to use them as a foundation. To facilitate the usage of OPAL several classes/traits that implement parts of this Domain trait are pre-defined and can be flexibly combined (mixed together) when needed.

    When you extend this trait or implement parts of it you should keep as many methods/ fields private to facilitate mix-in composition of multiple traits.

    Thread Safety

    When every analyzed method is associated with a unique Domain instance and – given that OPAL only uses one thread to analyze a given method at a time – no special care has to be taken. However, if a domain needs to consult another domain which is, e.g, associated with a project as a whole (e.g., to create a central store of values), it is then the responsibility of the domain to make sure that coordination with the world is thread safe.

    Note

    OPAL assumes that – at least conceptually – every method/code block is associated with its own instance of a domain object.

  25. case class DomainException(message: String) extends AIException with Product with Serializable

    An exception related to a computation in a specific domain occurred.

    An exception related to a computation in a specific domain occurred. This exception is intended to be used if the exception occurred inside the Domain.

  26. trait DoubleValuesDomain extends DoubleValuesFactory

    Defines the public interface between the abstract interpreter and the domain that implements the functionality related to the handling of double values.

  27. trait DoubleValuesFactory extends ValuesDomain

    Defines the primary factory methods for Double values.

  28. case class ExceptionUsage(method: Method, definitionSite: PC, exceptionType: String, usageInformation: Set[UsageKind.Value]) extends Ordered[ExceptionUsage] with Product with Serializable
  29. class ExceptionUsageAnalysisDomain extends CorrelationalDomain with DefaultDomainValueBinding with TypeLevelPrimitiveValuesConversions with DefaultTypeLevelFloatValues with DefaultTypeLevelDoubleValues with DefaultTypeLevelLongValues with TypeLevelLongValuesShiftOperators with DefaultTypeLevelIntegerValues with TypeLevelFieldAccessInstructions with TypeLevelInvokeInstructions with DefaultReferenceValuesBinding with DefaultHandlingOfMethodResults with IgnoreSynchronization with TheProject with TheMethod
  30. trait ExceptionsFactory extends ValuesDomain

    Defines factory methods for those exceptions that are (also) created by the JVM when the evaluation of a specific bytecode instruction fails (e.g., idiv, checkcast, monitorexit, return...).

  31. type ExceptionsRaisedByCalledMethod = ai.ExceptionsRaisedByCalledMethods.Value
  32. trait FieldAccessesDomain extends AnyRef

    Interface related to the handling of field access instructions.

  33. trait FloatValuesDomain extends FloatValuesFactory

    Defines the public interface between the abstract interpreter and the domain that implements the functionality related to the handling of float values.

  34. trait FloatValuesFactory extends ValuesDomain

    Defines factory methods to create concrete representations of constant float values.

  35. case class FlowEntity(pc: PC, instruction: Instruction, operands: Operands[_ >: Null <: Domain.DomainValue], locals: Locals[_ >: Null <: Domain.DomainValue], properties: Option[String]) extends Product with Serializable
  36. trait GlobalLogContextProvider extends LogContextProvider
  37. trait IdentityBasedCorrelationChangeDetection extends CoreDomainFunctionality

    Identifies situations (based on a reference comparison of the domain values) in which the memory layout changes such that a correlation between two values, which existed before a join was performed, no longer exists.

    Identifies situations (based on a reference comparison of the domain values) in which the memory layout changes such that a correlation between two values, which existed before a join was performed, no longer exists. In this case the UpdateType is lifted from MetaInformationUpdate to StructuralUpdateType. For example, imagine that the old stack layout (before the join was executed) is as follows:

    AnIntegerValue[#1] <- AnIntegerValue[#1] <- IntegerRange(lb=0,ub=10)[#2] <- ...

    and that the stack after the join is:

    AnIntegerValue[#2] <- AnIntegerValue[#3] <- IntegerRange(lb=0,ub=10)[#2] <- ...

    Hence, the two top-most stack values are now different values and – if the result of an analysis/domain is influenced by correlation information – the continuation of the abstract interpretation is enforced.

    Concrete Example

    static void cfDependentValues(int i) {
     Object b = null;
     Object c = null;
     int j = i; // <--- j is just an alias for i
     while (j < 2) {
         Object a = maybeNull(); // returns "null" or a new instance of Object
         if (i == 1)
             b = a; // <--- b is just an alias for a
         else
             c = a; // <--- c is just an alias for a
         i++;
         j = i;
     }
     // b and c are never referring to the same object; hence a constraint related to
     // c does not affect b and vice versa
     if (c == null) { // this just constraints "c" (not "b")
         doIt(b); // we know nothing special about b
         doIt(c); // c is null
     } else if (b != null) {
         doIt(b); // b is non-null
         doIt(c); // we know nothing special  about c
     }
    }

    This trait requires that updates to a value that do not influence the represented value as such, but which may influence its correlation information, have to create a MetaInformationUpdate. Here, correlation means:

    • two reference values that refer to the same object are considered aliases
    • two local variables that are guaranteed to be identical in all cases, and, hence are subject to the same constraints are also correlated.
    Note

    Mixing in this trait is strictly necessary when aliases are traced using a DomainValue's reference.

  38. case class InfiniteRecursion(method: Method, operands: Chain[_ <: AnyRef]) extends Product with Serializable
  39. class InfiniteRecursionsDomain extends Domain with DefaultDomainValueBinding with ThrowAllPotentialExceptionsConfiguration with DefaultTypeLevelFloatValues with DefaultTypeLevelDoubleValues with TypeLevelFieldAccessInstructions with TypeLevelInvokeInstructions with DefaultReferenceValuesBinding with DefaultIntegerRangeValues with MaxArrayLengthRefinement with DefaultLongSetValues with LongSetValuesShiftOperators with ConcretePrimitiveValuesConversions with DefaultHandlingOfMethodResults with IgnoreSynchronization with TheProject with TheMethod
  40. class InstructionCountBoundedAI[D <: Domain] extends AI[D]

    An abstract interpreter that interrupts itself after the evaluation of the given number of instructions.

    An abstract interpreter that interrupts itself after the evaluation of the given number of instructions.

    Thread Safety

    This class is thread-safe. I.e., one instance of the InstructionCountBoundedAI can be used to run multiple abstract interpretations in parallel and to ensure that they terminate (as a whole) if the threshold is exceeded.

  41. trait IntegerRangeValuesFactory extends IntegerValuesFactory

    Defines a factory method to create IntegerRange values.

  42. trait IntegerValuesDomain extends IntegerValuesFactory

    Defines the public interface between the abstract interpreter and the domain that implements the functionality related to the handling of integer values.

  43. trait IntegerValuesFactory extends ValuesDomain

    Defines the primary factory methods to create Integer values.

  44. sealed trait InterpretationFailedException extends AnyRef

    Exception that is thrown by the abstract interpreter when the abstract interpretation of a method's implementation failed.

    Exception that is thrown by the abstract interpreter when the abstract interpretation of a method's implementation failed.

    To create an instance use the companion object InterpretationFailedException$.

  45. class InterruptableAI[D <: Domain] extends AI[D]

    An abstract interpreter that can be interrupted by calling the AI's interrupt method or by calling the executing thread's interrupt method.

  46. trait IsBooleanValue[DomainBooleanValue <: AnyRef] extends IsPrimitiveValue[BooleanType, DomainBooleanValue]
  47. trait IsByteValue[DomainByteValue <: AnyRef] extends IsPrimitiveValue[ByteType, DomainByteValue]
  48. trait IsCharValue[DomainCharValue <: AnyRef] extends IsPrimitiveValue[CharType, DomainCharValue]
  49. trait IsDoubleValue[DomainDoubleValue <: AnyRef] extends IsPrimitiveValue[DoubleType, DomainDoubleValue]
  50. trait IsFloatValue[DomainFloatValue <: AnyRef] extends IsPrimitiveValue[FloatType, DomainFloatValue]
  51. trait IsIntegerValue[DomainIntegerValue <: AnyRef] extends IsPrimitiveValue[IntegerType, DomainIntegerValue]
  52. trait IsLongValue[DomainLongValue <: AnyRef] extends IsPrimitiveValue[LongType, DomainLongValue]
  53. sealed trait IsPrimitiveValue[T <: BaseType, DomainPrimitiveValue <: AnyRef] extends KnownType

    The value has the primitive type.

  54. trait IsReferenceValue[DomainReferenceValue <: AnyRef] extends KnownType

    Characterizes a reference value.

    Characterizes a reference value. Captures the information about the values a domain value may refer to. For example, in the following:

    val o = If(...) new Object() else "STRING"

    o is a reference value (IsReferenceValue) that (may) refers to two "simple" base values: new Object() and "STRING"; however, it is a decision of the the underlying domain whether the information about the base values is made available or not. Furthermore, if the base values are actually used, the constraints in effect for the overall abstraction should be considered to get the most precise result.

  55. trait IsShortValue[DomainShortValue <: AnyRef] extends IsPrimitiveValue[ShortType, DomainShortValue]
  56. trait JoinStabilization extends CoreDomainFunctionality

    Ensures that the same DomainValue is used whenever we merge the same pair of domain values.

    Ensures that the same DomainValue is used whenever we merge the same pair of domain values. This ensures that the relation between the values remains the same.

    For example, given the following two stacks:

    • AnIntegerValue[#1] <- AnIntegerValue[#1] <- IntRange(lb=0,ub=10)[#2] <- ...
    • AnIntegerValue[#3] <- AnIntegerValue[#3] <- IntRange(lb=0,ub=10)[#2] <- ...

    The result will be (assuming that the result of joining AnIntegerValue[#1] with AnIntegerValue[#3] creates a new value, e.g., AnIntegerValue[#4]):

    • AnIntegerValue[#4] <- AnIntegerValue[#4] <- IntRange(lb=0,ub=10)[#2] <- ...

    Without this trait each pair of values is joined again. In this case the result would be:

    • AnIntegerValue[#4] <- AnIntegerValue[#5] <- IntRange(lb=0,ub=10)[#2] <- ...

    Using join stabilization is necessary if constraints are propagated or (makes sense) if the merge of domain values is expensive.

    Note

    Join stabilization is always done for all domain values once this trait is mixed in.

  57. trait KnownType extends TypeInformation
  58. type Locals[T >: Null <: DomainValue] = collection.mutable.Locals[T]
  59. trait LogContextProvider extends AnyRef

    Provides log context information.

  60. trait LongValuesDomain extends LongValuesFactory

    Defines the public interface between the abstract interpreter and the domain that implements the functionality related to the handling of long values.

  61. trait LongValuesFactory extends ValuesDomain

    Defines the primary factory methods to create long values.

  62. final case class MetaInformationUpdate[V](value: V) extends SomeUpdate[V] with Product with Serializable

    Characterizes an update that did not affect the abstract state but instead just updated some meta information.

    Characterizes an update that did not affect the abstract state but instead just updated some meta information.

    In general, the abstract interpretation framework handles NoUpdates and MetaInformationUpdates in the same way.

    Example

    If two values are merged that are seen on two different paths, but which represent the same abstract value, we may want to update the meta-information about the origin of the current value, but this information may not be part of the abstract state and hence, is not relevant for the abstract interpreter. In this case the interpreter will not reschedule subsequent instructions. However, whether or not the information about the origin of a value is considered to be part of the abstract state is a decision of the domain.

  63. sealed trait MetaInformationUpdateType extends UpdateType
  64. trait MethodCallsDomain extends AnyRef

    Defines all methods related to the invocation of other methods.

  65. trait MonitorInstructionsDomain extends AnyRef

    Domain that defines all methods related to monitor instructions.

  66. class MultiTracer extends AITracer

    A tracer that forwards every call to all registered tracers.

  67. case class NativeCallWithBoundedMethodParameter(project: SomeProject, nativeMethod: Method, parameterIndex: Int, caller: Method, callSite: PC, lowerBound: Int, upperBound: Int) extends Product with Serializable
  68. type Operands[T >: Null <: DomainValue] = Chain[T]
  69. type PC = Int
  70. type PCs = IntArraySet
  71. trait PrimitiveValuesConversionsDomain extends AnyRef

    Defines the methods that performs type conversions between primitive values with different computational types.

  72. type PrimitiveValuesFactory = IntegerValuesFactory with LongValuesFactory with FloatValuesFactory with DoubleValuesFactory
  73. trait ReferenceValuesDomain extends ReferenceValuesFactory

    Domain that defines all methods that perform computations related to RefernceValues.

  74. trait ReferenceValuesFactory extends ExceptionsFactory

    Definition of factory methods to create ReferenceValues.

  75. case class RefinedReturnType[D <: Domain](project: SomeProject, method: Method, refinedType: Option[D.DomainValue]) extends Product with Serializable
  76. trait ReturnInstructionsDomain extends AnyRef

    Defines the methods that lead to a return from a method.

    Defines the methods that lead to a return from a method. In general, a return instruction can throw an IllegalMonitorStateException. If, e.g., the method is synchronized and the method body contains a Monitorexit instruction, but no Monitorenter instruction.

  77. type SomeAI[D <: Domain] = AI[_ >: D]

    Type alias that can be used if the AI can use all kinds of domains.

    Type alias that can be used if the AI can use all kinds of domains.

    Note

    This type alias serves comprehension purposes only.

  78. sealed abstract class SomeUpdate[V] extends Update[V]

    Identifies updates where something was updated without further qualifying the update.

    Identifies updates where something was updated without further qualifying the update.

    Usage

    This class (and its companion object) are primarily used for pattern matching purposes.

  79. final case class StructuralUpdate[V](value: V) extends SomeUpdate[V] with Product with Serializable

    Characterizes updates where the abstract state was updated such that it is required to continue the abstract interpretation.

  80. trait SubroutinesDomain extends AnyRef

    Enables specialized processing of subroutine calls by domains; this is generally only relevant for those domains that record the control-flow graph.

  81. type TargetDomain = ValuesDomain with ValuesFactory
  82. trait TheAI[D <: Domain] extends AnyRef

    Makes the instance of the abstract interpreter that performs the abstract interpretation available to the domain.

    Makes the instance of the abstract interpreter that performs the abstract interpretation available to the domain.

    Usage

    It is sufficient to mixin this trait in a Domain that needs to access the abstract interpreter. The abstract interpreter will then perform the initialization.

    The concrete instance of AI that performs the abstract interpretation is set immediately before the abstract interpretation is started/continued.

  83. trait TheClassHierarchy extends AnyRef

    Makes a project's class hierarchy available to a Domain.

    Makes a project's class hierarchy available to a Domain.

    Implements a Domain's isSubtypeOf(...) by delegating to the corresponding method defined in org.opalj.br.ClassHierarchy.

  84. trait TheCodeStructure extends AnyRef

    Mixin this trait if the domain needs information about the structure of the code.

    Mixin this trait if the domain needs information about the structure of the code.

    Usage

    It is sufficient to mixin this trait in a Domain that needs to get access to the code array. The abstract interpreter will then perform the initialization.

    This information is set immediately before the abstract interpretation is started/continued.

  85. type TheLocalsArray[T >: Null <: ai.TheLocalsArray.T.d.type.Locals forSome {val d: ValuesDomain}] = Array[T]
  86. trait TheMemoryLayout extends AnyRef

    Mixin this trait if a domain needs access to the operands (Domain#OperandsArray) and/or locals (Domain#LocalsArray).

    Mixin this trait if a domain needs access to the operands (Domain#OperandsArray) and/or locals (Domain#LocalsArray).

    Usage

    It is sufficient to mixin this trait in a Domain that needs to get access to the memory structures. The abstract interpreter will then perform the initialization.

    This information is set immediately before the abstract interpretation is started/continued.

  87. type TheOperandsArray[T >: Null <: ai.TheOperandsArray.T.d.type.Operands forSome {val d: ValuesDomain}] = Array[T]
  88. final case class ThrowsException[+E](exceptions: E) extends Computation[Nothing, E] with Product with Serializable

    Encapsulates the result of a computation that threw an exception.

  89. class TimeBoundedAI[D <: Domain] extends AI[D]

    An abstract interpreter that interrupts itself after some configurable (maxEffort) time has passed.

  90. sealed trait TypeInformation extends AnyRef

    Encapsulates the available type information about a DomainValue.

  91. trait TypedValuesFactory extends AnyRef

    Defines additional, generally useful factory methods to create DomainValues.

  92. sealed abstract class Update[+V] extends AnyRef

    Encapsulates an updated value and qualifies the type of the update.

    Encapsulates an updated value and qualifies the type of the update.

    In general OPAL distinguishes between updates to a value that are relevant w.r.t. the abstract interpretation and those updates that just update some meta-information and which do not affect the abstract interpretation and – in particular – do not force the framework to continue the abstract interpretation.

  93. sealed abstract class UpdateType extends AnyRef

    Specifies the type of an update.

    Specifies the type of an update. The type hierarchies of Update and UpdateType are aligned and it is possible to conveniently switch between them. Contrary to an Update object an UpdateType object never has any payload, it just characterizes an update. However, by passing a value to an UpdateType the UpdateType is turned into a corresponding org.opalj.ai.Update object.

    Example

    val updateType : UpdateType = ...
    val update : Update = updateType(<someValue>)
  94. case class UselessComputation(method: Method, pc: PC, message: String) extends Product with Serializable
  95. type ValueOrigin = Int

    A ValueOrigin identifies the origin of a value within a method.

    A ValueOrigin identifies the origin of a value within a method. In most cases the origin is equal to the program counter of the instruction that created the value. However, several negative values do have special semantics which are explained in the following.

    Parameter Identification

    In general, parameters are identified by using negative origin information as described below. But, given that

    • the maximum size of the method parameters array is 255 and
    • that the first slot is required for the this reference in case of instance methods and
    • that long and double values* require two slots the smallest number used to encode that the value is an actual parameter is -256.
    AI Framework

    In case of the ai framework, values passed to a method get indexes as follows: -1-(isStatic ? 0 : 1)-(the index of the parameter adjusted by the computational type of the previous parameters).

    For example, in case of an instance method with the signature:

    public void (double d/*parameter index:0*/, Object o/*parameter index:1*/){...}
    • The value -1 is used to identify the implicit this reference.
    • The value -2 identifies the value of the parameter d.
    • The value -4 identifies the parameter o. (The parameter d is a value of computational-type category 2 and needs two stack/operands values.)
    Three-address Code

    In case of the three address code the parameters are normalized (see org.opalj.tac.TACAI for further details).

    Subroutines JSR/RET

    Some special values are used when methods have subroutines: (SUBROUTINE_START, SUBROUTINE_END, SUBROUTINE). These methods, never show up at the def-use or cfg level, but will show up in the evaluation trace.

    Implicit JVM Constants

    The value -333 is used to encode that the value is an implicit constant (ConstantValueOrigin). This value is used for the implicit value of IF_XXX instructions to facilitates a generalized handling of ifs.

    Values in the range [ SpecialValuesOriginOffset (-10,000,000) , VMLevelValuesOriginOffset (-100,000) ] are used to identify values that are created outside of the method, but due to the evaluation of the instruction with the pc = -origin-100,000 (in particular exceptions).

    See also

    isVMLevelValue, ValueOriginForVMLevelValue, pcOfVMLevelValue

  96. trait ValuesDomain extends AnyRef

    Defines the concept of a value in a Domain.

    Defines the concept of a value in a Domain.

    See also

    Domain For an explanation of the underlying concepts and ideas.

  97. type ValuesFactory = PrimitiveValuesFactory with ReferenceValuesFactory with ExceptionsFactory with TypedValuesFactory
  98. trait XHTMLTracer extends AITracer

    A tracer that generates an HTML document.

Value Members

  1. val BaseConfig: Config
  2. final val ConstantValueOrigin: Int(-333)

    Used to identify that the origin of the value is outside of the program.

    Used to identify that the origin of the value is outside of the program.

    For example, the VM sometimes performs comparisons against predetermined fixed values (specified in the JVM Spec.). The origin associated with such values is determined by this value.

  3. final val FrameworkName: String("OPAL Abstract Interpretation Framework")
  4. final def NoPCs: EmptyIntArraySet.type
  5. final val SUBROUTINE: Int(-90000009)

    Special value that is added to the work list to mark the beginning of a subroutine call.

  6. final val SUBROUTINE_END: Int(-88888888)

    Special value ("pc") that is added to the list of evaluated instructions to mark the end of the evaluation of a subroutine.

  7. final val SUBROUTINE_INFORMATION_BLOCK_SEPARATOR_BOUND: Int(-80000000)

    A special value that is larger than all other values used to mark boundaries and information related to the handling of subroutines and which is smaller that all other regular values.

  8. final val SUBROUTINE_RETURN_ADDRESS_LOCAL_VARIABLE: Int(-88880008)
  9. final val SUBROUTINE_RETURN_TO_TARGET: Int(-80008888)
  10. final val SUBROUTINE_START: Int(-80000008)

    Special value ("pc") that is added to the work list/list of evaluated instructions before the program counter of the first instruction of a subroutine.

    Special value ("pc") that is added to the work list/list of evaluated instructions before the program counter of the first instruction of a subroutine.

    The marker SUBROUTINE is used to mark the place in the worklist where we start having information about subroutines.

  11. final val SpecialValuesOriginOffset: Int(-10000000)

    Identifies the upper bound for those "origin values" that encode special information; that is, subroutine boundaries.

  12. final val VMLevelValuesOriginOffset: Int(-100000)

    Identifies the upper bound for those origin values that encode origin information about VM level values (that is, VM generated exceptions).

  13. final def ValueOriginForVMLevelValue(pc: PC): ValueOrigin

    Creates the origin information for a value (typically an exception) that was (implicitly) created while evaluating the instruction with the given program counter (pc).

    Creates the origin information for a value (typically an exception) that was (implicitly) created while evaluating the instruction with the given program counter (pc).

    See also

    pcOfVMLevelValue for further information.

  14. def collectPCWithOperands[B](domain: ValuesDomain)(code: Code, operandsArray: OperandsArray)(f: PartialFunction[(PC, Instruction, ai.ValuesDomain.Operands), B]): Seq[B]

    Collects the result of a match of a partial function against an instruction's operands.

  15. def foreachPCWithOperands[U](domain: ValuesDomain)(code: Code, operandsArray: OperandsArray)(f: (PC, Instruction, ai.ValuesDomain.Operands) ⇒ U): Unit
  16. final def isVMLevelValue(origin: ValueOrigin): Boolean

    Returns true if the value with the given origin was (implicitly) created by the JVM while executing an instruction with the program counter pcOfVMLevelValue(origin).

    Returns true if the value with the given origin was (implicitly) created by the JVM while executing an instruction with the program counter pcOfVMLevelValue(origin).

    See also

    ValueOriginForVMLevelValue for further information.

  17. def mapOperands(theOperands: Operands[_ <: DomainValue], targetDomain: ValuesDomain with ValuesFactory): Array[(targetDomain)#DomainValue]

    Maps the operands to the target domain while ensuring that two operands that are identical before are identical afterwards.

  18. def mapOperandsToParameters(operands: Operands[_ <: DomainValue], calledMethod: Method, targetDomain: ValuesDomain with ValuesFactory): Locals[(targetDomain)#DomainValue]

    Maps a list of operands (e.g., as passed to the invokeXYZ instructions) to the list of parameters for the given method.

    Maps a list of operands (e.g., as passed to the invokeXYZ instructions) to the list of parameters for the given method. The parameters are stored in the local variables (Locals)/registers of the method; i.e., this method creates an initial assignment for the local variables that can directly be used to pass them to AI's perform(...)(<initialOperands = Nil>,initialLocals) method.

    operands

    The list of operands used to call the given method. The length of the list must be:

    calledMethod.descriptor.parametersCount + { if (calledMethod.isStatic) 0 else 1 }

    . I.e., the list of operands must contain one value per parameter and –  in case of instance methods – the receiver object. The list must not contain additional values. The latter is automatically ensured if this method is called (in)directly by AI and the operands were just passed through. If two or more operands are (reference) identical then the adaptation will only be performed once and the adapted value will be reused; this ensures that the relation between values remains stable.

    calledMethod

    The method that will be evaluated using the given operands.

    targetDomain

    The Domain that will be use to perform the abstract interpretation.

  19. def memoryLayoutToText(domain: Domain)(operandsArray: ai.Domain.OperandsArray, localsArray: ai.Domain.LocalsArray): String

    Creates a human-readable textual representation of the current memory layout.

  20. def parameterIndexToValueOrigin(isStatic: Boolean, descriptor: MethodDescriptor, parameterIndex: Int): ValueOrigin

    Calculates the initial ValueOrigin associated with a method's explicit parameter.

    Calculates the initial ValueOrigin associated with a method's explicit parameter. The index of the first parameter is 0. If the method is not static the this reference stored in local variable 0 has the origin -1.

    isStatic

    true if method is static and, hence, has no implicit parameter for this.

    See also

    mapOperandsToParameters

  21. def parameterVariables(aiResult: AIResult)(isStatic: Boolean, descriptor: MethodDescriptor): Array[ai.Domain.DomainValue]

    Extracts the domain variables (register values) related to the method's parameters; see org.opalj.tac.Parameters for the detailed layout of the returned array.

    Extracts the domain variables (register values) related to the method's parameters; see org.opalj.tac.Parameters for the detailed layout of the returned array.

    Recall that at the bytecode level long and double values use two register values. The returned array will, however, abstract over the difference between so-called computational type category I and II values. Furthermore, the explicitly specified parameters are always stored in the indexes [1..parametersCount] to enable unifor access to a method's parameters whether the method is static or not. Furthermore, the returned array will contain the self reference (this) at index 0 if the method is an instance method; otherwise index 0 will be null.

    isStatic

    true if the method is static (we have no this reference).

    descriptor

    The method descriptor.

    returns

    The local variables which represent the parameters. The size of the returned array is the sum of the operand sizes of the parameters + 1 if the method is an instance method. (@see parameterIndexToValueOrigin and mapOperandsToParameters for further details.)

    Note

    If a parameter (variable) is used as a variable and updated, then the returned domain value will reflect this behavior. For example, given the following code:

    // Given: class X extends Object
    foo(X x) { do { x = new Y(); System.out.println(x) } while(true;)}

    The type of the domain value will be (as expected) x; however - depending on the domain - it may contain the information that x may also reference the created object Y.

  22. def parameterVariablesIterator(aiResult: AIResult)(isStatic: Boolean, descriptor: MethodDescriptor): Iterator[ai.Domain.DomainValue]

    Iterates over all im-/explicit parameter related variables.

    Iterates over all im-/explicit parameter related variables.

    isStatic

    Has to be true iff the method for which the abstract interpretation was performed is static.

  23. final def pcOfVMLevelValue(origin: ValueOrigin): PC

    Returns the program counter (pc) of the instruction that (implicitly) led to the creation of the (method external) value (typically an Exception).

    Returns the program counter (pc) of the instruction that (implicitly) led to the creation of the (method external) value (typically an Exception).

    See also

    ValueOriginForVMLevelValue for further information.

  24. object AICompleted
  25. object AIResultBuilder

    Factory to create AIResult objects.

    Factory to create AIResult objects. Primarily used to return the result of an abstract interpretation of a method.

  26. object BaseAI extends BaseAI

    Instance of the base abstract interpreter.

  27. object BaseReferenceValues

    Defines an extractor method for instances of IsReferenceValue objects.

    Defines an extractor method for instances of IsReferenceValue objects.

    Note

    To ensure that the generic type can be matched, it may be necessary to first cast a generic org.opalj.ai.ValuesDomain.DomainValue to a org.opalj.ai.ValuesDomain.DomainReferenceValue.

    val d : Domain = ...
    val d.DomainReferenceValue(v) = /*some domain value; e.g., operands.head*/
    val BaseReferenceValues(values) = v
    values...
  28. object CTC1

    Facilitates matching against values of computational type category 1.

    Facilitates matching against values of computational type category 1.

    Example:
    1. case v @ CTC1() => ...
  29. object CTC2

    Facilitates matching against values of computational type category 2.

    Facilitates matching against values of computational type category 2.

    Example:
    1. case v @ CTC2() => ...
  30. object CallGraphDiff extends DefaultOneStepAnalysis

    Calculates and compares the results of two call graphs.

  31. object CallsOfNativeMethodsWithBoundedValues extends DefaultOneStepAnalysis

    Demonstrates how to identify if an integer value that is passed to a native method is always bounded.

  32. object CipherGetInstanceStringUsage extends DefaultOneStepAnalysis

    The analysis demonstrates how to find values passed to Chipher.getInstance:

    The analysis demonstrates how to find values passed to Chipher.getInstance:

    static Chipher getInstance(String transformation)
    static Cipher  getInstance(String transformation, Provider provider)
    static Cipher  getInstance(String transformation, String provider)
  33. object ComputationFailed extends Computation[Nothing, Nothing] with Product with Serializable

    Indicates that the computation did not succeed.

    Indicates that the computation did not succeed. This is typically the case for methods that contain an endless loop, such as:

    while(true){.../* no break statements */}
  34. object ComputationWithException
  35. object ComputationWithResult
  36. object ComputationWithResultAndException
  37. object ComputationWithSideEffectOnly extends Computation[Nothing, Nothing] with Product with Serializable

    Represents a computation that completed normally.

  38. object ExceptionUsage extends DefaultOneStepAnalysis with Serializable

    Analyses the usage of exceptions in a program.

  39. object ExceptionsRaisedByCalledMethods extends Enumeration with Product with Serializable

    Enumeration of how method calls are treated when the set of exceptions thrown by the target method is not completely known.

  40. object GetCallees

    Prints out information about the callees of a specific method.

  41. object InfiniteRecursions extends DefaultOneStepAnalysis

    An analysis that finds self-recursive calls with unchanged parameters.

  42. object InstructionCountBoundedAI

    Defines common helper methods.

  43. object InterpretMethod

    A small basic framework that facilitates the abstract interpretation of a specific method using a configurable domain.

  44. object InterpretationFailedException

    Factory for InterpretationFailedExceptions.

  45. object IsNullValue

    Defines and extractor for the null-property of reference values.

  46. object IsPrimitiveValue
  47. object MetaInformationUpdateType extends UpdateType with MetaInformationUpdateType with Product with Serializable
  48. object MethodCallInformation extends DefaultOneStepAnalysis

    Analyzes the parameters of called methods to determine if we have more precise type information for one of the parameters.

  49. object MethodReturnValuesAnalysis extends DefaultOneStepAnalysis

    A shallow analysis that tries to refine the return types of methods.

  50. object MethodsThatAlwaysReturnAPassedParameter extends DefaultOneStepAnalysis

    A very small analysis that identifies those methods that always return a value that was passed as a parameter to the method; the self reference this is also treated as a(n implicit) parameter.

  51. object NoUpdate extends Update[Nothing] with Product with Serializable

    Indicates that the (given) structure was not updated.

    Indicates that the (given) structure was not updated.

    Note

    The abstract interpretation framework itself does not distinguish between a NoUpdate and a MetaInformationUpdate; the abstract interpretation will not be continued in both cases.

  52. object NoUpdateType extends UpdateType with Product with Serializable
  53. object RefineableNativeMethods extends DefaultOneStepAnalysis

  54. object SomeUpdate

    Facilitates matching against updates that actually encapsulate an updated value.

  55. object StructuralUpdateType extends UpdateType with Product with Serializable
  56. object TypeOfReferenceValue

    Extractor for reference values.

  57. object UnknownType extends TypeInformation with Product with Serializable

    Specifies that no type information is available.

    Specifies that no type information is available.

    Note

    Recall that the computational type of a value always has to be available, but that a ValuesDomain.typeOfValue(...) query does not need to take the computational type into account. (Whenever the core framework requires the computational type of a value it uses the respective method.) However, in case that the underlying value may be an array or exception value the reported type must not be TypeUnknown.

  58. object UnusedMethods extends DefaultOneStepAnalysis

    A shallow analysis that tries to identify ((package) private) methods that are dead.

  59. object UsageKind extends Enumeration
  60. object UselessComputations extends DefaultOneStepAnalysis

    A shallow analysis that identifies useless computations.

  61. object UselessComputationsMinimal extends DefaultOneStepAnalysis

    A shallow analysis that tries to identify useless computations; here, "ifs" where the condition is constant.

Inherited from AnyRef

Inherited from Any

Ungrouped