RFR: 8282664: Unroll by hand StringUTF16 and StringLatin1 polynomial hash loops [v13]

Vladimir Ivanov vlivanov at openjdk.org
Sat Nov 12 02:06:33 UTC 2022


On Sat, 12 Nov 2022 00:55:56 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>> Claes Redestad has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Missing & 0xff in StringLatin1::hashCode
>
> src/hotspot/cpu/x86/x86_64.ad line 12081:
> 
>> 12079:   format %{ "Array HashCode byte[] $ary1,$cnt1 -> $result   // KILL all" %}
>> 12080:   ins_encode %{
>> 12081:     __ arrays_hashcode($ary1$$Register, $cnt1$$Register, $result$$Register,
> 
> What's the motivation to keep the stub code inlined instead of calling into a stand-alone pre-generated version of the stub?

Also, switching to stand-alone stubs would enable us to compose a generic stub version (as we do in `StubGenerator::generate_generic_copy()` for arraycopy stubs).  But it would be even better to do the dispatching on JDK side and always pass a constant into the intrinsic.

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

PR: https://git.openjdk.org/jdk/pull/10847


More information about the core-libs-dev mailing list