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

Jonathan Gibbons jonathan.gibbons at oracle.com
Mon Mar 6 23:15:08 UTC 2023


Yes, as a general rule, the compiler and runtime should be mutually 
consistent.

This discussion probably also applies to javac reading names in source 
files and having those names propagate to class files.

-- Jon


On 3/6/23 3:07 PM, Archie Cobbs 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://urldefense.com/v3/__https://github.com/openjdk/jdk/pull/12893__;!!ACWV5N9M2RV99hQ!ISI9uy1X6lKTbsrTk8a0Y6vFyGFZc8MWhHsrhGsOhQycEB5EfevTYiXZlgu7BiSlFArVXPkX-JOfD6APKlBPht6Yo9g$>), 
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/compiler-dev/attachments/20230306/4c7d5b09/attachment-0001.htm>


More information about the compiler-dev mailing list