RFR: 8320448: Accelerate IndexOf using AVX2 [v43]
Volodymyr Paprotski
duke at openjdk.org
Tue May 28 21:06:14 UTC 2024
On Tue, 28 May 2024 17:36:03 GMT, Scott Gibbons <sgibbons at openjdk.org> wrote:
>> src/hotspot/cpu/x86/c2_stubGenerator_x86_64_string.cpp line 488:
>>
>>> 486: __ cmpq(r11, nMinusK);
>>> 487: __ ja_b(L_return);
>>> 488: __ movq(rax, r11);
>>
>> At places where we know that return value in r11 is correct, we dont need to checkRange so this could have its own label.
>
> I don't want to change this because its reason for existence is to ensure we don't return a value that's beyond the end of the haystack. We don't yet have a good enough test to validate whether we're reading past the end of the haystack, so I like this as insurance.
I would recommend an experiment. Disable the range-check and run String/IndexOf.java test. Particularly run test4(), which is designed exactly to test the reads beyond the end.
It wont find all the bad reads, but right now if there are any failures, they are 'hidden' by this range-check.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/16753#discussion_r1617888680
More information about the core-libs-dev
mailing list