RFR: 8347431: Update ObjectMonitor comments [v2]

Coleen Phillimore coleenp at openjdk.org
Mon Jan 13 13:06:11 UTC 2025


On Mon, 13 Jan 2025 06:47:51 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> src/hotspot/share/runtime/objectMonitor.hpp line 144:
>> 
>>> 142:   static ParkEvent* _vthread_unparker_ParkEvent;
>>> 143: 
>>> 144:   // Because of frequent access, the the metadata field is at offset zero (0).
>> 
>> Suggestion:
>> 
>>   // Because of frequent access, the metadata field is at offset zero (0).
>
> Isn't it more than that though? Even though we now calculate the offset in the code that uses this field, isn't it still a compile-time constant value of zero and so generates more efficient code compared to adding an offset that happens to be zero?

I guess it depends on platform whether the instruction is more efficient without an offset.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23042#discussion_r1913149855


More information about the hotspot-runtime-dev mailing list