In short: it is to copy the code of the target method into the method that initiates the call, so as to avoid the occurrence of real method call, which is one of the most important optimization methods of the compiler. In addition to eliminating the cost of method call, it is more important to establish a good foundation for other optimization methods In Java, only private methods replaced by the Invokespecial directive, instance constructors, superclass methods and static methods decorated with Invokestatic are parsed at compile time. In addition to the above methods (not including final methods), all need to be run time for polymorphic selection Choose the
In short, With the exception of private methods, instance constructors, superclassers, and static methods that use the Invokestatic modifier, method inlining is only done when final modifiers are used, declaring a method to be an inlined function (but that’s up to the JVM, which decides how to inline methods). If the method body is large, there is a significant time and space overhead for inline expansion. If the function body contains recursion, it can cause infinite compilation of the compiler in some compilers
CMS 1.5
Serial Old 1.5
Parallel old 1.6
G1 1.7
In the class parsing phase, there are: 1, class or interface parsing 2, field parsing 3, class method parsing 4, interface method parsing
During the initialization phase of the class, this happens: In the preparation phase, the variable has been assigned the initial value required by the system, In the initialization phase, class variables are initialized according to the subjective plan made by the programmer through the program: the initialization phase is the process of executing the class constructor Clinit, which is generated by the compiler automatically collecting the assignment action of all class variables in the class he static statement block
Ini object member variable that is not a class variable and must be available after the object is instantiated. Class variables, not object member variables, are assigned initial values at class load time.