On Fri, 14 Oct 2022 23:12:38 GMT, Oliver Kopp <d...@openjdk.org> wrote:

>> Fix for [JDK-8240567](https://bugs.openjdk.org/browse/JDK-8240567): 
>> "MethodTooLargeException thrown while creating a jlink image".
>> 
>> Java still has a 64kb limit: A method may not be longer than 64kb. The idea 
>> of the fix is to split up the generated methods in several smaller methods
>
> Oliver Kopp has updated the pull request incrementally with two additional 
> commits since the last revision:
> 
>  - Begin to craft test
>  - Reduce comment text

Looking at the existing code (without the proposed changes in this PR), it 
appears that it's not just the number of `moduleInfos` that could impact the 
method size but even details like `requires`, `exports`, `opens` and other such 
details, since we loop over each of these details to construct the method body.

So would it be correct to say that even if this PR proposes to use a limit like 
99 to split it into multiple methods, it's still possible that the method size 
limit could be hit with a much lower number of `moduleInfos` (perhaps even 10?) 
if any of the other details of any of those `moduleInfo`s is a large number?

Is that something that should be considered/addressed as part of this change?

-------------

PR: https://git.openjdk.org/jdk/pull/10704

Reply via email to