ProdConsAnalyzer
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: the 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.
Attributes
- Graph
-
- Supertypes