Value used for the analysis.
| Modifier and Type | Field and Description |
|---|---|
| private Frame | frames
The execution stack frames of the currently analyzed method (one per instruction index). |
| private List | handlers
The exception handlers of the currently analyzed method (one list per instruction index). |
| private boolean[] | inInstructionsToProcess
The instructions that remain to process (one boolean per instruction index). |
| private InsnList | insnList
The instructions of the currently analyzed method. |
| private int | insnListSize
The size of |
| private int[] | instructionsToProcess
The indices of the instructions that remain to process in the currently analyzed method. |
| private final Interpreter | interpreter
The interpreter to use to symbolically interpret the bytecode instructions. |
| private int | numInstructionsToProcess
The number of instructions that remain to process in the currently analyzed method. |
| private Subroutine[] | subroutines
The subroutines of the currently analyzed method (one per instruction index). |
| Access | Constructor and Description |
|---|---|
| public | Analyzer(final Interpreter<V>
the interpreter to use to symbolically interpret the bytecode instructions. interpreter)Constructs a new |
| Modifier and Type | Method and Description |
|---|---|
| public Frame | Returns: the symbolic state of the execution stack frame at each bytecode instruction of the method. The size of the returned array is equal to the number of instructions (and labels) of the method. A given frame is null if and only if the corresponding instruction cannot be reached (dead code).the internal name of the class to which 'method' belongs (see owner, final MethodNode Type#getInternalName()).the method to be analyzed. The maxStack and maxLocals fields must have correct
values. method)Analyzes the given method. |
| public Frame | Returns: the symbolic state of the execution stack frame at each bytecode instruction of the method. The size of the returned array is equal to the number of instructions (and labels) of the method. A given frame is null if and only if the corresponding instruction cannot be reached (dead code).the internal name of the class to which 'method' belongs (see owner, final MethodNode Type#getInternalName()).the method to be analyzed. method)Analyzes the given method and computes and sets its maximum stack size and maximum number of local variables. |
| private Frame | Returns: the initial execution stack frame of the 'method'.the internal name of the class to which 'method' belongs (see owner, final MethodNode Type#getInternalName()).the method to be analyzed. method)Computes the initial execution stack frame of the given method. |
| private static int | Returns: the maximum number of local variables used in the given method.a method. method)Computes and returns the maximum number of local variables used in the given method. |
| private static int | Returns: the maximum stack size of the given method.the stack map frames of a method. frames)Computes and returns the maximum stack size of a method, given its stack map frames. |
| private void | findSubroutine(final int
an instruction index. insnIndex, final Subroutine a subroutine. subroutine, final List<AbstractInsnNode> where the jsr instructions for nested subroutines must be put. jsrInsns)Follows the control flow graph of the currently analyzed method, starting at the given
instruction index, and stores a copy of the given subroutine in |
| private void | findSubroutines(final int
the maximum number of local variables of the currently analyzed method (long
and double values count for two variables). maxLocals)Finds the subroutines of the currently analyzed method and stores them in |
| public Frame | Returns: the symbolic state of the execution stack frame at each bytecode instruction of the method. The size of the returned array is equal to the number of instructions (and labels) of the method. A given frame is null if the corresponding instruction cannot be reached, or if an error occurred during the analysis of the method.Returns the symbolic execution stack frame for each instruction of the last analyzed method. |
| public List | Returns: a list ofTryCatchBlockNode objects.the index of an instruction of the last analyzed method. insnIndex)Returns the exception handlers for the given instruction. |
| protected void | init(final String
the internal name of the class to which the method belongs (see owner, final MethodNode Type#getInternalName()).the method to be analyzed. method)Initializes this analyzer. |
| private void | merge(final int
an instruction index. insnIndex, final Frame<V> a frame. This frame is left unchanged by this method. frame, final Subroutine a subroutine. This subroutine is left unchanged by this method. subroutine)Merges the given frame and subroutine into the frame and subroutines at the given instruction index. |
| private void | merge(final int
the index of an instruction immediately following a jsr instruction. insnIndex, final Frame<V> the execution stack frame before the jsr instruction. This frame is
merged into 'frameAfterRet'. frameBeforeJsr, final Frame<V> the execution stack frame after a ret instruction of the subroutine. This
frame is merged into the frame at 'insnIndex' (after it has itself been merge with
'frameBeforeJsr'). frameAfterRet, final Subroutine if the jsr is itself part of a subroutine (case of nested
subroutine), the subroutine it belongs to. subroutineBeforeJsr, final boolean[] the local variables read or written in the subroutine. localsUsed)Merges the given frame and subroutine into the frame and subroutines at the given instruction index (case of a RET instruction). |
| protected void | newControlFlowEdge(final int
an instruction index. insnIndex, final int index of a successor instruction. successorIndex)Creates a control flow graph edge. |
| protected boolean | Returns: true if this edge must be considered in the data flow analysis performed by this analyzer, or false otherwise. The default implementation of this method always returns true.an instruction index. insnIndex, final int index of a successor instruction. successorIndex)Creates a control flow graph edge corresponding to an exception handler. |
| protected boolean | Returns: true if this edge must be considered in the data flow analysis performed by this analyzer, or false otherwise. The default implementation of this method delegates tonewControlFlowExceptionEdge(int, int).an instruction index. insnIndex, final TryCatchBlockNode TryCatchBlockNode corresponding to this edge. tryCatchBlock)Creates a control flow graph edge corresponding to an exception handler. |
| protected Frame | Returns: the created frame.the maximum number of local variables of the frame. numLocals, final int the maximum stack size of the frame. numStack)Constructs a new frame with the given size. |
| protected Frame |
| frames | back to summary |
|---|---|
| private Frame<V>[] frames The execution stack frames of the currently analyzed method (one per instruction index). | |
| handlers | back to summary |
|---|---|
| private List<TryCatchBlockNode>[] handlers The exception handlers of the currently analyzed method (one list per instruction index). | |
| inInstructionsToProcess | back to summary |
|---|---|
| private boolean[] inInstructionsToProcess The instructions that remain to process (one boolean per instruction index). | |
| insnList | back to summary |
|---|---|
| private InsnList insnList The instructions of the currently analyzed method. | |
| insnListSize | back to summary |
|---|---|
| private int insnListSize The size of | |
| instructionsToProcess | back to summary |
|---|---|
| private int[] instructionsToProcess The indices of the instructions that remain to process in the currently analyzed method. | |
| interpreter | back to summary |
|---|---|
| private final Interpreter<V> interpreter The interpreter to use to symbolically interpret the bytecode instructions. | |
| numInstructionsToProcess | back to summary |
|---|---|
| private int numInstructionsToProcess The number of instructions that remain to process in the currently analyzed method. | |
| subroutines | back to summary |
|---|---|
| private Subroutine[] subroutines The subroutines of the currently analyzed method (one per instruction index). | |
| Analyzer | back to summary |
|---|---|
| public Analyzer(final Interpreter<V> interpreter) Constructs a new
| |
| analyze | back to summary |
|---|---|
| public Frame Analyzes the given method.
| |
| analyzeAndComputeMaxs | back to summary |
|---|---|
| public Frame Analyzes the given method and computes and sets its maximum stack size and maximum number of local variables.
| |
| computeInitialFrame | back to summary |
|---|---|
| private Frame Computes the initial execution stack frame of the given method.
| |
| computeMaxLocals | back to summary |
|---|---|
| private static int computeMaxLocals(final MethodNode method) Computes and returns the maximum number of local variables used in the given method.
| |
| computeMaxStack | back to summary |
|---|---|
| private static int computeMaxStack(final Frame<?>[] frames) Computes and returns the maximum stack size of a method, given its stack map frames.
| |
| findSubroutine | back to summary |
|---|---|
| private void findSubroutine(final int insnIndex, final Subroutine subroutine, final List<AbstractInsnNode> jsrInsns) throws AnalyzerException Follows the control flow graph of the currently analyzed method, starting at the given
instruction index, and stores a copy of the given subroutine in
| |
| findSubroutines | back to summary |
|---|---|
| private void findSubroutines(final int maxLocals) throws AnalyzerException Finds the subroutines of the currently analyzed method and stores them in
| |
| getFrames | back to summary |
|---|---|
| public Frame Returns the symbolic execution stack frame for each instruction of the last analyzed method.
| |
| getHandlers | back to summary |
|---|---|
| public List Returns the exception handlers for the given instruction.
| |
| init | back to summary |
|---|---|
| protected void init(final String owner, final MethodNode method) throws AnalyzerException Initializes this analyzer. This method is called just before the execution of control flow
analysis loop in
| |
| merge | back to summary |
|---|---|
| private void merge(final int insnIndex, final Frame<V> frame, final Subroutine subroutine) throws AnalyzerException Merges the given frame and subroutine into the frame and subroutines at the given instruction index. If the frame or the subroutine at the given instruction index changes as a result of this merge, the instruction index is added to the list of instructions to process (if it is not already the case).
| |
| merge | back to summary |
|---|---|
| private void merge(final int insnIndex, final Frame<V> frameBeforeJsr, final Frame<V> frameAfterRet, final Subroutine subroutineBeforeJsr, final boolean[] localsUsed) throws AnalyzerException Merges the given frame and subroutine into the frame and subroutines at the given instruction index (case of a RET instruction). If the frame or the subroutine at the given instruction index changes as a result of this merge, the instruction index is added to the list of instructions to process (if it is not already the case).
| |
| newControlFlowEdge | back to summary |
|---|---|
| protected void newControlFlowEdge(final int insnIndex, final int successorIndex) Creates a control flow graph edge. The default implementation of this method does nothing. It
can be overridden in order to construct the control flow graph of a method (this method is
called by the
| |
| newControlFlowExceptionEdge | back to summary |
|---|---|
| protected boolean newControlFlowExceptionEdge(final int insnIndex, final int successorIndex) Creates a control flow graph edge corresponding to an exception handler. The default
implementation of this method does nothing. It can be overridden in order to construct the
control flow graph of a method (this method is called by the
| |
| newControlFlowExceptionEdge | back to summary |
|---|---|
| protected boolean newControlFlowExceptionEdge(final int insnIndex, final TryCatchBlockNode tryCatchBlock) Creates a control flow graph edge corresponding to an exception handler. The default
implementation of this method delegates to
| |
| newFrame | back to summary |
|---|---|
| protected Frame Constructs a new frame with the given size.
| |
| newFrame | back to summary |
|---|---|
| protected Frame Constructs a copy of the given frame. | |