|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.findbugs.ba.AbstractDataflowAnalysis<Fact>
edu.umd.cs.findbugs.ba.ForwardDataflowAnalysis<FrameType>
edu.umd.cs.findbugs.ba.FrameDataflowAnalysis<ValueType,FrameType>
public abstract class FrameDataflowAnalysis<ValueType,FrameType extends Frame<ValueType>>
A convenient base class for dataflow analysis classes which use Frames as values.
Frame
,
DataflowAnalysis
Constructor Summary | |
---|---|
FrameDataflowAnalysis(DepthFirstSearch dfs)
|
Method Summary | |
---|---|
void |
copy(FrameType source,
FrameType dest)
Copy dataflow facts. |
void |
initResultFact(FrameType result)
Initialize result fact for block. |
boolean |
isFactValid(FrameType fact)
Determine whether the given fact is valid (neither top nor bottom). |
void |
makeFactTop(FrameType fact)
Make given fact the top value. |
protected void |
mergeInto(FrameType other,
FrameType result)
Merge one frame into another. |
protected abstract ValueType |
mergeValues(FrameType frame,
int slot,
ValueType a,
ValueType b)
Merge two values in a particular slot of a Frame. |
protected FrameType |
modifyFrame(FrameType orig,
FrameType copy)
Create a modifiable copy of a frame. |
boolean |
same(FrameType fact1,
FrameType fact2)
Are given dataflow facts the same? |
Methods inherited from class edu.umd.cs.findbugs.ba.ForwardDataflowAnalysis |
---|
getBlockOrder, getDepthFirstSearch, isForwards |
Methods inherited from class edu.umd.cs.findbugs.ba.AbstractDataflowAnalysis |
---|
endTransfer, factToString, getFactAfterLocation, getFactAtLocation, getResultFact, getStartFact, resultFactIterator, startTransfer, transfer, transferInstruction |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface edu.umd.cs.findbugs.ba.DataflowAnalysis |
---|
createFact, initEntryFact, meetInto |
Constructor Detail |
---|
public FrameDataflowAnalysis(DepthFirstSearch dfs)
Method Detail |
---|
public void copy(FrameType source, FrameType dest)
DataflowAnalysis
public void initResultFact(FrameType result)
DataflowAnalysis
public void makeFactTop(FrameType fact)
DataflowAnalysis
public boolean same(FrameType fact1, FrameType fact2)
DataflowAnalysis
public boolean isFactValid(FrameType fact)
AbstractDataflowAnalysis
isFactValid
in class AbstractDataflowAnalysis<FrameType extends Frame<ValueType>>
protected FrameType modifyFrame(FrameType orig, FrameType copy)
FrameType copy = null; if (someCondition()) { copy = modifyFrame(fact, copy); // modify copy } if (someOtherCondition()) { copy = modifyFrame(fact, copy); // modify copy } if (copy != null) fact = copy; mergeInto(fact, result);The advantage of using modifyFrame() is that new code can be added before or after other places where the frame is modified, and the code will remain correct.
orig
- the original framecopy
- the modifiable copy (returned by a previous call to modifyFrame()),
or null if this is the first time modifyFrame() is being called
protected void mergeInto(FrameType other, FrameType result) throws DataflowAnalysisException
other
- the frame to merge with the resultresult
- the result frame, which is modified to be the
merge of the two frames
DataflowAnalysisException
protected abstract ValueType mergeValues(FrameType frame, int slot, ValueType a, ValueType b) throws DataflowAnalysisException
frame
- the Frameslot
- the slot of the Framea
- a valueb
- another value
DataflowAnalysisException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |