RFR: 8292170: Convert CodeRootSetTable to use ResourceHashtable [v2]

Ivan Walulya iwalulya at openjdk.org
Thu Dec 15 15:57:11 UTC 2022


On Thu, 15 Dec 2022 13:56:27 GMT, Leo Korinth <lkorinth at openjdk.org> wrote:

>> I am replacing the old hash table with ResourceHashtable. In the process I am also removing the redundant `_length` field. By removing the `_length` field, a lot of asserts can be removed as the length will trivially match the length of the underlying table.
>> 
>> I would like to have feedback on the addition of `unlink_destruct(Function&& should_remove)`. I added it because I prefer to use a functor object that can be used by lambdas instead of an iterator object. However, I did add code to "destruct" resource objects when they are removed instead of just letting them be to reflect that we use `delete` on c-heap objects. Maybe I should remove this "improvement" and then maybe implement the function by calling the existing unlink?
>
> Leo Korinth has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - copyrights
>  - use iter function interface instead, make closure NONCOPYABLE

Changes requested by iwalulya (Reviewer).

src/hotspot/share/gc/g1/g1CodeCacheRemSet.cpp line 42:

> 40: G1CodeRootSetTable* volatile G1CodeRootSetTable::_purge_list = NULL;
> 41: 
> 42: size_t G1CodeRootSetTable::mem_size() {

G1CodeRootSetTable::* definitions in `g1CodeCacheRemSet.cpp` make `g1CodeRootSetTable.hpp` seem redundant. Either add `g1CodeRootSetTable.cpp` or move the `G1CodeRootSetTable` declaration to `g1CodeCacheRemSet.hpp`

src/hotspot/share/gc/g1/g1CodeRootSetTable.hpp line 43:

> 41:   G1CodeRootSetTable* _purge_next;
> 42: 
> 43:   unsigned int compute_hash(nmethod* nm) {

Change makes this dead code

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

PR: https://git.openjdk.org/jdk/pull/11675


More information about the hotspot-dev mailing list