JIT自动内联的方法大小是多少? [英] What is the size of methods that JIT automatically inlines?

查看:122
本文介绍了JIT自动内联的方法大小是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我听说JIT自动内联小方法,比如getter(它们大约有5个字节)。边界是什么?是否有任何JVM标志?

I've heard that JIT automatically inlines small methods, like getters (they have about 5 bytes). What is the boundary? Is there any JVM flag?

推荐答案

HotSpot JIT内联策略相当复杂。它涉及许多启发式方法,如调用方法大小,被调用方法大小,IR节点数,内联深度,调用计数,调用站点数,投掷计数,方法签名等。

HotSpot JIT inlining policy is rather complicated. It involves many heuristics like caller method size, callee method size, IR node count, inlining depth, invocation count, call site count, throw count, method signatures etc.

一些对于访问器方法(getter / setter)和平凡方法(字节码计数小于6),跳过限制。

Some limits are skipped for accessor methods (getters/setters) and for trivial methods (bytecode count less than 6).

相关源代码主要位于 bytecodeInfo.cpp

参见 InlineTree :: try_to_inline should_inline should_not_inline functions。

The related source code is mostly in bytecodeInfo.cpp.
See InlineTree::try_to_inline, should_inline, should_not_inline functions.

控制内联的主要JVM标志是

The main JVM flags 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)

这篇关于JIT自动内联的方法大小是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆