|
Jode 1.90-CVS Build Aug 6, 2004 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jode.flow.FlowBlock
A flow block is the structure of which the flow graph consists. A flow block contains structured code together with some conditional or unconditional jumps to the head of other flow blocks. We do a T1/T2 analysis to combine all flow blocks to a single. If the graph isn't reducible that doesn't work, but java can only produce reducible flow graphs. We don't use the notion of basic flow graphs. A flow block may be anything from a single bytecode opcode, to the whole method.
Field Summary | |
static FlowBlock |
END_OF_METHOD
|
Constructor Summary | |
FlowBlock(MethodAnalyzer method,
int blockNr,
FlowBlock lastFlow)
The default constructor. |
Method Summary | |
void |
addStartPred()
Mark the flow block as first flow block in a method. |
void |
analyze()
The main analyzation. |
boolean |
analyze(int start,
int end)
The main analyzation. |
boolean |
analyzeSwitch(int start,
int end)
The switch analyzation. |
void |
appendBlock(StructuredBlock newBlock)
|
void |
appendReadBlock(StructuredBlock newBlock,
LocalInfo local)
|
void |
appendWriteBlock(StructuredBlock newBlock,
LocalInfo local)
|
void |
checkConsistent()
Checks if the FlowBlock and its StructuredBlocks are consistent. |
boolean |
doT1(int start,
int end)
|
boolean |
doT2(FlowBlock succ)
Do a T2 transformation with succ if possible. |
void |
doTransformations()
|
void |
dumpSource(TabbedPrintWriter writer)
Print the source code for this structured block. |
StructuredBlock |
getBlock()
Returns the structured block, that this flow block contains. |
int |
getBlockNr()
Returns the block number, where the code in this flow block starts. |
Jump |
getJumps(FlowBlock dest)
|
java.lang.String |
getLabel()
Returns the label of this block and creates a new label, if there wasn't a label previously. |
int |
getNextBlockNr()
|
java.util.Set |
getSuccessors()
|
boolean |
hasNoJumps()
|
void |
makeDeclaration(java.util.Set done)
Make declarations. |
boolean |
mapStackToLocal()
This is called after the analysis is completely done. |
void |
mapStackToLocal(VariableStack initialStack)
This is called after the analysis is completely done. |
void |
mergeBlockNr(FlowBlock succ)
Fixes the blockNr chained list, after merging this block with succ. |
void |
mergeEndBlock()
Do a T2 transformation with the end_of_method block. |
void |
mergeParams(LocalInfo[] param)
Merge the parameter locals with the in set of this flow block. |
void |
oldAppendBlock(StructuredBlock newBlock)
|
void |
prependBlock(StructuredBlock insertBlock)
|
Jump |
removeJumps(FlowBlock dest)
|
void |
removeOnetimeLocals()
|
void |
removePush()
|
void |
removeStartPred()
|
void |
removeSuccessor(Jump jump)
|
Jump |
resolveSomeJumps(Jump jumps,
FlowBlock succ)
This method resolves some of the jumps to successor. |
void |
setSuccessors(FlowBlock[] succs)
|
void |
simplify()
Simplify this and all following flowblocks. |
java.lang.String |
toString()
|
void |
updateInOutCatch(FlowBlock catchFlow)
Updates the in/out-Vectors of the structured block of the successing flow block for a try catch block. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static FlowBlock END_OF_METHOD
Constructor Detail |
public FlowBlock(MethodAnalyzer method, int blockNr, FlowBlock lastFlow)
Method Detail |
public int getNextBlockNr()
public boolean hasNoJumps()
public Jump resolveSomeJumps(Jump jumps, FlowBlock succ)
jumps
- The list of jumps with that successor.succ
- The successing flow block.
public void mergeBlockNr(FlowBlock succ)
public void updateInOutCatch(FlowBlock catchFlow)
0
:
int a=3; try { a = 5 / (a=0); } catch (DivideByZeroException ex) { System.out.println(a); }
public void checkConsistent()
public void prependBlock(StructuredBlock insertBlock)
public void appendReadBlock(StructuredBlock newBlock, LocalInfo local)
public void appendWriteBlock(StructuredBlock newBlock, LocalInfo local)
public void appendBlock(StructuredBlock newBlock)
public void oldAppendBlock(StructuredBlock newBlock)
public void setSuccessors(FlowBlock[] succs)
public boolean doT2(FlowBlock succ)
succ
- the successor block, must be a valid successor of this
block, i.e. not nullpublic void mergeEndBlock()
public boolean doT1(int start, int end)
public void doTransformations()
public void analyze()
public boolean analyze(int start, int end)
start
- the start of the block number range.end
- the end of the block number range.public boolean analyzeSwitch(int start, int end)
The current flow block must contain the switch block as lastModified.
start
- the start of the block number range.end
- the end of the block number range.public void addStartPred()
public void removeStartPred()
public void removeSuccessor(Jump jump)
public Jump getJumps(FlowBlock dest)
public Jump removeJumps(FlowBlock dest)
public java.util.Set getSuccessors()
public final boolean mapStackToLocal()
public void mapStackToLocal(VariableStack initialStack)
initialStack
- the stackmap at begin of the flow block
public void removePush()
public void removeOnetimeLocals()
public void mergeParams(LocalInfo[] param)
public void makeDeclaration(java.util.Set done)
public void simplify()
public void dumpSource(TabbedPrintWriter writer) throws java.io.IOException
writer
- The tabbed print writer, where we print to.
java.io.IOException
public int getBlockNr()
public java.lang.String getLabel()
public StructuredBlock getBlock()
public java.lang.String toString()
|
Jode 1.90-CVS Build Aug 6, 2004 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |