JIT C2 method maximum size

依然范特西╮ 提交于 2020-05-09 08:04:11

问题


I was wondering if there is a method maximum size for JIT C2 to compile it. Let's assume there is a method which just maps one class to another, but this class contains a lot of fields. It became hot, C1 optimizes it but at some point C2 will kick in. If byte code is long enough, will C2 ignore that method and do not compile it? I couldn't find any answer for my question. Maybe there is not such a thing?


回答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.



来源:https://stackoverflow.com/questions/57005557/jit-c2-method-maximum-size

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!