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

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


On Sat, 17 Aug 2024 12:38:15 GMT, Chen Liang <liach at openjdk.org> wrote:

>> I have tested that `()A` will report an error. If length == 1, rely on Wrapper.forBasicType to detect illegal input.
>
> We just exposed an internal exception behavior to public. Might add in wrapper.forBasicType that this IAE is part of public API.

I've added a return type check for length == 1, and now the error behavior is the same as before.

>> Now this version merges the loops, your suggestion doesn't handle paramIndex >= 8, and it won't be faster, the current version of skipOverFieldSignature performs well enough.
>
> Hmm? I mean this block can be a new method (the cur pointer moving part) and replace existing skipOver call that does extra validation

I refactored the skipOverFieldSignature method and used the structure you mentioned above, so that the code is more concise.

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

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


More information about the core-libs-dev mailing list