Class ExecutionVisitor

  • All Implemented Interfaces:
    Visitor

    public class ExecutionVisitor
    extends EmptyVisitor
    This Visitor class may be used for a type-based Java Virtual Machine simulation.

    It does not check for correct types on the OperandStack or in the LocalVariables; nor does it check their sizes are sufficiently big. Thus, to use this Visitor for bytecode verifying, you have to make sure externally that the type constraints of the Java Virtual Machine instructions are satisfied. An InstConstraintVisitor may be used for this. Anyway, this Visitor does not mandate it. For example, when you visitIADD(IADD o), then there are two stack slots popped and one stack slot containing a Type.INT is pushed (where you could also pop only one slot if you know there are two Type.INT on top of the stack). Monitor-specific behavior is not simulated.

    Conventions:

    Type.VOID will never be pushed onto the stack. Type.DOUBLE and Type.LONG that would normally take up two stack slots (like Double_HIGH and Double_LOW) are represented by a simple single Type.DOUBLE or Type.LONG object on the stack here.

    If a two-slot type is stored into a local variable, the next variable is given the type Type.UNKNOWN.

    See Also:
    visitDSTORE(DSTORE o), InstConstraintVisitor
    • Constructor Summary

      Constructors 
      Constructor Description
      ExecutionVisitor()
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void setConstantPoolGen​(ConstantPoolGen cpg)
      Sets the ConstantPoolGen needed for symbolic execution.
      void setFrame​(Frame f)
      The only method granting access to the single instance of the ExecutionVisitor class.
      void visitAALOAD​(AALOAD o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitAASTORE​(AASTORE o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitACONST_NULL​(ACONST_NULL o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitALOAD​(ALOAD o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitANEWARRAY​(ANEWARRAY o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitARETURN​(ARETURN o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitARRAYLENGTH​(ARRAYLENGTH o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitASTORE​(ASTORE o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitATHROW​(ATHROW o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitBALOAD​(BALOAD o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitBASTORE​(BASTORE o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitBIPUSH​(BIPUSH o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitCALOAD​(CALOAD o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitCASTORE​(CASTORE o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitCHECKCAST​(CHECKCAST o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitD2F​(D2F o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitD2I​(D2I o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitD2L​(D2L o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitDADD​(DADD o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitDALOAD​(DALOAD o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitDASTORE​(DASTORE o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitDCMPG​(DCMPG o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitDCMPL​(DCMPL o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitDCONST​(DCONST o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitDDIV​(DDIV o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitDLOAD​(DLOAD o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitDMUL​(DMUL o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitDNEG​(DNEG o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitDREM​(DREM o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitDRETURN​(DRETURN o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitDSTORE​(DSTORE o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitDSUB​(DSUB o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitDUP​(DUP o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitDUP_X1​(DUP_X1 o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitDUP_X2​(DUP_X2 o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitDUP2​(DUP2 o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitDUP2_X1​(DUP2_X1 o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitDUP2_X2​(DUP2_X2 o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitF2D​(F2D o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitF2I​(F2I o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitF2L​(F2L o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitFADD​(FADD o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitFALOAD​(FALOAD o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitFASTORE​(FASTORE o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitFCMPG​(FCMPG o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitFCMPL​(FCMPL o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitFCONST​(FCONST o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitFDIV​(FDIV o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitFLOAD​(FLOAD o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitFMUL​(FMUL o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitFNEG​(FNEG o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitFREM​(FREM o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitFRETURN​(FRETURN o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitFSTORE​(FSTORE o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitFSUB​(FSUB o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitGETFIELD​(GETFIELD o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitGETSTATIC​(GETSTATIC o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitGOTO​(GOTO o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitGOTO_W​(GOTO_W o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitI2B​(I2B o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitI2C​(I2C o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitI2D​(I2D o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitI2F​(I2F o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitI2L​(I2L o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitI2S​(I2S o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIADD​(IADD o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIALOAD​(IALOAD o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIAND​(IAND o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIASTORE​(IASTORE o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitICONST​(ICONST o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIDIV​(IDIV o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIF_ACMPEQ​(IF_ACMPEQ o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIF_ACMPNE​(IF_ACMPNE o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIF_ICMPEQ​(IF_ICMPEQ o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIF_ICMPGE​(IF_ICMPGE o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIF_ICMPGT​(IF_ICMPGT o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIF_ICMPLE​(IF_ICMPLE o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIF_ICMPLT​(IF_ICMPLT o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIF_ICMPNE​(IF_ICMPNE o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIFEQ​(IFEQ o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIFGE​(IFGE o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIFGT​(IFGT o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIFLE​(IFLE o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIFLT​(IFLT o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIFNE​(IFNE o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIFNONNULL​(IFNONNULL o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIFNULL​(IFNULL o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIINC​(IINC o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitILOAD​(ILOAD o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIMUL​(IMUL o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitINEG​(INEG o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitINSTANCEOF​(INSTANCEOF o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitINVOKEDYNAMIC​(INVOKEDYNAMIC o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitINVOKEINTERFACE​(INVOKEINTERFACE o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitINVOKESPECIAL​(INVOKESPECIAL o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitINVOKESTATIC​(INVOKESTATIC o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitINVOKEVIRTUAL​(INVOKEVIRTUAL o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIOR​(IOR o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIREM​(IREM o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIRETURN​(IRETURN o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitISHL​(ISHL o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitISHR​(ISHR o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitISTORE​(ISTORE o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitISUB​(ISUB o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIUSHR​(IUSHR o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitIXOR​(IXOR o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitJSR​(JSR o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitJSR_W​(JSR_W o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitL2D​(L2D o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitL2F​(L2F o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitL2I​(L2I o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLADD​(LADD o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLALOAD​(LALOAD o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLAND​(LAND o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLASTORE​(LASTORE o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLCMP​(LCMP o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLCONST​(LCONST o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLDC​(LDC o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLDC_W​(LDC_W o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLDC2_W​(LDC2_W o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLDIV​(LDIV o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLLOAD​(LLOAD o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLMUL​(LMUL o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLNEG​(LNEG o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLOOKUPSWITCH​(LOOKUPSWITCH o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLOR​(LOR o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLREM​(LREM o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLRETURN​(LRETURN o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLSHL​(LSHL o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLSHR​(LSHR o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLSTORE​(LSTORE o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLSUB​(LSUB o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLUSHR​(LUSHR o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitLXOR​(LXOR o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitMONITORENTER​(MONITORENTER o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitMONITOREXIT​(MONITOREXIT o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitMULTIANEWARRAY​(MULTIANEWARRAY o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitNEW​(NEW o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitNEWARRAY​(NEWARRAY o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitNOP​(NOP o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitPOP​(POP o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitPOP2​(POP2 o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitPUTFIELD​(PUTFIELD o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitPUTSTATIC​(PUTSTATIC o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitRET​(RET o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitRETURN​(RETURN o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitSALOAD​(SALOAD o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitSASTORE​(SASTORE o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitSIPUSH​(SIPUSH o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitSWAP​(SWAP o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      void visitTABLESWITCH​(TABLESWITCH o)
      Symbolically executes the corresponding Java Virtual Machine instruction.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait