org.apache.bcel.verifier.statics
Class Pass3aVerifier.InstOperandConstraintVisitor

java.lang.Object
  extended by org.apache.bcel.generic.EmptyVisitor
      extended by org.apache.bcel.verifier.statics.Pass3aVerifier.InstOperandConstraintVisitor
All Implemented Interfaces:
Visitor
Enclosing class:
Pass3aVerifier

private class Pass3aVerifier.InstOperandConstraintVisitor
extends EmptyVisitor

This visitor class does the actual checking for the instruction operand's constraints.


Field Summary
private  ConstantPoolGen cpg
          The ConstantPoolGen instance this Visitor operates on.
 
Constructor Summary
Pass3aVerifier.InstOperandConstraintVisitor(ConstantPoolGen cpg)
          The only Constructor.
 
Method Summary
private  void constraintViolated(Instruction i, java.lang.String message)
          A utility method to always raise an exeption.
private  void indexValid(Instruction i, int idx)
          A utility method to raise an exception if the index is not a valid constant pool index.
private  int max_locals()
          Utility method to return the max_locals value of the method verified by the surrounding Pass3aVerifier instance.
private  boolean objarrayequals(java.lang.Object[] o, java.lang.Object[] p)
          A utility method like equals(Object) for arrays.
 void visitALOAD(ALOAD o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitANEWARRAY(ANEWARRAY o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitASTORE(ASTORE o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitCHECKCAST(CHECKCAST o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitDLOAD(DLOAD o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitDSTORE(DSTORE o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitFieldInstruction(FieldInstruction o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitFLOAD(FLOAD o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitFSTORE(FSTORE o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitGETSTATIC(GETSTATIC o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitIINC(IINC o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitILOAD(ILOAD o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitINSTANCEOF(INSTANCEOF o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitInvokeInstruction(InvokeInstruction o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitINVOKEINTERFACE(INVOKEINTERFACE o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitINVOKESPECIAL(INVOKESPECIAL o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitINVOKESTATIC(INVOKESTATIC o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitINVOKEVIRTUAL(INVOKEVIRTUAL o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitISTORE(ISTORE o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitLDC(LDC o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitLDC2_W(LDC2_W o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitLLOAD(LLOAD o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitLoadClass(LoadClass o)
          Assures the generic preconditions of a LoadClass instance.
 void visitLOOKUPSWITCH(LOOKUPSWITCH o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitLSTORE(LSTORE o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitMULTIANEWARRAY(MULTIANEWARRAY o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitNEW(NEW o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitNEWARRAY(NEWARRAY o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitPUTSTATIC(PUTSTATIC o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitRET(RET o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 void visitTABLESWITCH(TABLESWITCH o)
          Checks if the constraints of operands of the said instruction(s) are satisfied.
 
Methods inherited from class org.apache.bcel.generic.EmptyVisitor
visitAALOAD, visitAASTORE, visitACONST_NULL, visitAllocationInstruction, visitARETURN, visitArithmeticInstruction, visitArrayInstruction, visitARRAYLENGTH, visitATHROW, visitBALOAD, visitBASTORE, visitBIPUSH, visitBranchInstruction, visitBREAKPOINT, visitCALOAD, visitCASTORE, visitConstantPushInstruction, visitConversionInstruction, visitCPInstruction, visitD2F, visitD2I, visitD2L, visitDADD, visitDALOAD, visitDASTORE, visitDCMPG, visitDCMPL, visitDCONST, visitDDIV, visitDMUL, visitDNEG, visitDREM, visitDRETURN, visitDSUB, visitDUP_X1, visitDUP_X2, visitDUP, visitDUP2_X1, visitDUP2_X2, visitDUP2, visitExceptionThrower, visitF2D, visitF2I, visitF2L, visitFADD, visitFALOAD, visitFASTORE, visitFCMPG, visitFCMPL, visitFCONST, visitFDIV, visitFieldOrMethod, visitFMUL, visitFNEG, visitFREM, visitFRETURN, visitFSUB, visitGETFIELD, visitGOTO_W, visitGOTO, 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, visitIMPDEP1, visitIMPDEP2, visitIMUL, visitINEG, visitIOR, visitIREM, visitIRETURN, visitISHL, visitISHR, visitISUB, visitIUSHR, visitIXOR, visitJSR_W, visitJSR, visitJsrInstruction, visitL2D, visitL2F, visitL2I, visitLADD, visitLALOAD, visitLAND, visitLASTORE, visitLCMP, visitLCONST, visitLDIV, visitLMUL, visitLNEG, visitLoadInstruction, visitLocalVariableInstruction, visitLOR, visitLREM, visitLRETURN, visitLSHL, visitLSHR, visitLSUB, visitLUSHR, visitLXOR, visitMONITORENTER, visitMONITOREXIT, visitNOP, visitPOP, visitPOP2, visitPopInstruction, visitPushInstruction, visitPUTFIELD, visitRETURN, visitReturnInstruction, visitSALOAD, visitSASTORE, visitSelect, visitSIPUSH, visitStackConsumer, visitStackInstruction, visitStackProducer, visitStoreInstruction, visitSWAP, visitTypedInstruction, visitUnconditionalBranch, visitVariableLengthInstruction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cpg

private ConstantPoolGen cpg
The ConstantPoolGen instance this Visitor operates on.

Constructor Detail

Pass3aVerifier.InstOperandConstraintVisitor

Pass3aVerifier.InstOperandConstraintVisitor(ConstantPoolGen cpg)
The only Constructor.

Method Detail

max_locals

private int max_locals()
Utility method to return the max_locals value of the method verified by the surrounding Pass3aVerifier instance.


constraintViolated

private void constraintViolated(Instruction i,
                                java.lang.String message)
A utility method to always raise an exeption.


indexValid

private void indexValid(Instruction i,
                        int idx)
A utility method to raise an exception if the index is not a valid constant pool index.


visitLoadClass

public void visitLoadClass(LoadClass o)
Assures the generic preconditions of a LoadClass instance. The referenced class is loaded and pass2-verified.

Specified by:
visitLoadClass in interface Visitor
Overrides:
visitLoadClass in class EmptyVisitor

visitLDC

public void visitLDC(LDC o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitLDC in interface Visitor
Overrides:
visitLDC in class EmptyVisitor

visitLDC2_W

public void visitLDC2_W(LDC2_W o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitLDC2_W in interface Visitor
Overrides:
visitLDC2_W in class EmptyVisitor

visitFieldInstruction

public void visitFieldInstruction(FieldInstruction o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitFieldInstruction in interface Visitor
Overrides:
visitFieldInstruction in class EmptyVisitor

visitInvokeInstruction

public void visitInvokeInstruction(InvokeInstruction o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitInvokeInstruction in interface Visitor
Overrides:
visitInvokeInstruction in class EmptyVisitor

visitINSTANCEOF

public void visitINSTANCEOF(INSTANCEOF o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitINSTANCEOF in interface Visitor
Overrides:
visitINSTANCEOF in class EmptyVisitor

visitCHECKCAST

public void visitCHECKCAST(CHECKCAST o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitCHECKCAST in interface Visitor
Overrides:
visitCHECKCAST in class EmptyVisitor

visitNEW

public void visitNEW(NEW o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitNEW in interface Visitor
Overrides:
visitNEW in class EmptyVisitor

visitMULTIANEWARRAY

public void visitMULTIANEWARRAY(MULTIANEWARRAY o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitMULTIANEWARRAY in interface Visitor
Overrides:
visitMULTIANEWARRAY in class EmptyVisitor

visitANEWARRAY

public void visitANEWARRAY(ANEWARRAY o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitANEWARRAY in interface Visitor
Overrides:
visitANEWARRAY in class EmptyVisitor

visitNEWARRAY

public void visitNEWARRAY(NEWARRAY o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitNEWARRAY in interface Visitor
Overrides:
visitNEWARRAY in class EmptyVisitor

visitILOAD

public void visitILOAD(ILOAD o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitILOAD in interface Visitor
Overrides:
visitILOAD in class EmptyVisitor

visitFLOAD

public void visitFLOAD(FLOAD o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitFLOAD in interface Visitor
Overrides:
visitFLOAD in class EmptyVisitor

visitALOAD

public void visitALOAD(ALOAD o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitALOAD in interface Visitor
Overrides:
visitALOAD in class EmptyVisitor

visitISTORE

public void visitISTORE(ISTORE o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitISTORE in interface Visitor
Overrides:
visitISTORE in class EmptyVisitor

visitFSTORE

public void visitFSTORE(FSTORE o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitFSTORE in interface Visitor
Overrides:
visitFSTORE in class EmptyVisitor

visitASTORE

public void visitASTORE(ASTORE o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitASTORE in interface Visitor
Overrides:
visitASTORE in class EmptyVisitor

visitIINC

public void visitIINC(IINC o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitIINC in interface Visitor
Overrides:
visitIINC in class EmptyVisitor

visitRET

public void visitRET(RET o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitRET in interface Visitor
Overrides:
visitRET in class EmptyVisitor

visitLLOAD

public void visitLLOAD(LLOAD o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitLLOAD in interface Visitor
Overrides:
visitLLOAD in class EmptyVisitor

visitDLOAD

public void visitDLOAD(DLOAD o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitDLOAD in interface Visitor
Overrides:
visitDLOAD in class EmptyVisitor

visitLSTORE

public void visitLSTORE(LSTORE o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitLSTORE in interface Visitor
Overrides:
visitLSTORE in class EmptyVisitor

visitDSTORE

public void visitDSTORE(DSTORE o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitDSTORE in interface Visitor
Overrides:
visitDSTORE in class EmptyVisitor

visitLOOKUPSWITCH

public void visitLOOKUPSWITCH(LOOKUPSWITCH o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitLOOKUPSWITCH in interface Visitor
Overrides:
visitLOOKUPSWITCH in class EmptyVisitor

visitTABLESWITCH

public void visitTABLESWITCH(TABLESWITCH o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitTABLESWITCH in interface Visitor
Overrides:
visitTABLESWITCH in class EmptyVisitor

visitPUTSTATIC

public void visitPUTSTATIC(PUTSTATIC o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitPUTSTATIC in interface Visitor
Overrides:
visitPUTSTATIC in class EmptyVisitor

visitGETSTATIC

public void visitGETSTATIC(GETSTATIC o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitGETSTATIC in interface Visitor
Overrides:
visitGETSTATIC in class EmptyVisitor

visitINVOKEINTERFACE

public void visitINVOKEINTERFACE(INVOKEINTERFACE o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitINVOKEINTERFACE in interface Visitor
Overrides:
visitINVOKEINTERFACE in class EmptyVisitor

visitINVOKESPECIAL

public void visitINVOKESPECIAL(INVOKESPECIAL o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitINVOKESPECIAL in interface Visitor
Overrides:
visitINVOKESPECIAL in class EmptyVisitor

visitINVOKESTATIC

public void visitINVOKESTATIC(INVOKESTATIC o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitINVOKESTATIC in interface Visitor
Overrides:
visitINVOKESTATIC in class EmptyVisitor

visitINVOKEVIRTUAL

public void visitINVOKEVIRTUAL(INVOKEVIRTUAL o)
Checks if the constraints of operands of the said instruction(s) are satisfied.

Specified by:
visitINVOKEVIRTUAL in interface Visitor
Overrides:
visitINVOKEVIRTUAL in class EmptyVisitor

objarrayequals

private boolean objarrayequals(java.lang.Object[] o,
                               java.lang.Object[] p)
A utility method like equals(Object) for arrays. The equality of the elements is based on their equals(Object) method instead of their object identity.