public class UnconditionalValueDerefAnalysis extends BackwardDataflowAnalysis<UnconditionalValueDerefSet>
Modifier and Type | Field and Description |
---|---|
static boolean |
ASSUME_NONZERO_TRIP_LOOPS |
static boolean |
CHECK_ANNOTATIONS |
static boolean |
CHECK_CALLS |
static boolean |
DEBUG |
static boolean |
DEBUG_CHECK_CALLS |
static boolean |
IGNORE_DEREF_OF_NCP |
static boolean |
VERBOSE_NULLARG_DEBUG |
Constructor and Description |
---|
UnconditionalValueDerefAnalysis(ReverseDepthFirstSearch rdfs,
DepthFirstSearch dfs,
CFG cfg,
org.apache.bcel.classfile.Method method,
org.apache.bcel.generic.MethodGen methodGen,
ValueNumberDataflow vnaDataflow,
AssertionMethods assertionMethods)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static java.util.Set<ValueNumber> |
checkAllNonNullParams(Location location,
ValueNumberFrame vnaFrame,
org.apache.bcel.generic.ConstantPoolGen constantPool,
org.apache.bcel.classfile.Method method,
IsNullValueDataflow invDataflow,
TypeDataflow typeDataflow) |
static java.util.Set<ValueNumber> |
checkNonNullParams(Location location,
ValueNumberFrame vnaFrame,
org.apache.bcel.generic.ConstantPoolGen constantPool,
org.apache.bcel.classfile.Method method,
IsNullValueFrame invFrame) |
static java.util.Set<ValueNumber> |
checkUnconditionalDerefDatabase(Location location,
ValueNumberFrame vnaFrame,
org.apache.bcel.generic.ConstantPoolGen constantPool,
IsNullValueFrame invFrame,
TypeDataflow typeDataflow) |
void |
clearDerefsOnNonNullBranches(IsNullValueDataflow invDataflow)
HACK: use the given is-null dataflow to clear deref sets for values that
are known to be definitely non-null on a branch.
|
void |
copy(UnconditionalValueDerefSet source,
UnconditionalValueDerefSet dest)
Copy dataflow facts.
|
UnconditionalValueDerefSet |
createFact()
Create empty (uninitialized) dataflow facts for one program point.
|
int |
getLastUpdateTimestamp(UnconditionalValueDerefSet fact) |
void |
initEntryFact(UnconditionalValueDerefSet result)
Initialize the "entry" fact for the graph.
|
boolean |
isFactValid(UnconditionalValueDerefSet fact)
Determine whether the given fact is valid (neither top nor
bottom).
|
static boolean |
isNullCheck(org.apache.bcel.generic.InstructionHandle h,
org.apache.bcel.generic.ConstantPoolGen cpg) |
boolean |
isTop(UnconditionalValueDerefSet fact)
Is the given fact the top value.
|
void |
makeFactTop(UnconditionalValueDerefSet fact)
Make given fact the top value.
|
void |
meetInto(UnconditionalValueDerefSet fact,
Edge edge,
UnconditionalValueDerefSet result)
Meet a dataflow fact associated with an incoming edge into another fact.
|
void |
meetInto(UnconditionalValueDerefSet fact,
Edge edge,
UnconditionalValueDerefSet result,
boolean onlyEdge) |
static boolean |
reportPotentialDereference(Location location,
IsNullValueFrame invFrame) |
boolean |
same(UnconditionalValueDerefSet fact1,
UnconditionalValueDerefSet fact2)
Are given dataflow facts the same?
|
void |
setLastUpdateTimestamp(UnconditionalValueDerefSet fact,
int lastUpdate) |
void |
setTypeDataflow(TypeDataflow typeDataflow) |
void |
startIteration()
Called before beginning an iteration of analysis.
|
java.lang.String |
toString() |
void |
transferInstruction(org.apache.bcel.generic.InstructionHandle handle,
BasicBlock basicBlock,
UnconditionalValueDerefSet fact)
Transfer function for a single instruction.
|
getBlockOrder, getReverseDepthFirstSearch, isForwards
getFactAfterLocation, getFactAtLocation, transfer
edgeTransfer, factToString, finishIteration, getFactOnEdge, getResultFact, getStartFact, resultFactIterator
public static final boolean DEBUG
public static final boolean ASSUME_NONZERO_TRIP_LOOPS
public static final boolean IGNORE_DEREF_OF_NCP
public static final boolean CHECK_ANNOTATIONS
public static final boolean CHECK_CALLS
public static final boolean DEBUG_CHECK_CALLS
public static final boolean VERBOSE_NULLARG_DEBUG
public UnconditionalValueDerefAnalysis(ReverseDepthFirstSearch rdfs, DepthFirstSearch dfs, CFG cfg, org.apache.bcel.classfile.Method method, org.apache.bcel.generic.MethodGen methodGen, ValueNumberDataflow vnaDataflow, AssertionMethods assertionMethods)
rdfs
- the reverse depth-first-search (for the block order)cfg
- the CFG for the methodmethodGen
- the MethodGen for the methodvnaDataflow
- assertionMethods
- AssertionMethods for the analyzed classpublic java.lang.String toString()
toString
in class java.lang.Object
public void clearDerefsOnNonNullBranches(IsNullValueDataflow invDataflow)
invDataflow
- the IsNullValueDataflow to usepublic void setTypeDataflow(TypeDataflow typeDataflow)
public boolean isFactValid(UnconditionalValueDerefSet fact)
AbstractDataflowAnalysis
isFactValid
in class AbstractDataflowAnalysis<UnconditionalValueDerefSet>
public static boolean isNullCheck(org.apache.bcel.generic.InstructionHandle h, org.apache.bcel.generic.ConstantPoolGen cpg)
public static boolean reportPotentialDereference(Location location, IsNullValueFrame invFrame) throws DataflowAnalysisException
DataflowAnalysisException
public void transferInstruction(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, UnconditionalValueDerefSet fact) throws DataflowAnalysisException
AbstractDataflowAnalysis
transferInstruction
in class AbstractDataflowAnalysis<UnconditionalValueDerefSet>
handle
- the instructionbasicBlock
- the BasicBlock containing the instruction; needed to
disambiguate instructions in inlined JSR subroutinesfact
- which should be modified based on the instructionDataflowAnalysisException
public static java.util.Set<ValueNumber> checkUnconditionalDerefDatabase(Location location, ValueNumberFrame vnaFrame, org.apache.bcel.generic.ConstantPoolGen constantPool, @CheckForNull IsNullValueFrame invFrame, TypeDataflow typeDataflow) throws DataflowAnalysisException
DataflowAnalysisException
public static java.util.Set<ValueNumber> checkAllNonNullParams(Location location, ValueNumberFrame vnaFrame, org.apache.bcel.generic.ConstantPoolGen constantPool, @CheckForNull org.apache.bcel.classfile.Method method, @CheckForNull IsNullValueDataflow invDataflow, TypeDataflow typeDataflow) throws DataflowAnalysisException
DataflowAnalysisException
public static java.util.Set<ValueNumber> checkNonNullParams(Location location, ValueNumberFrame vnaFrame, org.apache.bcel.generic.ConstantPoolGen constantPool, @CheckForNull org.apache.bcel.classfile.Method method, @CheckForNull IsNullValueFrame invFrame) throws DataflowAnalysisException
DataflowAnalysisException
public void copy(UnconditionalValueDerefSet source, UnconditionalValueDerefSet dest)
DataflowAnalysis
public UnconditionalValueDerefSet createFact()
DataflowAnalysis
public void initEntryFact(UnconditionalValueDerefSet result) throws DataflowAnalysisException
DataflowAnalysis
DataflowAnalysisException
public void makeFactTop(UnconditionalValueDerefSet fact)
DataflowAnalysis
public boolean isTop(UnconditionalValueDerefSet fact)
DataflowAnalysis
public void meetInto(UnconditionalValueDerefSet fact, Edge edge, UnconditionalValueDerefSet result) throws DataflowAnalysisException
DataflowAnalysis
fact
- the predecessor fact (incoming edge)edge
- the edge from the predecessorresult
- the result factDataflowAnalysisException
public void meetInto(UnconditionalValueDerefSet fact, Edge edge, UnconditionalValueDerefSet result, boolean onlyEdge)
public boolean same(UnconditionalValueDerefSet fact1, UnconditionalValueDerefSet fact2)
DataflowAnalysis
public void startIteration()
DataflowAnalysis
startIteration
in interface DataflowAnalysis<UnconditionalValueDerefSet>
startIteration
in class BasicAbstractDataflowAnalysis<UnconditionalValueDerefSet>
public int getLastUpdateTimestamp(UnconditionalValueDerefSet fact)
getLastUpdateTimestamp
in interface DataflowAnalysis<UnconditionalValueDerefSet>
getLastUpdateTimestamp
in class BasicAbstractDataflowAnalysis<UnconditionalValueDerefSet>
public void setLastUpdateTimestamp(UnconditionalValueDerefSet fact, int lastUpdate)
setLastUpdateTimestamp
in interface DataflowAnalysis<UnconditionalValueDerefSet>
setLastUpdateTimestamp
in class BasicAbstractDataflowAnalysis<UnconditionalValueDerefSet>
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.