Class TargetEnumeratingVisitor

  • All Implemented Interfaces:
    EdgeTypes, org.apache.bcel.generic.Visitor, org.apache.bcel.generic.VisitorSupportsInvokeDynamic

    public class TargetEnumeratingVisitor
    extends org.apache.bcel.generic.EmptyVisitor
    implements EdgeTypes
    Visitor to find all of the targets of an instruction whose InstructionHandle is given. Note that we don't consider exception edges.
    Author:
    David Hovemeyer, Chadd Williams
    • Constructor Summary

      Constructors 
      Constructor Description
      TargetEnumeratingVisitor​(org.apache.bcel.generic.InstructionHandle handle, org.apache.bcel.generic.ConstantPoolGen constPoolGen)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean instructionIsExit()
      Is the analyzed instruction an exit (call to System.exit())?
      boolean instructionIsReturn()
      Is the analyzed instruction a method return?
      boolean instructionIsThrow()
      Is the analyzed instruction an explicit throw?
      boolean isEndOfBasicBlock()
      Is the instruction the end of a basic block?
      java.util.Iterator<Target> targetIterator()
      Iterate over Target objects representing control flow targets and their edge types.
      void visitATHROW​(org.apache.bcel.generic.ATHROW ins)  
      void visitGotoInstruction​(org.apache.bcel.generic.GotoInstruction ins)  
      void visitIfInstruction​(org.apache.bcel.generic.IfInstruction ins)  
      void visitINVOKESTATIC​(org.apache.bcel.generic.INVOKESTATIC ins)  
      void visitReturnInstruction​(org.apache.bcel.generic.ReturnInstruction ins)  
      void visitSelect​(org.apache.bcel.generic.Select ins)  
      • Methods inherited from class org.apache.bcel.generic.EmptyVisitor

        visitAALOAD, visitAASTORE, visitACONST_NULL, visitAllocationInstruction, visitALOAD, visitANEWARRAY, visitARETURN, visitArithmeticInstruction, visitArrayInstruction, visitARRAYLENGTH, visitASTORE, visitBALOAD, visitBASTORE, visitBIPUSH, visitBranchInstruction, visitBREAKPOINT, visitCALOAD, visitCASTORE, visitCHECKCAST, visitConstantPushInstruction, visitConversionInstruction, 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, visitGETFIELD, visitGETSTATIC, visitGOTO, visitGOTO_W, 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, visitIFLE, visitIFLT, visitIFNE, visitIFNONNULL, visitIFNULL, visitIINC, visitILOAD, visitIMPDEP1, visitIMPDEP2, visitIMUL, visitINEG, visitINSTANCEOF, visitINVOKEDYNAMIC, visitInvokeInstruction, visitINVOKEINTERFACE, visitINVOKESPECIAL, visitINVOKEVIRTUAL, visitIOR, visitIREM, visitIRETURN, visitISHL, visitISHR, visitISTORE, visitISUB, visitIUSHR, visitIXOR, visitJSR, visitJSR_W, visitJsrInstruction, visitL2D, visitL2F, visitL2I, visitLADD, visitLALOAD, visitLAND, visitLASTORE, visitLCMP, visitLCONST, visitLDC, visitLDC2_W, visitLDIV, visitLLOAD, visitLMUL, visitLNEG, visitLoadClass, visitLoadInstruction, visitLocalVariableInstruction, visitLOOKUPSWITCH, visitLOR, visitLREM, visitLRETURN, visitLSHL, visitLSHR, visitLSTORE, visitLSUB, visitLUSHR, visitLXOR, visitMONITORENTER, visitMONITOREXIT, visitMULTIANEWARRAY, visitNEW, visitNEWARRAY, visitNOP, visitPOP, visitPOP2, visitPopInstruction, visitPushInstruction, visitPUTFIELD, visitPUTSTATIC, visitRET, visitRETURN, visitSALOAD, visitSASTORE, visitSIPUSH, visitStackConsumer, visitStackInstruction, visitStackProducer, visitStoreInstruction, visitSWAP, visitTABLESWITCH, visitTypedInstruction, visitUnconditionalBranch, visitVariableLengthInstruction
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TargetEnumeratingVisitor

        public TargetEnumeratingVisitor​(org.apache.bcel.generic.InstructionHandle handle,
                                        org.apache.bcel.generic.ConstantPoolGen constPoolGen)
        Constructor.
        Parameters:
        handle - the handle of the instruction whose targets should be enumerated
        constPoolGen - the ConstantPoolGen object for the class
    • Method Detail

      • isEndOfBasicBlock

        public boolean isEndOfBasicBlock()
        Is the instruction the end of a basic block?
      • instructionIsReturn

        public boolean instructionIsReturn()
        Is the analyzed instruction a method return?
      • instructionIsThrow

        public boolean instructionIsThrow()
        Is the analyzed instruction an explicit throw?
      • instructionIsExit

        public boolean instructionIsExit()
        Is the analyzed instruction an exit (call to System.exit())?
      • targetIterator

        public java.util.Iterator<Target> targetIterator()
        Iterate over Target objects representing control flow targets and their edge types.
      • visitGotoInstruction

        public void visitGotoInstruction​(org.apache.bcel.generic.GotoInstruction ins)
        Specified by:
        visitGotoInstruction in interface org.apache.bcel.generic.Visitor
        Overrides:
        visitGotoInstruction in class org.apache.bcel.generic.EmptyVisitor
      • visitIfInstruction

        public void visitIfInstruction​(org.apache.bcel.generic.IfInstruction ins)
        Specified by:
        visitIfInstruction in interface org.apache.bcel.generic.Visitor
        Overrides:
        visitIfInstruction in class org.apache.bcel.generic.EmptyVisitor
      • visitSelect

        public void visitSelect​(org.apache.bcel.generic.Select ins)
        Specified by:
        visitSelect in interface org.apache.bcel.generic.Visitor
        Overrides:
        visitSelect in class org.apache.bcel.generic.EmptyVisitor
      • visitReturnInstruction

        public void visitReturnInstruction​(org.apache.bcel.generic.ReturnInstruction ins)
        Specified by:
        visitReturnInstruction in interface org.apache.bcel.generic.Visitor
        Overrides:
        visitReturnInstruction in class org.apache.bcel.generic.EmptyVisitor
      • visitATHROW

        public void visitATHROW​(org.apache.bcel.generic.ATHROW ins)
        Specified by:
        visitATHROW in interface org.apache.bcel.generic.Visitor
        Overrides:
        visitATHROW in class org.apache.bcel.generic.EmptyVisitor
      • visitINVOKESTATIC

        public void visitINVOKESTATIC​(org.apache.bcel.generic.INVOKESTATIC ins)
        Specified by:
        visitINVOKESTATIC in interface org.apache.bcel.generic.Visitor
        Overrides:
        visitINVOKESTATIC in class org.apache.bcel.generic.EmptyVisitor