RFR: 8350095: RISC-V: Refactor string_compare [v3]

Hamlin Li mli at openjdk.org
Fri Feb 21 14:48:12 UTC 2025


> Hi,
> Can you help to review this patch?
> 
> Currently, `string_compare` code is a bit complicated, main reasons include:
> 1. it has 2 piece of code respectively for LU and UL case, this is not necessary, basically LU and UL behaviour quite similar.
> 2. it mixed LL/UU and LU/UL case together, better to separate them, as they are quite different from each other.
> 
> This is not good for code reading and maintaining.
> 
> 
> So, this patch does following refactoring:
> 1. merge LU and UL code into one, i.e. remove UL code.
> 2. seperate the code into 2 methods:  LL/UU and LU/UL.
> 3. some other misc improvement.
> 
> I could do the following refactoring in another following pr, as in this pr I'm just moving code and removing code, it's easier to do it and review it. In particular the first one, as it needs to rewrite the existing code for UL/LU case.
> 1. move alignment code of `generate_compare_long_string_different_encoding` upwards to `string_compare_long_LU`.
> 2. make `SHORT_STRING` case simpler.
> 
> 
> 
> Thanks

Hamlin Li has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 11 additional commits since the last revision:

 - fix UL and test
 - Merge branch 'master' into refactor-string-compare
 - minor
 - fix temp registers; move code
 - blank lines
 - simplify
 - clean
 - merge UL and LU
 - move to functions
 - move alignment code of LL&UU down from common code path
 - ... and 1 more: https://git.openjdk.org/jdk/compare/b6520b23...4f5ae272

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/23633/files
  - new: https://git.openjdk.org/jdk/pull/23633/files/543c8635..4f5ae272

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=23633&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23633&range=01-02

  Stats: 19487 lines in 923 files changed: 13116 ins; 3380 del; 2991 mod
  Patch: https://git.openjdk.org/jdk/pull/23633.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23633/head:pull/23633

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


More information about the hotspot-compiler-dev mailing list