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:14:59 UTC 2024
On Tue, 23 Apr 2024 09:01:57 GMT, Galder Zamarreño <galder at openjdk.org> wrote:
>> test/hotspot/jtreg/compiler/c1/TestNullArrayClone.java line 26:
>>
>>> 24: /*
>>> 25: * @test
>>> 26: * @bug 8302850
>>
>> please add @summary
>> is the purpose of the test to check that array clone throws NPE for null input and does not throw otherwise?
>> Don't we want to check the contents of the copied data?
>> Don't we want to check different sizes and array types?
>> Is 1K iterations enough to compile the method?
>
>> 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?
Added brief test summary.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17667#discussion_r1575916707
More information about the hotspot-compiler-dev
mailing list