Class StackDepthAnalysis
java.lang.Object
edu.umd.cs.findbugs.ba.BasicAbstractDataflowAnalysis<StackDepth>
edu.umd.cs.findbugs.ba.AbstractDataflowAnalysis<StackDepth>
edu.umd.cs.findbugs.ba.ForwardDataflowAnalysis<StackDepth>
edu.umd.cs.findbugs.ba.StackDepthAnalysis
- All Implemented Interfaces:
DataflowAnalysis<StackDepth>
A really simple forward dataflow analysis to find the depth of the Java
operand stack. This is more of a proof of concept for the dataflow analysis
framework than anything useful.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStackDepthAnalysis(org.apache.bcel.generic.ConstantPoolGen cpg, DepthFirstSearch dfs) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidcopy(StackDepth source, StackDepth dest) Copy dataflow facts.Create empty (uninitialized) dataflow facts for one program point.voidinitEntryFact(StackDepth entryFact) Initialize the "entry" fact for the graph.booleanisFactValid(StackDepth fact) Determine whether the given fact is valid (neither top nor bottom).booleanisTop(StackDepth fact) Is the given fact the top value.voidmakeFactTop(StackDepth fact) Make given fact the top value.voidmeetInto(StackDepth fact, Edge edge, StackDepth result) Meet a dataflow fact associated with an incoming edge into another fact.booleansame(StackDepth fact1, StackDepth fact2) Are given dataflow facts the same?voidtransferInstruction(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, StackDepth fact) Transfer function for a single instruction.Methods inherited from class ForwardDataflowAnalysis
getBlockOrder, getDepthFirstSearch, isForwardsMethods inherited from class AbstractDataflowAnalysis
getFactAfterLocation, getFactAtLocation, transferMethods inherited from class BasicAbstractDataflowAnalysis
edgeTransfer, factToString, finishIteration, getFactOnEdge, getLastUpdateTimestamp, getResultFact, getStartFact, resultFactIterator, setLastUpdateTimestamp, startIteration
-
Field Details
-
TOP
public static final int TOP- See Also:
-
BOTTOM
public static final int BOTTOM- See Also:
-
cpg
private final org.apache.bcel.generic.ConstantPoolGen cpg
-
-
Constructor Details
-
StackDepthAnalysis
Constructor.- Parameters:
cpg- the ConstantPoolGen of the method whose CFG we're performing the analysis ondfs- DepthFirstSearch of the method's CFG
-
-
Method Details
-
createFact
Description copied from interface:DataflowAnalysisCreate empty (uninitialized) dataflow facts for one program point. A valid value will be copied into it before it is used. -
makeFactTop
Description copied from interface:DataflowAnalysisMake given fact the top value. -
isTop
Description copied from interface:DataflowAnalysisIs the given fact the top value. -
isFactValid
Description copied from class:AbstractDataflowAnalysisDetermine whether the given fact is valid (neither top nor bottom).- Specified by:
isFactValidin classAbstractDataflowAnalysis<StackDepth>
-
copy
Description copied from interface:DataflowAnalysisCopy dataflow facts. -
initEntryFact
Description copied from interface:DataflowAnalysisInitialize the "entry" fact for the graph. -
same
Description copied from interface:DataflowAnalysisAre given dataflow facts the same? -
transferInstruction
public void transferInstruction(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, StackDepth fact) throws DataflowAnalysisException Description copied from class:AbstractDataflowAnalysisTransfer function for a single instruction.- Specified by:
transferInstructionin classAbstractDataflowAnalysis<StackDepth>- 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
-
meetInto
Description copied from interface:DataflowAnalysisMeet a dataflow fact associated with an incoming edge into another fact. This is used to determine the start fact for a basic block.- Parameters:
fact- the predecessor fact (incoming edge)edge- the edge from the predecessorresult- the result fact
-