What is the method size of Java – JIT automatic inlining?

I've heard about JIT auto inlining small methods, such as getters (they have about 5 bytes) What is the boundary? Is there a JVM flag?

Solution

The hotspot JIT inline strategy is quite complex It involves many heuristic methods, such as call method size, called method size, IR node count, inline depth, call count, call site count, throw count, method signature, etc

For accessor methods (getter / setter) and normal methods (bytecode count less than 6), some restrictions are skipped

Most of the relevant source code is in bytecodeinfo cpp. See inlinetree:: try_ to_ inline,should_ inline,should_ not_ Inline function

The main JVM flags used to control inlining are

-XX:MaxInlineLevel (maximum number of nested calls that are inlined)
-XX:MaxInlineSize (maximum bytecode size of a method to be inlined)
-XX:FreqInlineSize (maximum bytecode size of a frequent method to be inlined)
-XX:MaxTrivialSize (maximum bytecode size of a trivial method to be inlined)
-XX:MinInliningThreshold (min. invocation count a method needs to have to be inlined)
-XX:LiveNodeCountInliningCutoff (max number of live nodes in a method)
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>