RFR: 8292170: Convert CodeRootSetTable to use ResourceHashtable [v8]
Leo Korinth
lkorinth at openjdk.org
Tue Jan 24 14:42:12 UTC 2023
On Tue, 24 Jan 2023 14:15:33 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> Leo Korinth has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Remove the purge list and use the resizing of the resource hash
>> table.
>>
>> Add asserts ensuring that we do not mutatet a hash table while we
>> iterate over it. Renaming .*g1CodeCacheRemSet.?pp -> .*g1CodeRootSet.?pp
>
> src/hotspot/share/gc/g1/heapRegionRemSet.cpp line 124:
>
>> 122: BOOL_TO_STR(_m.owned_by_self()), BOOL_TO_STR(Thread::current()->is_VM_thread()));
>> 123:
>> 124: if (!_code_roots.contains(nm)) { // with this test, we can assert that we do not modify the hash table while iterating over it
>
> But you have the assert in 'add' too, so put_if_absent is more efficient than calling contains first.
When we have an evacuation failure, the code will add an nmethod that is already present. If I guard in `add_code_root_locked`, evacuation failures will not reach the assert in `G1CodeRootSet::add`. Another way to do it is to to do the `contains` within the assert and then somewhat optimising the release build. Would you prefer that?
-------------
PR: https://git.openjdk.org/jdk/pull/11675
More information about the hotspot-dev
mailing list