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

Casper Norrbin cnorrbin at openjdk.org
Wed Nov 13 13:42:35 UTC 2024


On Wed, 13 Nov 2024 12:18:18 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Casper Norrbin has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   removed unnecessary include
>
> src/hotspot/share/classfile/stringTable.hpp line 89:
> 
>> 87:   static unsigned int hash_wrapped_string(StringWrapper wrapped_str);
>> 88:   static const jchar* to_unicode(StringWrapper wrapped_str, int &len, TRAPS);
>> 89:   static Handle handle_from_wrapped_string(StringWrapper wrapped_str, TRAPS);
> 
> Why is StringWrapper passed by value not by reference? If it's passed by reference, could you hide this whole class in stringTable.cpp ?

No reason in particular. I changed the functions to use references instead and hid the wrapper away in the .cpp file.

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

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


More information about the hotspot-dev mailing list