Class ConstantAnalysis
java.lang.Object
edu.umd.cs.findbugs.ba.BasicAbstractDataflowAnalysis<ConstantFrame>
edu.umd.cs.findbugs.ba.AbstractDataflowAnalysis<ConstantFrame>
edu.umd.cs.findbugs.ba.ForwardDataflowAnalysis<ConstantFrame>
edu.umd.cs.findbugs.ba.FrameDataflowAnalysis<Constant, ConstantFrame>
edu.umd.cs.findbugs.ba.constant.ConstantAnalysis
- All Implemented Interfaces:
DataflowAnalysis<ConstantFrame>
Dataflow analysis to find constant values.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.bcel.generic.MethodGenprivate final ConstantFrameModelingVisitor -
Constructor Summary
ConstructorsConstructorDescriptionConstantAnalysis(org.apache.bcel.generic.MethodGen methodGen, DepthFirstSearch dfs) -
Method Summary
Modifier and TypeMethodDescriptionCreate empty (uninitialized) dataflow facts for one program point.voidinitEntryFact(ConstantFrame frame) Initialize the "entry" fact for the graph.voidmeetInto(ConstantFrame fact, Edge edge, ConstantFrame result) Meet a dataflow fact associated with an incoming edge into another fact.protected voidmergeValues(ConstantFrame otherFrame, ConstantFrame resultFrame, int slot) Merge the values contained in a given slot of two Frames.voidtransferInstruction(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, ConstantFrame frame) Transfer function for a single instruction.Methods inherited from class FrameDataflowAnalysis
copy, getFactAtPC, getFactBeforeExceptionCheck, getLastUpdateTimestamp, isFactValid, isTop, makeFactTop, mergeInto, modifyFrame, same, setLastUpdateTimestampMethods inherited from class ForwardDataflowAnalysis
getBlockOrder, getDepthFirstSearch, isForwardsMethods inherited from class AbstractDataflowAnalysis
getFactAfterLocation, getFactAtLocation, transferMethods inherited from class BasicAbstractDataflowAnalysis
edgeTransfer, factToString, finishIteration, getFactOnEdge, getResultFact, getStartFact, resultFactIterator, startIteration
-
Field Details
-
methodGen
private final org.apache.bcel.generic.MethodGen methodGen -
visitor
-
-
Constructor Details
-
ConstantAnalysis
-
-
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. -
initEntryFact
Description copied from interface:DataflowAnalysisInitialize the "entry" fact for the graph. -
transferInstruction
public void transferInstruction(org.apache.bcel.generic.InstructionHandle handle, BasicBlock basicBlock, ConstantFrame frame) throws DataflowAnalysisException Description copied from class:AbstractDataflowAnalysisTransfer function for a single instruction.- Specified by:
transferInstructionin classAbstractDataflowAnalysis<ConstantFrame>- Parameters:
handle- the instructionbasicBlock- the BasicBlock containing the instruction; needed to disambiguate instructions in inlined JSR subroutinesframe- which should be modified based on the instruction- Throws:
DataflowAnalysisException
-
meetInto
public void meetInto(ConstantFrame fact, Edge edge, ConstantFrame result) throws DataflowAnalysisException 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- Throws:
DataflowAnalysisException
-
mergeValues
protected void mergeValues(ConstantFrame otherFrame, ConstantFrame resultFrame, int slot) throws DataflowAnalysisException Description copied from class:FrameDataflowAnalysisMerge the values contained in a given slot of two Frames.- Specified by:
mergeValuesin classFrameDataflowAnalysis<Constant, ConstantFrame>- Parameters:
otherFrame- a FrameresultFrame- a Frame which will contain the resulting merged valueslot- a slot in both frames- Throws:
DataflowAnalysisException
-