RFR: 8302850: Implement C1 clone intrinsic that reuses arraycopy code for primitive arrays [v7]
Galder Zamarreño
galder at openjdk.org
Mon Mar 25 09:51:26 UTC 2024
On Thu, 21 Mar 2024 03:01:24 GMT, Dean Long <dlong at openjdk.org> wrote:
> I don't think target-specific logic belongs here. And I don't understand the point about Phi nodes. Isn't the holder_known flag enough?
In my testing `holder_known` was not enough to detect objects that are not Phi. For example:
static int[] test(int[] ints)
{
return ints.clone();
}
`holder_known` is false when it tries to C1 compile `ints.clone()`, am I missing something here?
> For primitive arrays, isn't it true that inline_target->get_Method()->intrinsic_id() == vmIntrinsics::_clone?
Possibly, but in this part of the logic I'm trying to find situations in which I don't want to apply the `clone` intrinsic. And those situations are non-array objects, and for arrays, those whose elements are not primitives. I don't see how I can craft such a condition with only `inline_target->get_Method()->intrinsic_id() == vmIntrinsics::_clone`? IOW, that condition might be true for primitive arrays, but is it false for non-array objects and non-primitive arrays?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17667#discussion_r1537319131
More information about the hotspot-compiler-dev
mailing list