JIT C2方法最大大小 [英] JIT C2 method maximum size

查看:41
本文介绍了JIT C2方法最大大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有JIT C2可以编译的最大方法. 假设有一个方法可以将一个类映射到另一个类,但是该类包含许多字段.它变得很热,C1对其进行了优化,但是在某个时候C2会启动.如果字节码足够长,C2会忽略该方法而不编译吗? 我找不到任何答案.也许没有这样的事情?

解决方案

JIT编译器有很多限制.

其中之一是HugeMethodLimit等于8000,并且在产品JVM构建中不可调整.字节码超过8000个字节的方法将不会被C2或C1编译.可以使用-XX:-DontCompileHugeMethods来关闭此限制.

如果IR节点的总数(不是字节码的字节数)达到80000,C2也可以停止较小方法的编译.可以使用(C2特定选项)调整此限制.

还有许多其他阈值(请参见 1 解决方案

There are a number of JIT compiler limits.

One of them is HugeMethodLimit equal to 8000 and not tunable in product JVM builds. The methods with more than 8000 bytes of bytecode will not be compiled, neither by C2 nor by C1. This limit can be turned off with -XX:-DontCompileHugeMethods.

C2 can also cease compilation of smaller methods, if the total number of IR nodes (not bytes of bytecode) reaches 80000. This limit can be tuned with -XX:MaxNodeLimit (C2-specific option).

There many other thresholds (see 1, 2) that affect inlining and certain JIT optimizations.

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

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