Joh*_*hnD 6 java jit jvm jvm-hotspot
我听说JIT自动内联小方法,比如getter(它们大约有5个字节).边界是什么?有没有JVM标志?
apa*_*gin 13
HotSpot JIT内联策略相当复杂.它涉及许多启发式方法,如调用方法大小,被调用方法大小,IR节点计数,内联深度,调用计数,调用站点计数,投掷计数,方法签名等.
对于访问器方法(getter/setter)和普通方法(字节码计数小于6),会跳过某些限制.
相关的源代码主要在bytecodeInfo.cpp中.
见InlineTree::try_to_inline,should_inline,should_not_inline等功能.
用于控制内联的主要JVM标志是
-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)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1659 次 |
| 最近记录: |