RFR: 8306842: Classfile API performance improvements [v7]

Claes Redestad redestad at openjdk.org
Tue May 16 22:02:51 UTC 2023


On Tue, 16 May 2023 15:17:13 GMT, Chen Liang <liach at openjdk.org> wrote:

>> src/java.base/share/classes/jdk/internal/classfile/impl/StackMapDecoder.java line 83:
>> 
>>> 81:             vtis = new VerificationTypeInfo[methodType.parameterCount()];
>>> 82:         }
>>> 83:         for(var arg : methodType.parameterList()) {
>> 
>> `MethodTypeDesc::parameterList` copies the internal `ClassDesc[]`, so desugaring loop from `0` to `mdesc.parameterCount()` might be a small improvement for this and a few other cases.
>
> I plan to share a backing list in #13186, with API additions so users can avoid copying their input immutable parameter list as well. I see no reason to use a direct array, for MTD is not passed to and used by the VM, unlike MethodType.

Good, I think it makes perfect sense for the MTD parameter list to be immutable and shareable without copying.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13671#discussion_r1195727321


More information about the core-libs-dev mailing list