|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--jreversepro.revengine.JBranchTable
JBranchTable manages the objects of JGotoEntry and JBranchEntry.
| Field Summary |
| 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(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. |
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()
|
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public JBranchTable(JMethod method)
method - Method reference.| Method Detail |
public void setTables(java.util.List aBranches)
aBranches - Branches to be added.public java.util.Map getGotoTable()
public void addGotoEntry(int startPc,
int targetPc)
startPc - StartPc of the goto statement.targetPc - TargetPc of the goto statement.protected void finalize()
finalize in class java.lang.Objectpublic void add(JBranchEntry ent)
ent - branch entry to be added.public boolean isJSRTarget(int currPc)
currPc - Pc for which it is to be checked if it is the
target for any JSR instruction.
public void addJSRPc(int targetPc)
targetPc - TargetPc for a JSR instruction that is to be
added to the internal data structure ( list ).public void addRetPc(int retPc)
retPc - PC of the instruction which is a RET.public void sort()
public void addMonitorPc(int aMonitorPc,
java.lang.String aMonObject)
aMonitorPc - Pc that is monitorenter.aMonObject - Object that is 'monitored'. In the sense
object for which lock is obtained before entering a
'synchronized' object.public java.lang.String doesMonitorBegin(int monitorBeginPc)
monitorBeginPc - Pc that begins with the monitor.
public void identifyMoreBranches()
throws RevEngineException
RevEngineException - Thrown in case of any error.public void addSwitch(JSwitchTable switchEntry)
switchEntry - switch table containing entries about switch
statements.public void addTryBlocks(java.util.List excTryTable)
excTryTable - Individual entries being JException.public int findGotoTarget(int startPc)
startPc - Start Pc.
public java.util.List startsWith(int aInsIndex)
throws RevEngineException
aInsIndex - Instruction index.
RevEngineException - thrown in case of an error.public void deleteElse(int startElse)
startElse - PC for which the else statement
is to be deleted.
public static JBranchEntry contains(java.util.List listBranchEntries,
int type)
listBranchEntries - list of branch entries.type - Type that is to be searched for.
public JInstruction findGotoIns(java.util.List byteIns,
int start,
int end)
byteIns - BytecodeInstruction List.start - StartPc.end - EndPc.
public java.lang.String branchesToString()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||