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

Hamlin Li mli at openjdk.org
Fri Feb 28 09:05:54 UTC 2025


On Fri, 28 Feb 2025 01:21:24 GMT, Fei Yang <fyang at openjdk.org> wrote:

>> Hamlin Li has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - check short string
>>  - rename
>
> src/hotspot/cpu/riscv/c2_MacroAssembler_riscv.cpp line 1393:
> 
>> 1391: 
>> 1392:   const int base_offset = isLL ? arrayOopDesc::base_offset_in_bytes(T_BYTE)
>> 1393:                                : arrayOopDesc::base_offset_in_bytes(T_CHAR);
> 
> Sorry, But I don't think we need to distinuish `T_BYTE` and `T_CHAR` here. The reason is that the character storage used for both Latin1 and UTF16 strings is always a byte array [1]. So we should always use `T_BYTE` for both cases.
> 
> [1] https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/lang/String.java#L160

Thanks.
As mentioned in this PR's description, there will be another follow-up pr later, I can do it in that one.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23633#discussion_r1975056134


More information about the hotspot-compiler-dev mailing list