class AliasingFrame[V <: Value] 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.
- Source
- AliasingAnalyzer.scala
- Alphabetic
- By Inheritance
- AliasingFrame
- Frame
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Instance Constructors
Value Members
- val aliases: Array[AliasSet]
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 havingaliases(i) == SingletonSet(i)
. - If
aliases(i) != null
thenaliases(i) contains i
. - If
aliases(i) contains j
thenaliases(i) eq aliases(j)
, i.e., they are references to the same (mutable) AliasSet.
- If
- def aliasesOf(entry: Int): AliasSet
The set of aliased values for a given entry in the
values
array. - def clearStack(): Unit
When entering an exception handler, all values are dropped from the stack (and the exception value is pushed).
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.- Definition Classes
- AliasingFrame → Frame
- def execute(insn: AbstractInsnNode, interpreter: asm.tree.analysis.Interpreter[V]): Unit
- Definition Classes
- AliasingFrame → Frame
- def getLocal(index: Int): V
- Definition Classes
- Frame
- def getLocals(): Int
- Definition Classes
- Frame
- def getMaxStackSize(): Int
- Definition Classes
- Frame
- def getStack(index: Int): V
- Definition Classes
- Frame
- def getStackSize(): Int
- Definition Classes
- Frame
- def init(src: Frame[_ <: V]): Frame[V]
- Definition Classes
- AliasingFrame → Frame
- def initJumpTarget(opcode: Int, target: LabelNode): Unit
- Definition Classes
- Frame
- def merge(other: Frame[_ <: V], interpreter: asm.tree.analysis.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))
- Definition Classes
- AliasingFrame → Frame
- def merge(frame: Frame[_ <: V], localsUsed: Array[Boolean]): Boolean
- Definition Classes
- Frame
- def pop(): V
- Definition Classes
- Frame
- def push(value: V): Unit
- Definition Classes
- Frame
- def setLocal(index: Int, value: V): Unit
- Definition Classes
- Frame
- def setReturn(v: V): Unit
- Definition Classes
- Frame
- def setStack(index: Int, value: V): Unit
- Definition Classes
- Frame
- def toString(): String
- Definition Classes
- AliasingFrame → Frame → AnyRef → Any
The Scala compiler and reflection APIs.