RFR: 8338546: Speed up ConstantPoolBuilder::classEntry(ClassDesc) [v3]

Chen Liang liach at openjdk.org
Tue Sep 17 02:04:51 UTC 2024


On Sun, 15 Sep 2024 19:08:00 GMT, ExE Boss <duke at openjdk.org> wrote:

>> Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 15 commits:
>> 
>>  - Fix build
>>  - Merge branch 'master' of https://github.com/openjdk/jdk into feature/classentry-speedup
>>  - Buggy 2nd attempt - crashes hotspot
>>  - Merge branch 'master' of https://github.com/openjdk/jdk into feature/classentry-speedup
>>  - Merge branch 'master' of https://github.com/openjdk/jdk into feature/classentry-speedup
>>  - More conflicts
>>  - Merge branch 'master' of https://github.com/openjdk/jdk into feature/classentry-speedup
>>  - Merge branch 'master' of https://github.com/openjdk/jdk into feature/classentry-speedup
>>  - Merge branch 'master' of https://github.com/openjdk/jdk into feature/classentry-speedup
>>  - Another bug in benchmark
>>  - ... and 5 more: https://git.openjdk.org/jdk/compare/996790c7...6117a5bd
>
> src/java.base/share/classes/jdk/internal/classfile/impl/AbstractPoolEntry.java line 559:
> 
>> 557:     public static final class ClassEntryImpl extends AbstractNamedEntry implements ClassEntry {
>> 558: 
>> 559:         public @Stable ClassDesc sym;
> 
> As [GH‑20957] has now been merged, this can be made to use the `Utf8Entry​.typeSym` field, which would also speed up [`ConstantPoolBuilder​::classEntry​(Utf8Entry)`].
> 
> [GH‑20957]: https://github.com/openjdk/jdk/pull/20957
> [`ConstantPoolBuilder​::classEntry​(Utf8Entry)`]: https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/classfile/constantpool/ConstantPoolBuilder.html#classEntry(java.lang.classfile.constantpool.Utf8Entry)

I prefer not to use that field for internal name utf8 entries; that is reserved for descriptor matches, so I reuse only for arrays.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20667#discussion_r1760363776


More information about the core-libs-dev mailing list