On Tue, 16 Jan 2024 12:09:11 GMT, Jatin Bhateja <jbhat...@openjdk.org> wrote:
>> Scott Gibbons has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 22 commits: >> >> - Merge branch 'openjdk:master' into indexof >> - Merge branch 'openjdk:master' into indexof >> - Addressing review comments. >> - Fix for JDK-8321599 >> - Support UU IndexOf >> - Only use optimization when EnableX86ECoreOpts is true >> - Fix whitespace >> - Merge branch 'openjdk:master' into indexof >> - Comments; added exhaustive-ish test >> - Subtracting 0x10 twice. >> - ... and 12 more: https://git.openjdk.org/jdk/compare/8e12053e...3e58d0c2 > > src/hotspot/share/opto/library_call.cpp line 1229: > >> 1227: } else { >> 1228: result = make_indexOf_node(src_start, src_count, tgt_start, >> tgt_count, >> 1229: result_rgn, result_phi, ae); > > Existing routines emits IR to handle following special cases. > > tgt_cnt > src_cnt return -1 > tgt_cnt == 0 return 0. > > Should we not be preserving those check before calling stub ? > > As of now these checks are part of stub and doing them in JIT code will save > call overhead. Working on this. Trying to develop my IR chops. However, this is optimizing for a very small percentage of calls, so there will be unnoticable effect on overall performance. There will only be savings for calls that have needle length == 0 (probably zero calls do this) or haystack length < needle length (maybe, but highly unlikely). ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16753#discussion_r1604010493