RFR: 8338532: Speed up the ClassFile API MethodTypeDesc#ofDescriptor

Shaojin Wen duke at openjdk.org
Mon Aug 19 06:32:25 UTC 2024


On Sun, 18 Aug 2024 21:32:46 GMT, Shaojin Wen <duke at openjdk.org> wrote:

>> src/java.base/share/classes/jdk/internal/constant/MethodTypeDescImpl.java line 137:
>> 
>>> 135:         var returnType = resolveClassDesc(descriptor, rightBracket + 1, retTypeLength);
>>> 136:         if (length == 3 && returnType == CD_void) {
>>> 137:             return Constants.MTD_void;
>> 
>> Feels a bit like overfitting with quite limited data.
>> 
>> Could this use `ConstantDescs.MTD_void` instead or does that cause a bootstrap cycle?
>
> Using ConstantDescs.MTD_void can also solve the bootstrap cycle, good idea, I have fixed it

I think it is worthwhile to optimize the bootstrap scenario with less cost for other scenarios.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20611#discussion_r1721065312


More information about the core-libs-dev mailing list