RFR: 8256302: releasing oopStorage when deflating allows for faster deleting
Daniel D. Daugherty
dcubed at openjdk.org
Tue Jun 6 17:28:40 UTC 2023
On Fri, 2 Dec 2022 02:11:49 GMT, David Holmes <dholmes at openjdk.org> wrote:
>>> I still think we should have been able to keep the release in the destructor guarded by some check:
>>>
>>> ```
>>> if (! already_released) {
>>> assert(!safepoint_safe, "must be");
>>> _object.release(_oop_storage);
>>> }
>>> ```
>>>
>>> but perhaps there is no way to ask if "already_released"?
>>>
>>> Thanks for the additional comments on the why of all this. The constraints on when you can access oopStorage were not clear before.
>>
>> You can ask by doing _object().is_null(), if true there is no backing storage in oopStorage.
>> Since the case above should never ever happen (cross-fingers) I would:
>>
>> `guarantee(_object().is_null(), "Destructor should never be called if weak handle is not released");`
>
>> You can ask by doing `_object().is_null()`
>
> Are you allowed to do that when safepoint-safe?
@dholmes-ora - Thanks for the re-review. Are you planning to approve it?
@robehn - Thanks for the re-review!
-------------
PR Comment: https://git.openjdk.org/jdk/pull/11296#issuecomment-1579177046
More information about the hotspot-runtime-dev
mailing list