Forcefully inline reference types
Julian Waters
tanksherman27 at gmail.com
Sun Apr 24 14:19:45 UTC 2022
Hi all,
After some discussion with lilliput-dev about the possibility of removing
the entire Mark Word, I'm wondering if being able to forcefully inline
value and identity objects when they're instantiated could have any merit
or benefit to be looked at in Valhalla. The idea came after the realization
that to fully omit the Mark Word the GC bits in the header would also have
to be dealt with, something which cannot be done by simply not having them
in the header given that this may cause GC related performance issues. The
discussed alternative was to not have GC support for certain objects at
all, but that would require it to be able to take advantage of other memory
freeing operations (Eg Popping off a stack frame, being inlined inside
another object to be freed when the containing object is GC'd). To my
knowledge regular objects can already be inlined by HotSpot via Escape
Analysis, would it then be worth discussing to re-use the older "inline"
keyword from Valhalla to allow control over this from the source level as
well? (With the limitation that the object cannot escape its scope, and
only copies of it may be made otherwise, something that may in turn require
semantics for choosing to pass by value or reference)
There are other issues with locking and identity hashes that relate to
this, but that's probably better discussed back at lilliput-dev if this
happens to be something we can look into
best regards,
Julian
More information about the valhalla-dev
mailing list