Design question: why not reuse the CMS slots in mark word?
Aleksey Shipilev
shade at redhat.com
Mon Sep 19 20:26:33 UTC 2016
Hi,
I tried to search for the answer to this on my own, to no avail. Our
current forwarding pointer is laid out before the object, which makes
the allocation logic to reserve more space than "visible" to the object
instance. Obviously, you would want to have the forwarding pointer
within the object.
My question is: is there a reason we cannot reuse the mark word
mechanics already laid out for CMS? See the bit format here:
http://hg.openjdk.java.net/jdk9/jdk9/hotspot/file/6bddcf692e1d/src/share/vm/oops/markOop.hpp#l30
It would seem that both 32 bit and 64 bit modes have the place for the
forwarding pointer (cut alignment bits out):
// PromotedObject*:29 ---------->| promo_bits:3 ----->|
(CMS promoted object)
// PromotedObject*:61 --------------------->| promo_bits:3 ----->|
(CMS promoted object)
// narrowOop:32 unused:24 cms_free:1 unused:4 promo_bits:3 ----->|
(COOPs && CMS promoted object)
Of course, we trade in monitor biasing, complicate hashcode storage, a
bit slower forwarding, plus we need to support compressed forwarding
pointers, but other than that? Maybe I miss some blocker issue, but
somebody had explored and discovered it already?
Thanks,
-Aleksey
More information about the shenandoah-dev
mailing list