RFR: 8302850: Implement C1 clone intrinsic that reuses arraycopy code for primitive arrays [v7]
Dean Long
dlong at openjdk.org
Thu Apr 4 20:00:12 UTC 2024
On Wed, 3 Apr 2024 08:40:25 GMT, Galder Zamarreño <galder at openjdk.org> wrote:
>> I was able to remove the clone-specific logic in invoke() in two parts:
>>
>> 1. fix the type_is_exact logic to allow array receiver
>> 2. move primitive array receiver check into append_alloc_array_copy
>
>> You're right about holder_known, but why do you need to check for _clone specifically at line 2137? If there is logic missing that prevents an inlining attempt then I think it should be fixed first, rather than in a followup.
>
> I added that check because none of the conditions in that `if` statement satisfied the situations in which `clone` calls are optimized. For the example I gave above, `code == Bytecodes::_invokevirtual` is true and `target->is_final_method()` is false. So that's why I added `clone` specifically.
>
>> I was able to remove the clone-specific logic in invoke() in two parts:
>>
>> 1. fix the type_is_exact logic to allow array receiver
>> 2. move primitive array receiver check into append_alloc_array_copy
>
> Great! I assume you also solved the clone check in line 2137?
>
> How do we add your work on top of mine? Do I cherry pick the commit(s) from a branch of yours? Or some other way?
I'll prepare a branch for you to try.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17667#discussion_r1552348280
More information about the hotspot-compiler-dev
mailing list