RFR: 8292170: Convert CodeRootSetTable to use ResourceHashtable [v7]
Leo Korinth
lkorinth at openjdk.org
Mon Jan 23 11:29:09 UTC 2023
On Mon, 23 Jan 2023 11:24:32 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 one additional commit since the last revision:
>
> code_roots_list_contains is now locked, but we have problems with add() during nmethods_do
`code_roots_list_contains` is used in `assert`s, `gurantee`s and in heap verification code only. Make it locked so that we do not have to think about correctness as it will not affect production code (at least if we remove the `guarantee`). I also added new asserts that does fire when we do `add` to a hash table that we iterate in another thread. So we have at least one problem left that might possibly be fixed by iterating on a copy, looking into that now.
-------------
PR: https://git.openjdk.org/jdk/pull/11675
More information about the hotspot-dev
mailing list