AliasingFrame

dotty.tools.backend.jvm.analysis.AliasingFrame
class AliasingFrame[V <: Value](nLocals: Int, nStack: Int) extends Frame[V]

A subclass of Frame that tracks aliasing of values stored in local variables and on the stack.

Note: an analysis tracking aliases is roughly 5x slower than a usual analysis (assuming a simple value domain with a fast merge function). For example, nullness analysis is roughly 5x slower than a BasicValue analysis.

See the doc of package object analysis for some notes on the performance of alias analysis.

Attributes

Graph
Supertypes
class Frame[V]
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Constructors

def this(src: Frame[_ <: V])

Concrete methods

def aliasesOf(entry: Int): AliasSet

The set of aliased values for a given entry in the values array.

The set of aliased values for a given entry in the values array.

Attributes

override def clearStack(): Unit

When entering an exception handler, all values are dropped from the stack (and the exception value is pushed). The ASM analyzer invokes firstHandlerInstructionFrame.clearStack(). To ensure consistent aliasing sets, we need to remove the dropped values from aliasing sets.

When entering an exception handler, all values are dropped from the stack (and the exception value is pushed). The ASM analyzer invokes firstHandlerInstructionFrame.clearStack(). To ensure consistent aliasing sets, we need to remove the dropped values from aliasing sets.

Attributes

Definition Classes
override def execute(insn: AbstractInsnNode, interpreter: Interpreter[V]): Unit

Attributes

Definition Classes
override def init(src: Frame[_ <: V]): Frame[V]

Attributes

Definition Classes
override def merge(other: Frame[_ <: V], interpreter: Interpreter[V]): Boolean

Merge the AliasingFrame other into this AliasingFrame.

Merge the AliasingFrame other into this AliasingFrame.

Aliases that are common in both frames are kept. Example:

var x, y = null if (...) { x = a y = a // (x, y, a) are aliases } else { x = a y = b // (x, a) and (y, b) } [...] // (x, a) -- merge of ((x, y, a)) and ((x, a), (y, b))

Attributes

Definition Classes
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Frame -> Any

Inherited methods

def getLocal(index: Int): V

Attributes

Inherited from:
Frame
def getLocals(): Int

Attributes

Inherited from:
Frame

Attributes

Inherited from:
Frame
def getStack(index: Int): V

Attributes

Inherited from:
Frame
def getStackSize(): Int

Attributes

Inherited from:
Frame

Attributes

Inherited from:
Frame

Attributes

Inherited from:
Frame
def pop(): V

Attributes

Inherited from:
Frame
def push(value: V): Unit

Attributes

Inherited from:
Frame
def setLocal(index: Int, value: V): Unit

Attributes

Inherited from:
Frame
def setReturn(v: V): Unit

Attributes

Inherited from:
Frame
def setStack(index: Int, value: V): Unit

Attributes

Inherited from:
Frame

Concrete fields

val aliases: Array[AliasSet | Null]

For every value the set of values that are aliases of it.

For every value the set of values that are aliases of it.

Invariants:

  • If aliases(i) == null then i has no aliases. This is equivalent to having aliases(i) == SingletonSet(i).
  • If aliases(i) != null then aliases(i) contains i.
  • If aliases(i) contains j then aliases(i) eq aliases(j), i.e., they are references to the same (mutable) AliasSet.

Attributes