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 implementing lattice based static analyses (Static Analysis Infrastructure)
    • 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 (Bytecode Assembler).

    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.

    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 collection

    OPAL's collection library is primarily designed with high performance in mind.

    Design Goals

    OPAL's collection library is primarily designed with high performance in mind. I.e., all methods provided by the collection library are reasonably optimized. However, providing a very large number of methods is a non-goal. Overall, OPAL's collection library provides:

    • collection classes that are manually specialized for primitive data-types.
    • collection classes that are optimized for particularly small collections of values.
    • collection classes that target special use cases such as using a collection as a workset/worklist.
    • collection classes that offer special methods that minimize the number of steps when compared to general purpose methods.

    Integration With Scala's Collection Library

    Hence, OPAL's collection library complements Scala's default collection library and is not intended to replace it. Integration with Scala's collection library is primarily provided by means of iterators (OPAL's Iterators inherit from Scala's Iterators). Furthermore the companion object of each of OPAL's collection classes generally provides factory methods that facilitate the conversion from Scala collection classes to OPAL collection classes.

    Status

    The collection library is growing. Nevertheless, the existing classes are production ready.

    Definition Classes
    opalj
  • package mutable
    Definition Classes
    collection
  • ArrayMap
  • FixedSizeBitSet
  • FixedSizedHashIDMap
  • IntArrayStack
  • IntQueue
  • Locals
  • RefAccumulator

sealed trait Locals[T >: Null <: AnyRef] extends AnyRef

THIS DATASTRUCTURE IS ONLY INTENDED TO BE USED BY THE AI FRAMEWORK, DON'T USE IT OTHERWISE.

Conceptually, an array that enables random access and which is heavily optimized for small(er) collections (up to 12 elements) that are frequently compared and updated and where sharing is beneficial.

A Locals array contains null values for all elements that are not yet set. Furthermore, a Locals array is not resizable and – if used in development mode – minimizes checks whenever possible. I.e., the user is expected to correctly use this data structure.

Usage Scenario

For example, the median of the number of registers that are used per method is 2 (JDK and OPAL) and more then 99,5% of all methods have less than 20 elements and in particular those elements related to the parameters do not change often.

Source
Locals.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Locals
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def apply(index: Int): T

    Returns the value stored at the given index.

    Returns the value stored at the given index.

    Note

    If the index is not valid the result is not defined.

  2. abstract def foreach(f: (T) => Unit): Unit
  3. abstract def foreachReverse(f: (T) => Unit): Unit
  4. abstract def fuse(other: Locals[T], onDiff: (T, T) => T): Locals[T]

    Merges this Locals data-structure with the given Locals.

    Merges this Locals data-structure with the given Locals. If the pairwise merge of those values that are different always results in values that are reference equal to this local's elements or the other local's elements, the return value will be this or other, otherwise a new locals data structure is created.

    other

    Another Locals data-structure that has the the same number of elements as this Locals data-structure.

  5. abstract def indexOf(other: T): Option[Int]
  6. abstract def indexOfLastNonNullValue: Int

    The index of the last value that is not null; if all values are null or if we have no locals, -1 is returned.

  7. abstract def isEmpty: Boolean
  8. abstract def map[X >: Null <: AnyRef](f: (T) => X)(implicit arg0: ClassTag[X]): Locals[X]
  9. abstract def mapConserve(f: (T) => T): Locals[T]

    Transforms the values of this locals array.

    Transforms the values of this locals array. If all values are the same as before this is returned otherwise a new Locals object is created which contains the updated values.

  10. abstract def mapKV[X >: Null <: AnyRef](startIndex: Int, f: (Int, T) => X)(implicit arg0: ClassTag[X]): Locals[X]
    Attributes
    protected[this]
  11. abstract def nonEmpty: Boolean
  12. abstract def set(index: Int, value: T): Unit

    Sets the value at the given index to the given value.

    Sets the value at the given index to the given value.

    Note

    If the index is not valid the result is not defined.

  13. abstract def size: Int
  14. abstract def update(f: (T) => T): Unit

    Applies the given function to all elements and updates the value stored at the respective index.

    Applies the given function to all elements and updates the value stored at the respective index. Compared to map an in-place update is performed.

    Note

    For those values which are not yet set, null is passed to f.

  15. abstract def updated(index: Int, value1: T, value2: T, value3: T): Locals[T]

    Creates a new Locals object where the values stored at the given index and the two subsequent indexes are set to the given values.

  16. abstract def updated(index: Int, value1: T, value2: T): Locals[T]

    Creates a new Locals object where the values stored at the given index and the subsequent index are set to the given values.

  17. abstract def updated(index: Int, value: T): Locals[T]

    Creates a new Locals object where the value stored at the given index is set to the given one.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  6. def contains[X >: T](o: X): Boolean

    Returns true if the given element is already in this list, false otherwise.

  7. def corresponds[U >: Null <: AnyRef](other: Locals[U])(compare: (T, U) => Boolean): Boolean
  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  10. def exists[X >: T](f: (X) => Boolean): Boolean

    Returns true if an element satisfies the given predicate, false otherwise.

  11. def find[X >: T](f: (X) => Boolean): Option[T]

    Returns the first element that satisfies the given predicate.

  12. def foldLeft[B](b: B)(op: (B, T) => B): B

    Performs a fold left over all elements of this set.

  13. def foldRight[B](b: B)(op: (B, T) => B): B
  14. def forall[X >: T](f: (X) => Boolean): Boolean

    Returns true if all elements satisfy the given predicate, false otherwise.

  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  16. def hashCode(): Int
    Definition Classes
    Locals → AnyRef → Any
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. def iterator: Iterator[T]
  19. def mapKV[X >: Null <: AnyRef](f: (Int, T) => X)(implicit arg0: ClassTag[X]): Locals[X]

    Maps every key-value pair to a new value.

    Maps every key-value pair to a new value. Note, that the value may very well be null.

  20. def mapToVector[X](f: (T) => X): Vector[X]

    Creates a new vector which contains the mapped values as specified by the given function f.

    Creates a new vector which contains the mapped values as specified by the given function f.

    f

    The function that converts this collection's elements. f has to be able to handle null values if this collection may contain null values.

  21. def mkString(start: String, sep: String, end: String): String
  22. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  24. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  25. def nthValue[X >: T](f: (X) => Boolean): Int

    Counts the number of non-null values that do not match the given given predicate; the index of the first element that matches the predicate is returned.

    Counts the number of non-null values that do not match the given given predicate; the index of the first element that matches the predicate is returned.

    If no value matches the value -1 is returned.

  26. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  27. def toSeq: Seq[T]

    Creates a Scala sequence which is in reverse order! The sequence may contain null values.

  28. def toString(): String
    Definition Classes
    Locals → AnyRef → Any
  29. final def update(index: Int, value: T): Unit
  30. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  32. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  33. def zip(other: Locals[T]): Iterator[(T, T)]
  34. def zipWithIndex: Iterator[(T, Int)]

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from AnyRef

Inherited from Any

Ungrouped