<i18n dev> RFR: 8332826: Make hashCode methods in ArraysSupport friendlier [v2]

Pavel Rappo prappo at openjdk.org
Wed May 29 09:21:02 UTC 2024


On Tue, 28 May 2024 20:21:34 GMT, Claes Redestad <redestad at openjdk.org> wrote:

>> test/hotspot/jtreg/compiler/intrinsics/TestArraysHashCode.java line 88:
>> 
>>> 86:     private static int testIntrinsic(byte[] bytes, int type)
>>> 87:             throws InvocationTargetException, IllegalAccessException {
>>> 88:         return (int) vectorizedHashCode.invoke(null, bytes, 0, 256, 1, type);
>> 
>> Better to just call `hashCodeOfUnsigned` here I think.
>> 
>> The test for the non-constant type could be dropped. That is no longer a part of the 'API' of `ArraySupport`. It looks like the intrinsic bails out when the basic type is not constant any ways: https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/library_call.cpp#L6401-L6404
>
> The non-constant test was added because that very bailout caused a crash. The other test is actually less interesting since it'll likely be covered indirectly by regular use. But as we are hiding these away this gets ever more obscure and perhaps the test could be dropped entirely.

@cl4es, do you want me to delete that test file altogether?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19414#discussion_r1618536122


More information about the i18n-dev mailing list