On Tue, 30 Apr 2024 12:05:46 GMT, Chen Liang <li...@openjdk.org> wrote:

>> Adam Sotona has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   added bug number
>
> src/java.base/share/classes/jdk/internal/classfile/impl/BoundAttribute.java 
> line 996:
> 
>> 994:     public static AttributeMapper<?> standardAttribute(Utf8Entry name) {
>> 995:         // critical bootstrap path, so no lambdas nor method handles 
>> here
>> 996:         return switch (name.hashCode()) {
> 
> I think we can safely switch over strings, as they are compiled to hashCode 
> switch like what you explicitly have right now. Isn't that the case?

Freshly parsed Utf8Entries conversion to String is expensive and unnecessary. 
We should be very careful when to ask for the conversion as it significantly 
affects some benchmarks.

> test/jdk/jdk/classfile/AttributesTest.java line 26:
> 
>> 24: /*
>> 25:  * @test
>> 26:  * @summary Testing Attributes API.
> 
> Can add a line `@bug 8331291`

Added, thank you.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19006#discussion_r1584696556
PR Review Comment: https://git.openjdk.org/jdk/pull/19006#discussion_r1584707230

Reply via email to