What is the size of methods that JIT automatically inlines?(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
函数.
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 自动内联的方法的大小是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:JIT 自动内联的方法的大小是多少?
基础教程推荐
- Java:带有char数组的println给出乱码 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 降序排序:Java Map 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01