Package edu.umd.cs.findbugs.ba
Class LiveLocalStoreAnalysis
java.lang.Object
edu.umd.cs.findbugs.ba.BasicAbstractDataflowAnalysis<BitSet>
edu.umd.cs.findbugs.ba.AbstractDataflowAnalysis<BitSet>
edu.umd.cs.findbugs.ba.BackwardDataflowAnalysis<BitSet>
edu.umd.cs.findbugs.ba.LiveLocalStoreAnalysis
- All Implemented Interfaces:
DataflowAnalysis<BitSet>
,Debug
Dataflow analysis to find live stores of locals. This is just a backward
analysis to see which loads reach stores of the same local.
This analysis also computes which stores that were killed by a subsequent store on any subsequent reachable path. (The FindDeadLocalStores detector uses this information to reduce false positives.)
- Author:
- David Hovemeyer
-
Field Summary
Fields inherited from interface edu.umd.cs.findbugs.ba.Debug
VERIFY_INTEGRITY
-
Constructor Summary
ConstructorDescriptionLiveLocalStoreAnalysis
(org.apache.bcel.generic.MethodGen methodGen, ReverseDepthFirstSearch rdfs, DepthFirstSearch dfs) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Copy dataflow facts.Create empty (uninitialized) dataflow facts for one program point.factToString
(BitSet fact) Return a String representation of given Fact.void
initEntryFact
(BitSet result) Initialize the "entry" fact for the graph.boolean
isFactValid
(BitSet fact) Determine whether the given fact is valid (neither top nor bottom).boolean
isStoreAlive
(BitSet fact, int local) Return whether or not a store of given local is alive.boolean
Return whether or not given fact is the special TOP value.boolean
killedByStore
(BitSet fact, int local) Return whether or not a store of given local was killed by a subsequent (dominated) store.void
makeFactTop
(BitSet fact) Make given fact the top value.void
Meet a dataflow fact associated with an incoming edge into another fact.boolean
Are given dataflow facts the same?void
transferInstruction
(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, BitSet fact) Transfer function for a single instruction.Methods inherited from class edu.umd.cs.findbugs.ba.BackwardDataflowAnalysis
getBlockOrder, getReverseDepthFirstSearch, isForwards
Methods inherited from class edu.umd.cs.findbugs.ba.AbstractDataflowAnalysis
getFactAfterLocation, getFactAtLocation, transfer
Methods inherited from class edu.umd.cs.findbugs.ba.BasicAbstractDataflowAnalysis
edgeTransfer, finishIteration, getFactOnEdge, getLastUpdateTimestamp, getResultFact, getStartFact, resultFactIterator, setLastUpdateTimestamp, startIteration
-
Constructor Details
-
LiveLocalStoreAnalysis
public LiveLocalStoreAnalysis(org.apache.bcel.generic.MethodGen methodGen, ReverseDepthFirstSearch rdfs, DepthFirstSearch dfs)
-
-
Method Details
-
createFact
Description copied from interface:DataflowAnalysis
Create empty (uninitialized) dataflow facts for one program point. A valid value will be copied into it before it is used.- Specified by:
createFact
in interfaceDataflowAnalysis<BitSet>
-
copy
Description copied from interface:DataflowAnalysis
Copy dataflow facts.- Specified by:
copy
in interfaceDataflowAnalysis<BitSet>
-
initEntryFact
Description copied from interface:DataflowAnalysis
Initialize the "entry" fact for the graph.- Specified by:
initEntryFact
in interfaceDataflowAnalysis<BitSet>
- Throws:
DataflowAnalysisException
-
makeFactTop
Description copied from interface:DataflowAnalysis
Make given fact the top value.- Specified by:
makeFactTop
in interfaceDataflowAnalysis<BitSet>
-
same
Description copied from interface:DataflowAnalysis
Are given dataflow facts the same?- Specified by:
same
in interfaceDataflowAnalysis<BitSet>
-
meetInto
Description copied from interface:DataflowAnalysis
Meet a dataflow fact associated with an incoming edge into another fact. This is used to determine the start fact for a basic block.- Specified by:
meetInto
in interfaceDataflowAnalysis<BitSet>
- Parameters:
fact
- the predecessor fact (incoming edge)edge
- the edge from the predecessorresult
- the result fact- Throws:
DataflowAnalysisException
-
transferInstruction
public void transferInstruction(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, BitSet fact) throws DataflowAnalysisException Description copied from class:AbstractDataflowAnalysis
Transfer function for a single instruction.- Specified by:
transferInstruction
in classAbstractDataflowAnalysis<BitSet>
- Parameters:
handle
- the instructionbasicBlock
- the BasicBlock containing the instruction; needed to disambiguate instructions in inlined JSR subroutinesfact
- which should be modified based on the instruction- Throws:
DataflowAnalysisException
-
isFactValid
Description copied from class:AbstractDataflowAnalysis
Determine whether the given fact is valid (neither top nor bottom).- Specified by:
isFactValid
in classAbstractDataflowAnalysis<BitSet>
-
factToString
Description copied from interface:DataflowAnalysis
Return a String representation of given Fact. For debugging purposes.- Specified by:
factToString
in interfaceDataflowAnalysis<BitSet>
- Overrides:
factToString
in classBasicAbstractDataflowAnalysis<BitSet>
- Parameters:
fact
- a dataflow fact- Returns:
- String representation of the fact
-
isTop
Return whether or not given fact is the special TOP value.- Specified by:
isTop
in interfaceDataflowAnalysis<BitSet>
-
isStoreAlive
Return whether or not a store of given local is alive.- Parameters:
fact
- a dataflow fact created by this analysislocal
- the local
-
killedByStore
Return whether or not a store of given local was killed by a subsequent (dominated) store.
-