RFR: 8256302: releasing oopStorage when deflating allows for faster deleting [v5]

David Holmes dholmes at openjdk.org
Mon Jun 5 01:30:17 UTC 2023


On Sun, 4 Jun 2023 14:24:48 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:

>> src/hotspot/share/runtime/objectMonitor.cpp line 279:
>> 
>>> 277: 
>>> 278: ObjectMonitor::~ObjectMonitor() {
>>> 279:   _object.release(_oop_storage);
>> 
>> Just to be clear, we can't call release here because not all
>> `delete monitor` calls happen while the JavaThread is in VM.
>> Some happen while the JavaThread is blocked.
>
> Now we use `!_object.is_null()` as a flag to indicate when it is
> okay (and safe) to do the release from this location.

This is confusing - why is `is_null` being used as a proxy for checking the current thread's state?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/11296#discussion_r1217321705


More information about the hotspot-runtime-dev mailing list