On Sun, 22 Sep 2024 14:14:11 GMT, Shaojin Wen <s...@openjdk.org> wrote:

>> stack.length may be larger than stackSize. In this case, the length of the 
>> array copied by clone will be longer than Arrays.copyOf. However, I have no 
>> evidence that Arrays.copyOf is faster than clone.
>
> I found through debugging that in the `target.flags == -1` branch of 
> checkAssignableTo, `localsSize > 0 and stackSize = 0` are always, so I made 
> this optimization.

`stackSize` always has to be less than or equal to `stack.length`; this is just 
like `ArrayList`, where `stackSize` is the size and `stack.length` is capacity.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21121#discussion_r1770565183

Reply via email to