On Tue, 27 Aug 2024 07:23:14 GMT, David Holmes <dhol...@openjdk.org> wrote:

>> src/hotspot/share/classfile/javaClasses.cpp line 633:
>> 
>>> 631: }
>>> 632: 
>>> 633: int java_lang_String::utf8_length_as_int(oop java_string, typeArrayOop 
>>> value) {
>> 
>> Why not call java_lang_String::utf8_length() here instead of duplicating the 
>> code?
>
> Because we have to call `UNICODE::utf8_length_as_int` to get the proper 
> truncation - the code is not an exact duplicate.

OK, I missed that.  It's probably not worth it to refactor out the common code 
using C++ lambda expressions.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20560#discussion_r1732331731

Reply via email to