ppt4j 1.0
 
Loading...
Searching...
No Matches
ppt4j.analysis.bytecode.InstControlFlowAnalyzer< V extends Value > Class Template Reference
Inheritance diagram for ppt4j.analysis.bytecode.InstControlFlowAnalyzer< V extends Value >:

Public Member Functions

 InstControlFlowAnalyzer (Interpreter< V > interpreter)
 
Frame< V >[] analyze (String owner, MethodNode method) throws AnalyzerException
 
InsnBlock[] getBlocks ()
 

Public Attributes

final Map< AbstractInsnNode, InsnBlocknodeToBlockMap = new HashMap<>()
 
final Map< AbstractInsnNode, InsnBlocknodeToJumpBlockMap = new HashMap<>()
 
final Map< InsnBlock, Integer > blockToIndexMap = new HashMap<>()
 

Protected Member Functions

void newControlFlowEdge (int insnIndex, int successorIndex)
 

Constructor & Destructor Documentation

◆ InstControlFlowAnalyzer()

ppt4j.analysis.bytecode.InstControlFlowAnalyzer< V extends Value >.InstControlFlowAnalyzer ( Interpreter< V > interpreter)

Member Function Documentation

◆ analyze()

Frame< V >[] ppt4j.analysis.bytecode.InstControlFlowAnalyzer< V extends Value >.analyze ( String owner,
MethodNode method ) throws AnalyzerException

Analyzes a given method by creating an array of instruction blocks, mapping each instruction node to a block, and storing the index of each block. It then retrieves the lines of text for each instruction node and adds them to the corresponding block. Finally, it delegates the analysis to the superclass implementation.

Parameters
ownerthe owner of the method
methodthe method node to be analyzed
Returns
an array of frames containing the analysis results
Exceptions
AnalyzerExceptionif an error occurs during the analysis

◆ getBlocks()

InsnBlock[] ppt4j.analysis.bytecode.InstControlFlowAnalyzer< V extends Value >.getBlocks ( )

Returns an array of InsnBlock objects representing the blocks of instructions.

Returns
an array of InsnBlock objects

◆ newControlFlowEdge()

void ppt4j.analysis.bytecode.InstControlFlowAnalyzer< V extends Value >.newControlFlowEdge ( int insnIndex,
int successorIndex )
protected

Creates a new control flow edge between the instruction at the specified index and its successor index. This method determines the type of the instruction at the specified index and adds the appropriate control flow edge. If the instruction is a jump instruction, it adds a next edge if the successor index is the next instruction index, otherwise it adds a jump edge. If the instruction is a lookupswitch, tableswitch, or ret instruction, it adds a jump edge. If the instruction is a throw instruction or a return instruction, it throws an IllegalStateException. Otherwise, it adds a next edge.

Parameters
insnIndexthe index of the instruction
successorIndexthe index of the successor instruction

Member Data Documentation

◆ blockToIndexMap

final Map<InsnBlock, Integer> ppt4j.analysis.bytecode.InstControlFlowAnalyzer< V extends Value >.blockToIndexMap = new HashMap<>()

◆ nodeToBlockMap

final Map<AbstractInsnNode, InsnBlock> ppt4j.analysis.bytecode.InstControlFlowAnalyzer< V extends Value >.nodeToBlockMap = new HashMap<>()

◆ nodeToJumpBlockMap

final Map<AbstractInsnNode, InsnBlock> ppt4j.analysis.bytecode.InstControlFlowAnalyzer< V extends Value >.nodeToJumpBlockMap = new HashMap<>()

The documentation for this class was generated from the following file: