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

Johan Sjölen jsjolen at openjdk.org
Wed Nov 13 12:39:19 UTC 2024


On Wed, 13 Nov 2024 11:58:27 GMT, Casper Norrbin <cnorrbin at openjdk.org> wrote:

>> src/hotspot/share/classfile/javaClasses.hpp line 184:
>> 
>>> 182:   }
>>> 183: 
>>> 184:   static unsigned int hash_code(const char* utf8_str, size_t utf8_len) {
>> 
>> Why is this inlined but the oop-version isn't? Maybe they should both be in the cpp file?
>
> It's inlined because the hash functions working on unicode are inlined just above it. For the full context:
> 
> https://github.com/openjdk/jdk/blob/d55552d5323ff8a4ec37c320199b650e63f230b4/src/hotspot/share/classfile/javaClasses.hpp?plain=1#L166-L197
> 
> I think these are simple enough to be ok inlined, whereas the oop-versions are more complex and modify the object, so it makes sense that they are not.

Aw jeez, my bad :).

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

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


More information about the hotspot-dev mailing list