RFR: 8302850: Implement C1 clone intrinsic that reuses arraycopy code for primitive arrays [v10]

Galder Zamarreño galder at openjdk.org
Tue Apr 23 09:04:32 UTC 2024


On Fri, 19 Apr 2024 05:32:10 GMT, Boris Ulasevich <bulasevich at openjdk.org> wrote:

> please add @summary

+1

> is the purpose of the test to check that array clone throws NPE for null input and does not throw otherwise?

I added this test to verify that null values for the array where handled correctly when the array clone call had been C1 compiled. I added this test at the time because I discovered a bug in the implementation and I had not seen any existing tests fail.

> Don't we want to check the contents of the copied data?
> Don't we want to check different sizes and array types?

Verifying the contents sounds good.

Different sizes and types sounds good as well, but what sizes would you choose? For the types, I would limit it to primitive types since the intrinsic is only implemented for those.

> Is 1K iterations enough to compile the method?

That seemed to be enough in my case to trigger the issue, what number should I use instead? I found `Tier3CompileThreshold` that is 2000, so maybe increase it to that just in case? Is there a way to verify from the test that the method has been C1 compiled before going ahead and invoking the method with null?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17667#discussion_r1575906297


More information about the hotspot-compiler-dev mailing list