RFR: 8327156: Avoid copying in StringTable::intern(oop, TRAPS)

David Holmes dholmes at openjdk.org
Tue Oct 15 07:36:10 UTC 2024


On Fri, 4 Oct 2024 13:01:04 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> src/hotspot/share/classfile/javaClasses.cpp line 765:
>> 
>>> 763: }
>>> 764: 
>>> 765: bool java_lang_String::equals(oop java_string, const char* utf8_string, int len) {
>> 
>> I find it super confusing to use generic `len` here and would very much appreciate it if we called this `nr_unicode_points` or something like that. You could even add a comment. Honestly, I think that maybe we should change all of these functions for additional clarity.
>
> The last suggestion can be done in a followup RFE.

If the `char*` is a sequence of 8-bit UTF8 values, and the `len` is the number of such 8-bit values, then "unicode points" would not be at all appropriate as they are something quite different.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21325#discussion_r1800609604


More information about the hotspot-dev mailing list