trait ProdConsAnalyzerImpl extends AnyRef
This class provides additional queries over ASM's built-in SourceValue
analysis.
The analysis computes for each value in a frame a set of source instructions, which are the
potential producers. Most instructions produce either nothing or a stack value. For example,
a LOAD
instruction is the producer of the value pushed onto the stack. The exception are
STORE
instructions, which produce a new value for a local variable slot, so they are used
as producers for the value they stored.
Note that pseudo-instructions are used as initial producers for parameters and local variables. See the documentation on class InitialProducer.
This class implements the following queries over the data computed by the SourceValue analysis:
- producersForValueAt(insn, slot)
- consumersOfValueAt(insn, slot)
- producersForInputsOf(insn)
- consumersOfOutputsFrom(insn)
- initialProducersForValueAt(insn, slot)
- ultimateConsumersOfValueAt(insn, slot)
- initialProducersForInputsOf(insn)
- ultimateConsumersOfOutputsFrom(insn)
The following operations are considered as copying operations:
- xLOAD, xSTORE
- DUP, DUP2, DUP_X1, DUP_X2, DUP2_X1, DUP2_X2
- SWAP
- CHECKCAST
If ever needed, we could introduce a mode where primitive conversions (l2i) are considered as copying operations.
Note on performance: thee data flow analysis (SourceValue / SourceInterpreter, provided by ASM)
is roughly 2-3x slower than a simple analysis (like BasicValue). The reason is that the merge
function (merging producer sets) is more complex than merging simple basic values.
See also the doc comment in the package object analysis
.
- Alphabetic
- By Inheritance
- ProdConsAnalyzerImpl
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Abstract Value Members
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
+(other: String): String
- Implicit
- This member is added by an implicit conversion from ProdConsAnalyzerImpl to any2stringadd[ProdConsAnalyzerImpl] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
-
def
->[B](y: B): (ProdConsAnalyzerImpl, B)
- Implicit
- This member is added by an implicit conversion from ProdConsAnalyzerImpl to ArrowAssoc[ProdConsAnalyzerImpl] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- def consumersOfOutputsFrom(insn: AbstractInsnNode): Set[AbstractInsnNode]
-
def
consumersOfValueAt(insn: AbstractInsnNode, slot: Int): Set[AbstractInsnNode]
Returns the potential consumer instructions of a (local or stack) value in the frame of
insn
.Returns the potential consumer instructions of a (local or stack) value in the frame of
insn
. This is the counterpart ofproducersForValueAt
. -
def
ensuring(cond: (ProdConsAnalyzerImpl) ⇒ Boolean, msg: ⇒ Any): ProdConsAnalyzerImpl
- Implicit
- This member is added by an implicit conversion from ProdConsAnalyzerImpl to Ensuring[ProdConsAnalyzerImpl] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: (ProdConsAnalyzerImpl) ⇒ Boolean): ProdConsAnalyzerImpl
- Implicit
- This member is added by an implicit conversion from ProdConsAnalyzerImpl to Ensuring[ProdConsAnalyzerImpl] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean, msg: ⇒ Any): ProdConsAnalyzerImpl
- Implicit
- This member is added by an implicit conversion from ProdConsAnalyzerImpl to Ensuring[ProdConsAnalyzerImpl] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
def
ensuring(cond: Boolean): ProdConsAnalyzerImpl
- Implicit
- This member is added by an implicit conversion from ProdConsAnalyzerImpl to Ensuring[ProdConsAnalyzerImpl] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def initialProducersForInputsOf(insn: AbstractInsnNode): Set[AbstractInsnNode]
-
def
initialProducersForValueAt(insn: AbstractInsnNode, slot: Int): Set[AbstractInsnNode]
Returns the potential initial producer instructions of a value in the frame of
insn
.Returns the potential initial producer instructions of a value in the frame of
insn
.Unlike
producersForValueAt
, producers are tracked through copying instructions such as STORE and LOAD. If the producer of the value is a LOAD, then the producers of the stored value(s) are returned instead. -
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
producersForInputsOf(insn: AbstractInsnNode): Set[AbstractInsnNode]
Returns the potential producer instructions of any of the values consumed by
insn
. -
def
producersForValueAt(insn: AbstractInsnNode, slot: Int): Set[AbstractInsnNode]
Returns the potential producer instructions of a (local or stack) value in the frame of
insn
.Returns the potential producer instructions of a (local or stack) value in the frame of
insn
. This method simply returns the producer information computed by the SourceValue analysis. -
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
- def ultimateConsumersOfOutputsFrom(insn: AbstractInsnNode): Set[AbstractInsnNode]
-
def
ultimateConsumersOfValueAt(insn: AbstractInsnNode, slot: Int): Set[AbstractInsnNode]
Returns the potential ultimate consumers of a value in the frame of
insn
.Returns the potential ultimate consumers of a value in the frame of
insn
. Consumers are tracked through copying operations such as SOTRE and LOAD. -
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
→[B](y: B): (ProdConsAnalyzerImpl, B)
- Implicit
- This member is added by an implicit conversion from ProdConsAnalyzerImpl to ArrowAssoc[ProdConsAnalyzerImpl] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
Deprecated Value Members
-
def
formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from ProdConsAnalyzerImpl to StringFormat[ProdConsAnalyzerImpl] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.12.16) Use
formatString.format(value)
instead ofvalue.formatted(formatString)
, or use thef""
string interpolator. In Java 15 and later,formatted
resolves to the new method in String which has reversed parameters.
The Scala compiler and reflection APIs.