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