do_verify()
| Modifier and Type | Class and Description |
|---|---|
| private class | Pass3aVerifier.InstOperandConstraintVisitor
This visitor class does the actual checking for the instruction operand's constraints. |
| Modifier and Type | Field and Description |
|---|---|
| private Code | code
The one and only Code object used by an instance of this class. |
| private InstructionList | instructionList
The one and only InstructionList object used by an instance of this class. |
| private final int | methodNo
The method number to verify. |
| private final Verifier | verifier
The Verifier that created this. |
| Access | Constructor and Description |
|---|---|
| public | Pass3aVerifier(final Verifier verifier, final int methodNo)
Should only be instantiated by a Verifier. |
| Modifier and Type | Method and Description |
|---|---|
| private static boolean | contains(final int[] ints, final int i)
A small utility method returning if a given int i is in the given int[] ints. |
| private void | delayedPass2Checks()
These are the checks that could be done in pass 2 but are delayed to pass 3 for performance reasons. |
| public VerificationResult | do_verify()
Implements abstract org. |
| public int | |
| private void | pass3StaticInstructionChecks()
These are the checks if constraints are satisfied which are described in the Java Virtual Machine Specification, Second Edition as Static Constraints on the instructions of Java Virtual Machine Code (chapter 4.8.1). |
| private void | pass3StaticInstructionOperandsChecks()
These are the checks for the satisfaction of constraints which are described in the Java Virtual Machine Specification, Second Edition as Static Constraints on the operands of instructions of Java Virtual Machine Code (chapter 4.8.1). |
| protected String |
| code | back to summary |
|---|---|
| private Code code The one and only Code object used by an instance of this class. It's here for performance reasons by do_verify() and its callees. | |
| instructionList | back to summary |
|---|---|
| private InstructionList instructionList The one and only InstructionList object used by an instance of this class. It's here for performance reasons by do_verify() and its callees. | |
| methodNo | back to summary |
|---|---|
| private final int methodNo The method number to verify. This is the index in the array returned by JavaClass.getMethods(). | |
| verifier | back to summary |
|---|---|
| private final Verifier verifier The Verifier that created this. | |
| Pass3aVerifier | back to summary |
|---|---|
| public Pass3aVerifier(final Verifier verifier, final int methodNo) Should only be instantiated by a Verifier. | |
| contains | back to summary |
|---|---|
| private static boolean contains(final int[] ints, final int i) A small utility method returning if a given int i is in the given int[] ints. | |
| delayedPass2Checks | back to summary |
|---|---|
| private void delayedPass2Checks() These are the checks that could be done in pass 2 but are delayed to pass 3 for performance reasons. Also, these checks need access to the code array of the Code attribute of a Method so it's okay to perform them here. Also see the description of the do_verify() method.
| |
| do_verify | back to summary |
|---|---|
| public VerificationResult do_verify() Implements abstract org. Pass 3a is the verification of static constraints of JVM code (such as legal targets of branch instructions). This is the part of pass 3 where you do not need data flow analysis. JustIce also delays the checks for a correct exception table of a Code attribute and correct line number entries in a LineNumberTable attribute of a Code attribute (which conceptually belong to pass 2) to this pass. Also, most of the check for valid local variable entries in a LocalVariableTable attribute of a Code attribute is delayed until this pass. All these checks need access to the code array of the Code attribute.
| |
| getMethodNo | back to summary |
|---|---|
| public int getMethodNo() Returns the method number as supplied when instantiating. | |
| pass3StaticInstructionChecks | back to summary |
|---|---|
| private void pass3StaticInstructionChecks() These are the checks if constraints are satisfied which are described in the Java Virtual Machine Specification, Second Edition as Static Constraints on the instructions of Java Virtual Machine Code (chapter 4.8.1).
| |
| pass3StaticInstructionOperandsChecks | back to summary |
|---|---|
| private void pass3StaticInstructionOperandsChecks() These are the checks for the satisfaction of constraints which are described in the Java Virtual Machine Specification, Second Edition as Static Constraints on the operands of instructions of Java Virtual Machine Code (chapter 4.8.1). BCEL parses the code array to create an InstructionList and therefore has to check some of these constraints. Additional checks are also implemented here.
| |
| tostring | back to summary |
|---|---|
| protected String tostring(final Object obj) This method is a slightly modified version of verifier.statics.StringRepresentation.toString(final Node obj) that accepts any Object, not just a Node. Returns the String representation of the Object obj; this is obj.toString() if it does not throw any RuntimeException, or else it is a string derived only from obj's class name. | |
| Modifier and Type | Field and Description |
|---|---|
| private final ConstantPoolGen | constantPoolGen
The ConstantPoolGen instance this Visitor operates on. |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private void | constraintViolated(final Instruction i, final String message)
A utility method to always raise an exception. |
| private Method | Returns: the referenced method or null if not found.the class that defines the referenced method jc, final InvokeInstruction the instruction that references the method invoke)Looks for the method referenced by the given invoke instruction in the given class. |
| private Method | Returns: the referenced method or null if not found.the class that defines the referenced method jc, final InvokeInstruction the instruction that references the method invoke)Looks for the method referenced by the given invoke instruction in the given class or its super classes and super interfaces. |
| private ObjectType | |
| private void | indexValid(final Instruction i, final int idx)
A utility method to raise an exception if the index is not a valid constant pool index. |
| private int | maxLocals()
Utility method to return the max_locals value of the method verified by the surrounding Pass3aVerifier instance. |
| public void | visitALOAD(final ALOAD o)
Overrides org. Implements org. |
| public void | visitANEWARRAY(final ANEWARRAY o)
Overrides org. Implements org. |
| public void | visitASTORE(final ASTORE o)
Overrides org. Implements org. |
| public void | visitCHECKCAST(final CHECKCAST o)
Overrides org. Implements org. |
| public void | visitDLOAD(final DLOAD o)
Overrides org. Implements org. |
| public void | visitDSTORE(final DSTORE o)
Overrides org. Implements org. |
| public void | visitFieldInstruction(final FieldInstruction o)
Overrides org. Implements org. |
| public void | visitFLOAD(final FLOAD o)
Overrides org. Implements org. |
| public void | visitFSTORE(final FSTORE o)
Overrides org. Implements org. |
| public void | visitGETSTATIC(final GETSTATIC o)
Overrides org. Implements org. |
| public void | visitIINC(final IINC o)
Overrides org. Implements org. |
| public void | visitILOAD(final ILOAD o)
Overrides org. Implements org. |
| public void | visitINSTANCEOF(final INSTANCEOF o)
Overrides org. Implements org. |
| public void | visitINVOKEDYNAMIC(final INVOKEDYNAMIC o)
Overrides org. Implements org. |
| public void | visitInvokeInstruction(final InvokeInstruction o)
Overrides org. Implements org. |
| public void | visitINVOKEINTERFACE(final INVOKEINTERFACE o)
Overrides org. Implements org. |
| public void | visitINVOKESPECIAL(final INVOKESPECIAL o)
Overrides org. Implements org. |
| public void | visitINVOKESTATIC(final INVOKESTATIC o)
Overrides org. Implements org. |
| public void | visitINVOKEVIRTUAL(final INVOKEVIRTUAL o)
Overrides org. Implements org. |
| public void | visitISTORE(final ISTORE o)
Overrides org. Implements org. |
| public void | visitLDC(final LDC ldc)
Overrides org. Implements org. |
| public void | visitLDC2_W(final LDC2_W o)
Overrides org. Implements org. |
| public void | visitLLOAD(final LLOAD o)
Overrides org. Implements org. |
| public void | visitLoadClass(final LoadClass loadClass)
Overrides org. Implements org. |
| public void | visitLOOKUPSWITCH(final LOOKUPSWITCH o)
Overrides org. Implements org. |
| public void | visitLSTORE(final LSTORE o)
Overrides org. Implements org. |
| public void | visitMULTIANEWARRAY(final MULTIANEWARRAY o)
Overrides org. Implements org. |
| public void | visitNEW(final NEW o)
Overrides org. Implements org. |
| public void | visitNEWARRAY(final NEWARRAY o)
Overrides org. Implements org. |
| public void | visitPUTSTATIC(final PUTSTATIC o)
Overrides org. Implements org. |
| public void | visitRET(final RET o)
Overrides org. Implements org. |
| public void | visitTABLESWITCH(final TABLESWITCH o)
Overrides org. Implements org. |
| constantPoolGen | back to summary |
|---|---|
| private final ConstantPoolGen constantPoolGen The ConstantPoolGen instance this Visitor operates on. | |
| InstOperandConstraintVisitor | back to summary |
|---|---|
| pack-priv InstOperandConstraintVisitor(final ConstantPoolGen constantPoolGen) The only Constructor. | |
| constraintViolated | back to summary |
|---|---|
| private void constraintViolated(final Instruction i, final String message) A utility method to always raise an exception. | |
| getMethod | back to summary |
|---|---|
| private Method getMethod(final JavaClass jc, final InvokeInstruction invoke) Looks for the method referenced by the given invoke instruction in the given class.
| |
| getMethodRecursive | back to summary |
|---|---|
| private Method getMethodRecursive(final JavaClass jc, final InvokeInstruction invoke) throws ClassNotFoundException Looks for the method referenced by the given invoke instruction in the given class or its super classes and super interfaces.
| |
| getObjectType | back to summary |
|---|---|
| private ObjectType getObjectType(final FieldInstruction o) | |
| indexValid | back to summary |
|---|---|
| private void indexValid(final Instruction i, final int idx) A utility method to raise an exception if the index is not a valid constant pool index. | |
| maxLocals | back to summary |
|---|---|
| private int maxLocals() Utility method to return the max_locals value of the method verified by the surrounding Pass3aVerifier instance. | |
| visitALOAD | back to summary |
|---|---|
| public void visitALOAD(final ALOAD o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitANEWARRAY | back to summary |
|---|---|
| public void visitANEWARRAY(final ANEWARRAY o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitASTORE | back to summary |
|---|---|
| public void visitASTORE(final ASTORE o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitCHECKCAST | back to summary |
|---|---|
| public void visitCHECKCAST(final CHECKCAST o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitDLOAD | back to summary |
|---|---|
| public void visitDLOAD(final DLOAD o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitDSTORE | back to summary |
|---|---|
| public void visitDSTORE(final DSTORE o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitFieldInstruction | back to summary |
|---|---|
| public void visitFieldInstruction(final FieldInstruction o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitFLOAD | back to summary |
|---|---|
| public void visitFLOAD(final FLOAD o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitFSTORE | back to summary |
|---|---|
| public void visitFSTORE(final FSTORE o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitGETSTATIC | back to summary |
|---|---|
| public void visitGETSTATIC(final GETSTATIC o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitIINC | back to summary |
|---|---|
| public void visitIINC(final IINC o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitILOAD | back to summary |
|---|---|
| public void visitILOAD(final ILOAD o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitINSTANCEOF | back to summary |
|---|---|
| public void visitINSTANCEOF(final INSTANCEOF o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitINVOKEDYNAMIC | back to summary |
|---|---|
| public void visitINVOKEDYNAMIC(final INVOKEDYNAMIC o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitInvokeInstruction | back to summary |
|---|---|
| public void visitInvokeInstruction(final InvokeInstruction o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitINVOKEINTERFACE | back to summary |
|---|---|
| public void visitINVOKEINTERFACE(final INVOKEINTERFACE o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitINVOKESPECIAL | back to summary |
|---|---|
| public void visitINVOKESPECIAL(final INVOKESPECIAL o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitINVOKESTATIC | back to summary |
|---|---|
| public void visitINVOKESTATIC(final INVOKESTATIC o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitINVOKEVIRTUAL | back to summary |
|---|---|
| public void visitINVOKEVIRTUAL(final INVOKEVIRTUAL o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitISTORE | back to summary |
|---|---|
| public void visitISTORE(final ISTORE o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitLDC | back to summary |
|---|---|
| public void visitLDC(final LDC ldc) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitLDC2_W | back to summary |
|---|---|
| public void visitLDC2_W(final LDC2_W o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitLLOAD | back to summary |
|---|---|
| public void visitLLOAD(final LLOAD o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitLoadClass | back to summary |
|---|---|
| public void visitLoadClass(final LoadClass loadClass) Overrides org. Implements org. Assures the generic preconditions of a LoadClass instance. The referenced class is loaded and pass2-verified.
| |
| visitLOOKUPSWITCH | back to summary |
|---|---|
| public void visitLOOKUPSWITCH(final LOOKUPSWITCH o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitLSTORE | back to summary |
|---|---|
| public void visitLSTORE(final LSTORE o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitMULTIANEWARRAY | back to summary |
|---|---|
| public void visitMULTIANEWARRAY(final MULTIANEWARRAY o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitNEW | back to summary |
|---|---|
| public void visitNEW(final NEW o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitNEWARRAY | back to summary |
|---|---|
| public void visitNEWARRAY(final NEWARRAY o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitPUTSTATIC | back to summary |
|---|---|
| public void visitPUTSTATIC(final PUTSTATIC o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitRET | back to summary |
|---|---|
| public void visitRET(final RET o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |
| visitTABLESWITCH | back to summary |
|---|---|
| public void visitTABLESWITCH(final TABLESWITCH o) Overrides org. Implements org. Checks if the constraints of operands of the said instruction(s) are satisfied.
| |