RFR: 8371418: Methods in AdapterHandlerLibrary use HashtableBase iterate method incorrectly [v3]
Ashutosh Mehra
asmehra at openjdk.org
Mon Nov 10 14:53:36 UTC 2025
> The closure passed to `HashTable::iterate` in `AdapterHandlerLibrary::contains` and `AdapterHandlerLibrary::print_handler_on` is returning incorrect value. If the search is successful, it should return false to terminate the iteration, but it is returning true. This patch fixes the return value of these closures.
> In addition, I noticed `CompactHashTable::iterate` goes through all entries unconditionally, which is not optimal for cases where we may want to terminate the iteration when some condition is met. This is the case in `AdapterHandlerLibrary::contains` and `AdapterHandlerLibrary::print_handler_on` when it iterates over `_aot_adapter_handler_table`. This patch updates `CompactHashTable::iterate` to be the same as `HashTAble::iterate` by using return value of the closure to determine if the iteration should continue or abort. It also adds `CompactHashTable::iterate_all` to iterate all the values unconditionally and the users of `CompactHashTable::iterate` are updated to use `CompactHashTable::iterate_all`.
Ashutosh Mehra has updated the pull request incrementally with one additional commit since the last revision:
Update comments
Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/28197/files
- new: https://git.openjdk.org/jdk/pull/28197/files/f46d3dae..94cab725
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=28197&range=02
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=28197&range=01-02
Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/28197.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/28197/head:pull/28197
PR: https://git.openjdk.org/jdk/pull/28197
More information about the hotspot-dev
mailing list