Multiple method build in classBuilder
Øystein Myhre Andersen
o.myhre at gmail.com
Fri Jul 26 16:32:10 UTC 2024
Really, that's how it's supposed to work.
Then I learned something new today.
Thank you !
On Fri, Jul 26, 2024 at 5:17 PM Maurizio Cimadamore <
maurizio.cimadamore at oracle.com> wrote:
> I think this is as expected? E.g. by default the classfile API will
> consider all jumps to be "short jumps" (e.g. "goto" instead of "goto_w").
>
> If that fails (e.g. because the code is too big), code generation is
> "replayed", this time using "long jumps" (e.g. "goto_w" instead of "goto").
>
> This is why you see the consumer being called twice.
>
> Maurizio
>
> On 26/07/2024 10:35, Øystein Myhre Andersen wrote:
> > The attached code contains the building of a class with one method
> '_STM'.
> > When the method gets too big, more than 32,767 bytes, a weird
> > situation occurs.
> >
> > Look at lines 93-94: Here the size of the code can be changed.
> > When the code is greater than 32,767 (caseBlockSize = 13000)
> > the Method 'buildMethod_STM' is called twice with different
> > CodeBuilders !!!
> >
> > When caseBlockSize = 10000 everything is OK.
> >
> > There must be something wrong here.
> >
> > - Øystein Myhre Andersen
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/classfile-api-dev/attachments/20240726/5e943261/attachment.htm>
More information about the classfile-api-dev
mailing list