[master] RFR: Read class from object header

Roman Kennke rkennke at openjdk.java.net
Thu Sep 16 10:52:50 UTC 2021

On Thu, 5 Aug 2021 19:42:23 GMT, Dave Dice <dave.dice at oracle.com> wrote:

> The following ? ?Compact Java Monitors? -- might provide some relief : https://arxiv.org/pdf/2102.04188.pdf.
> As described, it handles just the identity hashCode value, but it?s trivial to extend the idea to displacing the whole lilliput header word.

Thanks, Dave! I will study it!
My current thinking wrt identityHashcode is to not store it in the header at all, but instead append it to the object on-demand. That is, when identityHashCode() is called, it would get re-computed as long as the object does not move, and as soon as it moves, an extra field would get appended to the object (or rather, often it fits in alignment gap at the end), and the hashcode is installed there. This is implemented in prototype here: https://github.com/rkennke/lilliput/tree/compact-hashcode
But, as far as I can see, it doesn't help with the problem that concurrent GCs have with the thread-locks.


PR: https://git.openjdk.java.net/lilliput/pull/12

More information about the lilliput-dev mailing list