Verify Java classes, links

 

1. Verify

Is essentially just a sequence of bytes byte code file, the byte sequence is not necessarily a result of the Javac after compiling, for example, can create a suffix .class files or modify existing content and so on, so from a security point of view, JVM usually achieve a .class file checker. class file check is the first step in the process of class loading, this step will basically .class file for a very comprehensive check, such as the structure is correct (such as the number of beginning 0xCAFEBABE magic), semantics is reasonable (method signature, and other information can not be multiple inheritance), the byte stream and the stack and the stack frame using the inspection (such as the need to have a local variable declarations, must be unique, and the value must be the same type, etc.) and the like.

2, the information storage class

 After verification by the .class files, the JVM class which could parse and extract the associated binary data stored in the internal structure Metaspace in this step such information has been loaded in the Metaspace.

 

Guess you like

Origin www.cnblogs.com/mazhimazhi/p/11418542.html