|
|||||||||
| Home >> All >> jreversepro >> [ revengine overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
jreversepro.revengine
Class JBranchTable

java.lang.Objectjreversepro.revengine.JBranchTable
- All Implemented Interfaces:
- BranchConstants, jreversepro.common.JJvmOpcodes
- public class JBranchTable
- extends java.lang.Object
- implements BranchConstants, jreversepro.common.JJvmOpcodes
- extends java.lang.Object
JBranchTable manages the objects of JGotoEntry and JBranchEntry.
| Field Summary | |
(package private) java.util.List |
branches
Branches is a list, with the individual elemens containing 'JBranchEntry'. |
(package private) java.util.Map |
gotos
gotos Key - StartPc ( java.lang.Integer ) Value - TargetPc ( Absolute target -java.lang.Integer). |
(package private) jreversepro.reflect.JMethod |
method
Method reference |
(package private) java.util.Vector |
mJSRTarget
It is a Vector of 'Integer's. |
(package private) java.util.Map |
mMonitor
Map of monitor instructions. |
(package private) java.util.List |
switches
List of switch instructions. |
| Fields inherited from interface jreversepro.revengine.BranchConstants |
TYPE_BRANCH, TYPE_CASE, TYPE_CATCH, TYPE_CATCH_ANY, TYPE_DO_WHILE, TYPE_ELSE, TYPE_ELSE_IF, TYPE_GOTO, TYPE_IF, TYPE_INVALID, TYPE_JSR, TYPE_RET, TYPE_SWITCH, TYPE_SYNC, TYPE_TRY, TYPE_TRY_ANY, TYPE_WHILE |
| Constructor Summary | |
JBranchTable(jreversepro.reflect.JMethod method)
|
|
| Method Summary | |
void |
add(JBranchEntry ent)
Adds a new branch entry to the list of branches. |
void |
addGotoEntry(int startPc,
int targetPc)
Adds a Goto entry to the internal data structure. |
void |
addJSRPc(int targetPc)
This adds the pc given as input as a JSR target. |
void |
addMonitorPc(int aMonitorPc,
java.lang.String aMonObject)
Adds a monitor Pc. |
void |
addRetPc(int retPc)
When a RET instruction is encountered we add a branch with the last element of the JSR target lists. |
void |
addSwitch(JSwitchTable switchEntry)
Adds the switch entries and the case entries under the same to the branch table. |
void |
addTryBlocks(java.util.List excTryTable)
List of JException entries. |
java.lang.String |
branchesToString()
Stringifies the braches alone. |
static JBranchEntry |
contains(java.util.List listBranchEntries,
int type)
Returns the first branch in the mentioned branchlist that matches the particular type. |
void |
deleteElse(int startElse)
Delete the branch that corresponds to a else .. |
java.lang.String |
doesMonitorBegin(int monitorBeginPc)
Returns the monitor type for the monitor that begins with Pc. |
protected void |
finalize()
Finalizer method. |
jreversepro.reflect.JInstruction |
findGotoIns(java.util.List byteIns,
int start,
int end)
|
int |
findGotoTarget(int startPc)
For the given pc return the target of the instruction. |
java.util.Map |
getGotoTable()
Getter method for goto tables. |
void |
identifyMoreBranches()
Identifies the else..if and else branches. |
boolean |
isJSRTarget(int currPc)
Checks if the Pc passed as argument is the target for any JSR instructions. |
void |
setTables(java.util.List aBranches)
Setter method for the branch tables. |
void |
sort()
This sorts the list containing branches such that no branch overlaps with the one previously existing. |
java.util.List |
startsWith(int aInsIndex)
Returns the list of branches that starts with the mentioned aInsIndex. |
java.lang.String |
toString()
Convert this Object to a human-readable String. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
branches
java.util.List branches
- Branches is a list, with the individual elemens containing
'JBranchEntry'.
gotos
java.util.Map gotos
- gotos
Key - StartPc ( java.lang.Integer )
Value - TargetPc ( Absolute target -java.lang.Integer).
switches
java.util.List switches
- List of switch instructions. Individual members are
JInstruction.
mJSRTarget
java.util.Vector mJSRTarget
- It is a Vector of 'Integer's.
The integers are the target of the jump sub routine instruction.
mMonitor
java.util.Map mMonitor
- Map of monitor instructions.
method
jreversepro.reflect.JMethod method
- Method reference
| Constructor Detail |
JBranchTable
public JBranchTable(jreversepro.reflect.JMethod method)
| Method Detail |
setTables
public void setTables(java.util.List aBranches)
- Setter method for the branch tables.
getGotoTable
public java.util.Map getGotoTable()
- Getter method for goto tables.
addGotoEntry
public void addGotoEntry(int startPc,
int targetPc)
- Adds a Goto entry to the internal data structure.
finalize
protected void finalize()
- Finalizer method.
add
public void add(JBranchEntry ent)
- Adds a new branch entry to the list of branches.
isJSRTarget
public boolean isJSRTarget(int currPc)
- Checks if the Pc passed as argument is the target for
any JSR instructions.
addJSRPc
public void addJSRPc(int targetPc)
- This adds the pc given as input as a JSR target.
addRetPc
public void addRetPc(int retPc)
- When a RET instruction is encountered we add a branch with the
last element of the JSR target lists.
JSR instructions signify 'synchronized' and catch..all blocks.
sort
public void sort()
- This sorts the list containing branches such that no
branch overlaps with the one previously existing.
See JBranchComparator for more details.
addMonitorPc
public void addMonitorPc(int aMonitorPc,
java.lang.String aMonObject)
- Adds a monitor Pc.
doesMonitorBegin
public java.lang.String doesMonitorBegin(int monitorBeginPc)
- Returns the monitor type for the monitor that begins with
Pc.
identifyMoreBranches
public void identifyMoreBranches()
throws RevEngineException
- Identifies the else..if and else branches.
Identifies catch.. branches.
addSwitch
public void addSwitch(JSwitchTable switchEntry)
- Adds the switch entries and the case entries under the same to the
branch table.
addTryBlocks
public void addTryBlocks(java.util.List excTryTable)
- List of JException entries.
findGotoTarget
public int findGotoTarget(int startPc)
- For the given pc return the target of the instruction.
The instruction is a goto statement.
startsWith
public java.util.List startsWith(int aInsIndex) throws RevEngineException
- Returns the list of branches that starts with the
mentioned aInsIndex.
deleteElse
public void deleteElse(int startElse)
- Delete the branch that corresponds to a else ..
branch starting with the given Pc
contains
public static JBranchEntry contains(java.util.List listBranchEntries, int type)
- Returns the first branch in the mentioned branchlist
that matches the particular type.
findGotoIns
public jreversepro.reflect.JInstruction findGotoIns(java.util.List byteIns, int start, int end)
branchesToString
public java.lang.String branchesToString()
- Stringifies the braches alone.
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object - Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string concatenation with this object. If the result is
null, string concatenation will instead use"null".The default implementation returns
getClass().getName() + "@" + Integer.toHexString(hashCode()).
|
|||||||||
| Home >> All >> jreversepro >> [ revengine overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
jreversepro.revengine.JBranchTable