On Tue, 16 May 2023 15:17:13 GMT, Chen Liang <[email protected]> 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