RFR: 8292170: Convert CodeRootSetTable to use ResourceHashtable [v8]
Coleen Phillimore
coleenp at openjdk.org
Tue Jan 24 16:26:06 UTC 2023
On Tue, 24 Jan 2023 14:38:49 GMT, Leo Korinth <lkorinth at openjdk.org> wrote:
>> 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?
Oh, I see. contains() does not have the assert. Ok, this makes sense.
-------------
PR: https://git.openjdk.org/jdk/pull/11675
More information about the hotspot-dev
mailing list