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

Daniel D. Daugherty dcubed at openjdk.org
Tue Jun 6 20:06:11 UTC 2023


On Tue, 6 Jun 2023 19:34:16 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Daniel D. Daugherty has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>> 
>>  - Merge tag 'jdk-21+25' into JDK-8256302
>>    
>>    Added tag jdk-21+25 for changeset a46b5acc
>>  - Allow ObjectMonitor::_object to be reset to nullptr when it is released which allows the code to be cleaner.
>>  - Merge tag 'jdk-21+23' into JDK-8256302
>>    
>>    Added tag jdk-21+23 for changeset 6d4782bc
>>  - address the easy dholmes and kimbarrett CR comments
>>  - 8256302: releasing oopStorage when deflating allows for faster deleting
>
> src/hotspot/share/oops/weakHandle.hpp line 57:
> 
>> 55:   void release(OopStorage* storage) const;
>> 56:   bool is_null() const { return _obj == nullptr; }
>> 57:   void set_null() { _obj = nullptr; }
> 
> I would be a lot happier if WeakHandle.release() was non-const and set the _obj to nullptr, so that nothing can do this without release the weak handle.
> This could be a follow-up RFE though since it affects other WeakHandle.release() calls.

Just to be clear, the weak handle is released, but the `_obj` field in the WeakHandle is not
cleared so it is a dangling oop reference.

I didn't want to change `release(OopStorage* storage)` because that had a larger fan out
of changes outside the scope of what I was trying to accomplish.

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

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


More information about the hotspot-runtime-dev mailing list