public abstract class FrameDataflowAnalysis<ValueType,FrameType extends Frame<ValueType>> extends ForwardDataflowAnalysis<FrameType>
Frame,
DataflowAnalysis| Constructor and Description |
|---|
FrameDataflowAnalysis(DepthFirstSearch dfs) |
| Modifier and Type | Method and Description |
|---|---|
void |
copy(FrameType source,
FrameType dest)
Copy dataflow facts.
|
FrameType |
getFactAtPC(CFG cfg,
int pc)
Get the dataflow fact representing the point just before given Location.
|
FrameType |
getFactBeforeExceptionCheck(CFG cfg,
int pc)
Get the dataflow fact representing the point just before given Location.
|
int |
getLastUpdateTimestamp(FrameType fact) |
boolean |
isFactValid(FrameType fact)
Determine whether the given fact is valid (neither top nor
bottom).
|
boolean |
isTop(FrameType fact)
Is the given fact the top value.
|
void |
makeFactTop(FrameType fact)
Make given fact the top value.
|
protected void |
mergeInto(FrameType other,
FrameType result)
Merge one frame into another.
|
protected abstract void |
mergeValues(FrameType otherFrame,
FrameType resultFrame,
int slot)
Merge the values contained in a given slot of two Frames.
|
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?
|
void |
setLastUpdateTimestamp(FrameType fact,
int lastTimestamp) |
getBlockOrder, getDepthFirstSearch, isForwardsgetFactAfterLocation, getFactAtLocation, transfer, transferInstructionedgeTransfer, factToString, finishIteration, getFactOnEdge, getResultFact, getStartFact, resultFactIterator, startIterationclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateFact, initEntryFact, meetIntopublic FrameDataflowAnalysis(DepthFirstSearch dfs)
public void copy(FrameType source, FrameType dest)
DataflowAnalysispublic void makeFactTop(FrameType fact)
DataflowAnalysispublic boolean isTop(FrameType fact)
DataflowAnalysispublic boolean same(FrameType fact1, FrameType fact2)
DataflowAnalysispublic FrameType getFactAtPC(CFG cfg, int pc) throws DataflowAnalysisException
DataflowAnalysisExceptionpublic FrameType getFactBeforeExceptionCheck(CFG cfg, int pc) throws DataflowAnalysisException
DataflowAnalysisExceptionpublic boolean isFactValid(FrameType fact)
AbstractDataflowAnalysisisFactValid in class AbstractDataflowAnalysis<FrameType extends Frame<ValueType>>public int getLastUpdateTimestamp(FrameType fact)
getLastUpdateTimestamp in interface DataflowAnalysis<FrameType extends Frame<ValueType>>getLastUpdateTimestamp in class BasicAbstractDataflowAnalysis<FrameType extends Frame<ValueType>>public void setLastUpdateTimestamp(FrameType fact, int lastTimestamp)
setLastUpdateTimestamp in interface DataflowAnalysis<FrameType extends Frame<ValueType>>setLastUpdateTimestamp in class BasicAbstractDataflowAnalysis<FrameType extends Frame<ValueType>>protected final FrameType modifyFrame(FrameType orig, @CheckForNull 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 calledprotected 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
framesDataflowAnalysisExceptionprotected abstract void mergeValues(FrameType otherFrame, FrameType resultFrame, int slot) throws DataflowAnalysisException
otherFrame - a FrameresultFrame - a Frame which will contain the resulting merged valueslot - a slot in both framesDataflowAnalysisExceptionFindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.