RFR: 8247281: migrate ObjectMonitor::_object to OopStorage [v2]

Coleen Phillimore coleenp at openjdk.java.net
Fri Sep 11 21:45:11 UTC 2020


On Fri, 11 Sep 2020 21:13:13 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:

>> Because before the TSM removal patch, the monitors are allocated in blocks. Then, the objects are not known when the
>> monitors are allocated. The handles are instead lazily created... for now. With the next patch, that will probably
>> change, if we agree to allocate ObjectMonitors one by one on inflation time. But that is one patch away.
>
> Erik's part3 patch ensures that when the ObjectMonitor is allocated,
> the weak handle is created and initialized to the oop at that point. Since
> this is still the TSM version, the ObjectMonitor may not yet have a weak
> handle allocated at the time that object() is called.

Ok, this is cool then and good that this logic is here instead of inside the WeakHandle::resolve/peek functions.  The
OopHandle similar functions have a null check, so if this was permanent, I'd suggest putting it there.  Since this is
going to change, having it here and keeping the non-null invariants for WeakHandle::resolve/peek functions is better.

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

PR: https://git.openjdk.java.net/jdk/pull/135


More information about the hotspot-runtime-dev mailing list