Package edu.umd.cs.findbugs.ba.vna
Class ValueNumberFrameModelingVisitor
java.lang.Object
edu.umd.cs.findbugs.ba.AbstractFrameModelingVisitor<ValueNumber,ValueNumberFrame>
edu.umd.cs.findbugs.ba.vna.ValueNumberFrameModelingVisitor
- All Implemented Interfaces:
Debug
,ValueNumberAnalysisFeatures
,org.apache.bcel.generic.Visitor
public class ValueNumberFrameModelingVisitor
extends AbstractFrameModelingVisitor<ValueNumber,ValueNumberFrame>
implements Debug, ValueNumberAnalysisFeatures
Visitor which models the effects of bytecode instructions on value numbers of
values in the operand stack frames.
- Author:
- David Hovemeyer
- See Also:
-
Field Summary
Fields inherited from class edu.umd.cs.findbugs.ba.AbstractFrameModelingVisitor
cpg
Fields inherited from interface edu.umd.cs.findbugs.ba.Debug
VERIFY_INTEGRITY
Fields inherited from interface edu.umd.cs.findbugs.ba.vna.ValueNumberAnalysisFeatures
REDUNDANT_LOAD_ELIMINATION, RLE_DEBUG
-
Constructor Summary
ConstructorDescriptionValueNumberFrameModelingVisitor
(org.apache.bcel.generic.MethodGen methodGen, ValueNumberFactory factory, ValueNumberCache cache, LoadedFieldSet loadedFieldSet, RepositoryLookupFailureCallback lookupFailureCallback) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionProduce a "default" value.void
modelNormalInstruction
(org.apache.bcel.generic.Instruction ins, int numWordsConsumed, int numWordsProduced) This is the default instruction modeling method.void
setHandle
(org.apache.bcel.generic.InstructionHandle handle) Set the instruction handle of the instruction currently being visited.void
visitACONST_NULL
(org.apache.bcel.generic.ACONST_NULL obj) void
visitCHECKCAST
(org.apache.bcel.generic.CHECKCAST obj) void
visitGETFIELD
(org.apache.bcel.generic.GETFIELD obj) void
visitGETSTATIC
(org.apache.bcel.generic.GETSTATIC obj) void
visitIINC
(org.apache.bcel.generic.IINC obj) void
visitInvokeOnException
(org.apache.bcel.generic.Instruction obj) void
visitINVOKESTATIC
(org.apache.bcel.generic.INVOKESTATIC obj) void
visitINVOKEVIRTUAL
(org.apache.bcel.generic.INVOKEVIRTUAL obj) void
visitLDC
(org.apache.bcel.generic.LDC obj) void
visitMONITORENTER
(org.apache.bcel.generic.MONITORENTER obj) void
visitPUTFIELD
(org.apache.bcel.generic.PUTFIELD obj) void
visitPUTSTATIC
(org.apache.bcel.generic.PUTSTATIC obj) Methods inherited from class edu.umd.cs.findbugs.ba.AbstractFrameModelingVisitor
analyzeInstruction, getCPG, getFrame, getLocation, getNumWordsConsumed, getNumWordsProduced, handleLoadInstruction, handleNormalInstruction, handleStoreInstruction, modelInstruction, setFrameAndLocation, visitAALOAD, visitAASTORE, visitAllocationInstruction, visitALOAD, visitANEWARRAY, visitARETURN, visitArithmeticInstruction, visitArrayInstruction, visitARRAYLENGTH, visitASTORE, visitATHROW, visitBALOAD, visitBASTORE, visitBIPUSH, visitBranchInstruction, visitBREAKPOINT, visitCALOAD, visitCASTORE, visitConstantPushInstruction, visitConversionInstruction, visitConversionInstruction2, visitCPInstruction, visitD2F, visitD2I, visitD2L, visitDADD, visitDALOAD, visitDASTORE, visitDCMPG, visitDCMPL, visitDCONST, visitDDIV, visitDLOAD, visitDMUL, visitDNEG, visitDREM, visitDRETURN, visitDSTORE, visitDSUB, visitDUP, visitDUP_X1, visitDUP_X2, visitDUP2, visitDUP2_X1, visitDUP2_X2, visitExceptionThrower, visitF2D, visitF2I, visitF2L, visitFADD, visitFALOAD, visitFASTORE, visitFCMPG, visitFCMPL, visitFCONST, visitFDIV, visitFieldInstruction, visitFieldOrMethod, visitFLOAD, visitFMUL, visitFNEG, visitFREM, visitFRETURN, visitFSTORE, visitFSUB, visitGOTO, visitGOTO_W, visitGotoInstruction, visitI2B, visitI2C, visitI2D, visitI2F, visitI2L, visitI2S, visitIADD, visitIALOAD, visitIAND, visitIASTORE, visitICONST, visitIDIV, visitIF_ACMPEQ, visitIF_ACMPNE, visitIF_ICMPEQ, visitIF_ICMPGE, visitIF_ICMPGT, visitIF_ICMPLE, visitIF_ICMPLT, visitIF_ICMPNE, visitIFEQ, visitIFGE, visitIFGT, visitIfInstruction, visitIFLE, visitIFLT, visitIFNE, visitIFNONNULL, visitIFNULL, visitILOAD, visitIMPDEP1, visitIMPDEP2, visitIMUL, visitINEG, visitINSTANCEOF, visitINVOKEDYNAMIC, visitInvokeInstruction, visitINVOKEINTERFACE, visitINVOKESPECIAL, visitIOR, visitIREM, visitIRETURN, visitISHL, visitISHR, visitISTORE, visitISUB, visitIUSHR, visitIXOR, visitJSR, visitJSR_W, visitJsrInstruction, visitL2D, visitL2F, visitL2I, visitLADD, visitLALOAD, visitLAND, visitLASTORE, visitLCMP, visitLCONST, visitLDC2_W, visitLDIV, visitLLOAD, visitLMUL, visitLNEG, visitLoadClass, visitLoadInstruction, visitLocalVariableInstruction, visitLOOKUPSWITCH, visitLOR, visitLREM, visitLRETURN, visitLSHL, visitLSHR, visitLSTORE, visitLSUB, visitLUSHR, visitLXOR, visitMONITOREXIT, visitMULTIANEWARRAY, visitNEW, visitNEWARRAY, visitNONNULL2Z, visitNOP, visitNULL2Z, visitPOP, visitPOP2, visitPopInstruction, visitPushInstruction, visitRET, visitRETURN, visitReturnInstruction, visitSALOAD, visitSASTORE, visitSelect, visitSIPUSH, visitStackConsumer, visitStackInstruction, visitStackProducer, visitStoreInstruction, visitSWAP, visitTABLESWITCH, visitTypedInstruction, visitUnconditionalBranch, visitVariableLengthInstruction
-
Constructor Details
-
ValueNumberFrameModelingVisitor
public ValueNumberFrameModelingVisitor(org.apache.bcel.generic.MethodGen methodGen, ValueNumberFactory factory, ValueNumberCache cache, LoadedFieldSet loadedFieldSet, RepositoryLookupFailureCallback lookupFailureCallback) Constructor.- Parameters:
methodGen
- the method being analyzedfactory
- factory for ValueNumbers for the methodcache
- cache of input/output transformations for each instructionloadedFieldSet
- fields loaded/stored by each instruction and entire methodlookupFailureCallback
- callback to use to report class lookup failures
-
-
Method Details
-
getDefaultValue
Description copied from class:AbstractFrameModelingVisitor
Produce a "default" value. This is what is pushed onto the stack by the handleNormalInstruction() method for instructions which produce stack values.- Specified by:
getDefaultValue
in classAbstractFrameModelingVisitor<ValueNumber,
ValueNumberFrame>
-
setHandle
public void setHandle(org.apache.bcel.generic.InstructionHandle handle) Set the instruction handle of the instruction currently being visited. This must be called before the instruction accepts this visitor! -
modelNormalInstruction
public void modelNormalInstruction(org.apache.bcel.generic.Instruction ins, int numWordsConsumed, int numWordsProduced) This is the default instruction modeling method.- Overrides:
modelNormalInstruction
in classAbstractFrameModelingVisitor<ValueNumber,
ValueNumberFrame> - Parameters:
ins
- the Instruction to modelnumWordsConsumed
- number of stack words consumednumWordsProduced
- number of stack words produced
-
visitGETFIELD
public void visitGETFIELD(org.apache.bcel.generic.GETFIELD obj) - Specified by:
visitGETFIELD
in interfaceorg.apache.bcel.generic.Visitor
- Overrides:
visitGETFIELD
in classAbstractFrameModelingVisitor<ValueNumber,
ValueNumberFrame>
-
visitPUTFIELD
public void visitPUTFIELD(org.apache.bcel.generic.PUTFIELD obj) - Specified by:
visitPUTFIELD
in interfaceorg.apache.bcel.generic.Visitor
- Overrides:
visitPUTFIELD
in classAbstractFrameModelingVisitor<ValueNumber,
ValueNumberFrame>
-
visitGETSTATIC
public void visitGETSTATIC(org.apache.bcel.generic.GETSTATIC obj) - Specified by:
visitGETSTATIC
in interfaceorg.apache.bcel.generic.Visitor
- Overrides:
visitGETSTATIC
in classAbstractFrameModelingVisitor<ValueNumber,
ValueNumberFrame>
-
visitPUTSTATIC
public void visitPUTSTATIC(org.apache.bcel.generic.PUTSTATIC obj) - Specified by:
visitPUTSTATIC
in interfaceorg.apache.bcel.generic.Visitor
- Overrides:
visitPUTSTATIC
in classAbstractFrameModelingVisitor<ValueNumber,
ValueNumberFrame>
-
visitINVOKESTATIC
public void visitINVOKESTATIC(org.apache.bcel.generic.INVOKESTATIC obj) - Specified by:
visitINVOKESTATIC
in interfaceorg.apache.bcel.generic.Visitor
- Overrides:
visitINVOKESTATIC
in classAbstractFrameModelingVisitor<ValueNumber,
ValueNumberFrame>
-
visitMONITORENTER
public void visitMONITORENTER(org.apache.bcel.generic.MONITORENTER obj) - Specified by:
visitMONITORENTER
in interfaceorg.apache.bcel.generic.Visitor
- Overrides:
visitMONITORENTER
in classAbstractFrameModelingVisitor<ValueNumber,
ValueNumberFrame>
-
visitInvokeOnException
public void visitInvokeOnException(org.apache.bcel.generic.Instruction obj) -
visitINVOKEVIRTUAL
public void visitINVOKEVIRTUAL(org.apache.bcel.generic.INVOKEVIRTUAL obj) - Specified by:
visitINVOKEVIRTUAL
in interfaceorg.apache.bcel.generic.Visitor
- Overrides:
visitINVOKEVIRTUAL
in classAbstractFrameModelingVisitor<ValueNumber,
ValueNumberFrame>
-
visitACONST_NULL
public void visitACONST_NULL(org.apache.bcel.generic.ACONST_NULL obj) - Specified by:
visitACONST_NULL
in interfaceorg.apache.bcel.generic.Visitor
- Overrides:
visitACONST_NULL
in classAbstractFrameModelingVisitor<ValueNumber,
ValueNumberFrame>
-
visitLDC
public void visitLDC(org.apache.bcel.generic.LDC obj) - Specified by:
visitLDC
in interfaceorg.apache.bcel.generic.Visitor
- Overrides:
visitLDC
in classAbstractFrameModelingVisitor<ValueNumber,
ValueNumberFrame>
-
visitIINC
public void visitIINC(org.apache.bcel.generic.IINC obj) - Specified by:
visitIINC
in interfaceorg.apache.bcel.generic.Visitor
- Overrides:
visitIINC
in classAbstractFrameModelingVisitor<ValueNumber,
ValueNumberFrame>
-
visitCHECKCAST
public void visitCHECKCAST(org.apache.bcel.generic.CHECKCAST obj) - Specified by:
visitCHECKCAST
in interfaceorg.apache.bcel.generic.Visitor
- Overrides:
visitCHECKCAST
in classAbstractFrameModelingVisitor<ValueNumber,
ValueNumberFrame>
-