[External] : Re: JDK-8268622 - Performance issues in javac `Name` class

Archie Cobbs archie.cobbs at gmail.com
Mon Mar 6 23:14:44 UTC 2023


Actually, it appears what the JVMS allows changed (i.e., got stricter) in
classfile version 47.

Here's the relevant hotspot code.
<https://github.com/openjdk/jdk/blob/f64ed09e9a674a38f03f1e27e56fb19d72939ba1/src/hotspot/share/utilities/utf8.cpp#L332-L392>

So the compiler should probably mirror that logic.

-Archie

On Mon, Mar 6, 2023 at 4:07 PM Archie Cobbs <archie.cobbs at gmail.com> wrote:

> On Mon, Mar 6, 2023 at 4:01 PM Jonathan Gibbons <
> jonathan.gibbons at oracle.com> wrote:
>
>> More on changing PoolReader ... ideally, this should be tied back to
>> details in JVMS, and/or the spec updated to define the expected behavior of
>> the VM and javac for similar but different equivalent names.
>>
> Funny you should mention it :) See the PR I just filed (link
> <https://github.com/openjdk/jdk/pull/12893>), quoting:
>
>> JVMS §4.4.7 describes "Modified UTF-8" for encoded strings, and it does
>> not allow for non-standard encodings. Instead, you'll get something like
>> this:
>>
>> $ java Test
>> Error: LinkageError occurred while loading main class Test
>> 	java.lang.ClassFormatError: Illegal UTF8 string in constant pool in class file Test
>>
>> So the compiler should also reject any invalid classfiles containing them.
>>
> -Archie
> --
> Archie L. Cobbs
>


-- 
Archie L. Cobbs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/compiler-dev/attachments/20230306/aacdeb52/attachment.htm>


More information about the compiler-dev mailing list