RFR: 8347431: Update ObjectMonitor comments [v3]

David Holmes dholmes at openjdk.org
Thu Jan 16 02:47:46 UTC 2025


On Wed, 15 Jan 2025 13:40:14 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>  For example, is this instruction more efficient with a zero offset (aarch64)?
`ldr(r0, Address(c_rarg1, BasicObjectLock::obj_offset()));`

Apparently not on Aarch64. The Address constructor doesn't look at the actual offset (which is known at code generation time) and still generates a base_plus_offset mode load instruction. x86_64 ndoesn't seem to look at it either but it is hard to track through to see what the actual real cpu instruction will be.

The `metadata` field used to just be the `markWord` field, so given an object we wanted to be able to update the markWord by just writing to the address, not needing to do a dynamic calculation if the offset was non-zero.  Of course we used to write to the markWord a lot more often when we had biased locking.

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

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


More information about the hotspot-runtime-dev mailing list