Allocation of array copy can be eliminated in particular cases
Vladimir Ivanov
vladimir.x.ivanov at oracle.com
Wed Nov 20 15:34:05 UTC 2019
>> I haven't looked into the benchmarks you mentioned, but it looks like
>> cloned_array.length access is not the reason why cloned array is still
>> there.
>
> We don't eliminate array allocations that doesn't have a known length
> because they might cause a NegativeArraySize Exception. In this case we
> should be able to prove that the length is positive though.
Good point, Nils!
Yes, in this particular case the length is always non-negative.
So, the guard you are working on will go away right away.
Best regards,
Vladimir Ivanov
More information about the hotspot-compiler-dev
mailing list