On Fri, 24 Apr 2026 04:38:48 GMT, Stefan Karlsson <[email protected]> wrote:

>> Frederic Parain has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Comment hard coded arguments to is_naturally_aotimic()
>
> src/hotspot/share/oops/instanceKlass.cpp line 187:
> 
>> 185:   if (null_free) return true;
>> 186:   return InlineKlass::cast(this)->is_empty_inline_type();
>> 187: }
> 
> FWIW, I think the following version of the code is easier to understand:
> Suggestion:
> 
> bool InstanceKlass::is_naturally_atomic(bool null_free) const {
>   assert(!is_identity_class(), "Doesn't have sense for an identity class");
>   if (null_free) {
>     // No extra null-marker - just check the layout of the fields
>     _misc_flags.is_naturally_atomic()
>   } else {
>     // Requires a null-marker - can't have any other fields
>     return InlineKlass::cast(this)->is_empty_inline_type();
>   }
> }

The method body has been updated according to your suggestion. A comment has 
also been added above the method to explain the meaning of being naturally 
atomic. Hope it helps.

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2361#discussion_r3137987003

Reply via email to