|
|||||||||
| Home >> All >> org >> apache >> bcel >> verifier >> [ structurals overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.bcel.verifier.structurals
Class Subroutines.SubroutineImpl

java.lang.Objectorg.apache.bcel.verifier.structurals.Subroutines.SubroutineImpl
- All Implemented Interfaces:
- Subroutine
- Enclosing class:
- Subroutines
- private class Subroutines.SubroutineImpl
- extends java.lang.Object
- implements Subroutine
- extends java.lang.Object
This inner class implements the Subroutine interface.
| Field Summary | |
private java.util.Set |
instructions
The instructions that belong to this subroutine. |
private int |
localVariable
The Local Variable slot where the first instruction of this subroutine (an ASTORE) stores the JsrInstruction's ReturnAddress in and the RET of this subroutine operates on. |
private java.util.Set |
theJSRs
The JSR or JSR_W instructions that define this subroutine by targeting it. |
private org.apache.bcel.generic.InstructionHandle |
theRET
The RET instruction that leaves this subroutine. |
private static int |
UNSET
UNSET, a symbol for an uninitialized localVariable field. |
| Constructor Summary | |
Subroutines.SubroutineImpl()
The default constructor. |
|
| Method Summary | |
private void |
_getRecursivelyAccessedLocalsIndicesHelper(java.util.Set s,
Subroutine[] subs)
A recursive helper method for getRecursivelyAccessedLocalsIndices(). |
void |
addEnteringJsrInstruction(org.apache.bcel.generic.InstructionHandle jsrInst)
Adds a new JSR or JSR_W that has this subroutine as its target. |
(package private) void |
addInstruction(org.apache.bcel.generic.InstructionHandle ih)
|
boolean |
contains(org.apache.bcel.generic.InstructionHandle inst)
Returns if the given InstructionHandle refers to an instruction that is part of this subroutine. |
int[] |
getAccessedLocalsIndices()
Returns an int[] containing the indices of the local variable slots accessed by this Subroutine (read-accessed, write-accessed or both); local variables referenced by subroutines of this subroutine are not included. |
org.apache.bcel.generic.InstructionHandle[] |
getEnteringJsrInstructions()
Returns all the JsrInstructions that have the first instruction of this subroutine as their target. |
org.apache.bcel.generic.InstructionHandle[] |
getInstructions()
Returns all instructions that together form this subroutine. |
org.apache.bcel.generic.InstructionHandle |
getLeavingRET()
Returns the one and only RET that leaves the subroutine. |
int[] |
getRecursivelyAccessedLocalsIndices()
Returns an int[] containing the indices of the local variable slots accessed by this Subroutine (read-accessed, write-accessed or both); local variables referenced by subroutines of this subroutine are included. |
(package private) void |
setLeavingRET()
Sets the leaving RET instruction. |
(package private) void |
setLocalVariable(int i)
|
Subroutine[] |
subSubs()
Returns the subroutines that are directly called from this subroutine. |
java.lang.String |
toString()
Returns a String representation of this object, merely for debugging purposes. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
UNSET
private static final int UNSET
- UNSET, a symbol for an uninitialized localVariable
field. This is used for the "top-level" Subroutine;
i.e. no subroutine.
- See Also:
- Constant Field Values
localVariable
private int localVariable
- The Local Variable slot where the first
instruction of this subroutine (an ASTORE) stores
the JsrInstruction's ReturnAddress in and
the RET of this subroutine operates on.
instructions
private java.util.Set instructions
- The instructions that belong to this subroutine.
theJSRs
private java.util.Set theJSRs
- The JSR or JSR_W instructions that define this
subroutine by targeting it.
theRET
private org.apache.bcel.generic.InstructionHandle theRET
- The RET instruction that leaves this subroutine.
| Constructor Detail |
Subroutines.SubroutineImpl
public Subroutines.SubroutineImpl()
- The default constructor.
| Method Detail |
contains
public boolean contains(org.apache.bcel.generic.InstructionHandle inst)
- Description copied from interface:
Subroutine - Returns if the given InstructionHandle refers to an instruction
that is part of this subroutine. This is a convenience method
that saves iteration over the InstructionHandle objects returned
by getInstructions().
- Specified by:
containsin interfaceSubroutine
toString
public java.lang.String toString()
- Returns a String representation of this object, merely
for debugging purposes.
(Internal) Warning: Verbosity on a problematic subroutine may cause
stack overflow errors due to recursive subSubs() calls.
Don't use this, then.
setLeavingRET
void setLeavingRET()
- Sets the leaving RET instruction. Must be invoked after all instructions are added.
Must not be invoked for top-level 'subroutine'.
getEnteringJsrInstructions
public org.apache.bcel.generic.InstructionHandle[] getEnteringJsrInstructions()
- Description copied from interface:
Subroutine - Returns all the JsrInstructions that have the
first instruction of this subroutine as their target.
Must not be invoked on the 'top-level subroutine'.
- Specified by:
getEnteringJsrInstructionsin interfaceSubroutine
addEnteringJsrInstruction
public void addEnteringJsrInstruction(org.apache.bcel.generic.InstructionHandle jsrInst)
- Adds a new JSR or JSR_W that has this subroutine as its target.
getLeavingRET
public org.apache.bcel.generic.InstructionHandle getLeavingRET()
- Description copied from interface:
Subroutine - Returns the one and only RET that leaves the subroutine.
Note that JustIce has a pretty rigid notion of a subroutine.
Must not be invoked on the 'top-level subroutine'.
- Specified by:
getLeavingRETin interfaceSubroutine
getInstructions
public org.apache.bcel.generic.InstructionHandle[] getInstructions()
- Description copied from interface:
Subroutine - Returns all instructions that together form this subroutine.
Note that an instruction is part of exactly one subroutine
(the top-level code is considered to be a special subroutine) -
else it is not reachable at all (dead code).
- Specified by:
getInstructionsin interfaceSubroutine
addInstruction
void addInstruction(org.apache.bcel.generic.InstructionHandle ih)
getRecursivelyAccessedLocalsIndices
public int[] getRecursivelyAccessedLocalsIndices()
- Description copied from interface:
Subroutine - Returns an int[] containing the indices of the local variable slots
accessed by this Subroutine (read-accessed, write-accessed or both);
local variables referenced by subroutines of this subroutine are
included.
- Specified by:
getRecursivelyAccessedLocalsIndicesin interfaceSubroutine
_getRecursivelyAccessedLocalsIndicesHelper
private void _getRecursivelyAccessedLocalsIndicesHelper(java.util.Set s, Subroutine[] subs)
- A recursive helper method for getRecursivelyAccessedLocalsIndices().
getAccessedLocalsIndices
public int[] getAccessedLocalsIndices()
- Description copied from interface:
Subroutine - Returns an int[] containing the indices of the local variable slots
accessed by this Subroutine (read-accessed, write-accessed or both);
local variables referenced by subroutines of this subroutine are
not included.
- Specified by:
getAccessedLocalsIndicesin interfaceSubroutine
subSubs
public Subroutine[] subSubs()
- Description copied from interface:
Subroutine - Returns the subroutines that are directly called from this subroutine.
- Specified by:
subSubsin interfaceSubroutine
setLocalVariable
void setLocalVariable(int i)
|
|||||||||
| Home >> All >> org >> apache >> bcel >> verifier >> [ structurals overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
org.apache.bcel.verifier.structurals.Subroutines.SubroutineImpl