How does JVM classfile verifier perform class verification ?
Could anyone please tell me the steps ?
How does JVM classfile verifier perform class verification ?
Could anyone please tell me the steps ?
There are four passes:
Basic Format Check (When Class is Loaded) - (magic number, check constant pool).
Additional Verification (When Linking) - Check final modifiers, check for direct subclasses, valid fields, check constant pool.
Bytecode Verification (When Linking) - Check the code array - operand stack is ok, local variables, correct method invocation, field assignment etc...
Virtual Pass (Code Invoked) - ensure referenced classes/methods exist and have the correct descriptors.
Full gory details here, see section 4.9.1 The Verification Process
http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html