RFR: 8347431: Update ObjectMonitor comments

David Holmes dholmes at openjdk.org
Mon Jan 13 06:50:50 UTC 2025


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

>> Please review this change that removes a couple of comments that are not true (verified with testing metadata at offset 8).  There are no functional changes.
>
> 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?

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

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


More information about the hotspot-runtime-dev mailing list