The HotSpot JIT installation policy is rather complicated. It includes many heuristics, such as caller method size, caller method size, number of IR node, depth of depth, number of calls, number of call sites, number of throws, method signatures, etc.
Some restrictions are skipped for accessors (getters / seters) and for trivial methods (the number of bytecodes is less than 6).
The related source code is mainly located in bytecodeInfo.cpp .
See InlineTree::try_to_inline Functions InlineTree::try_to_inline , should_inline , should_not_inline .
The main JVM flags for managing 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)
source share