RFR: 8271513: support JavaThreadIteratorWithHandle replacement by new ThreadsList::Iterator [v3]
Daniel D.Daugherty
dcubed at openjdk.java.net
Thu Aug 5 16:42:32 UTC 2021
On Tue, 3 Aug 2021 18:50:10 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> Daniel D. Daugherty has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits:
>>
>> - Merge branch 'master' into JDK-8271513
>> - Merge branch 'pull/4671' into JDK-8271513
>> - kbarrett CR - simplify 'ThreadsList::Iterator::operator!=(Iterator i)'
>> - 8271513: support JavaThreadIteratorWithHandle replacement by new ThreadsList::Iterator
>> - 8193559.kbarrett.part1 - Kim's proposed rewrite using newer C++ features.
>> - Merge branch 'master' into JDK-8193559
>> - kbarrett CR - delete unused _list member.
>> - 8193559.cr0
>
> src/hotspot/share/runtime/thread.cpp line 857:
>
>> 855: array[i] = _jvmci_old_thread_counters[i];
>> 856: }
>> 857: for (JavaThread* tp : ThreadsListHandle()) {
>
> This is a nicer interface with underlying C++ magic. There are lots of these in the source code. Is it the intention to replace these as we go?
There's definitely lots of these:
$ grep -r JavaThreadIteratorWithHandle src/hotspot | sed 's/:.*//' | sort | uniq -c
1 src/hotspot/os/linux/os_linux.cpp
1 src/hotspot/share/compiler/compileBroker.cpp
1 src/hotspot/share/gc/parallel/mutableNUMASpace.cpp
2 src/hotspot/share/gc/shared/collectedHeap.cpp
1 src/hotspot/share/gc/shared/gcLocker.cpp
1 src/hotspot/share/gc/shenandoah/shenandoahCodeRoots.cpp
5 src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp
2 src/hotspot/share/gc/shenandoah/shenandoahPacer.cpp
1 src/hotspot/share/jfr/utilities/jfrThreadIterator.cpp
1 src/hotspot/share/jfr/utilities/jfrThreadIterator.hpp
1 src/hotspot/share/opto/idealGraphPrinter.cpp
1 src/hotspot/share/prims/jvmtiEnvBase.cpp
1 src/hotspot/share/prims/jvmtiEventController.cpp
1 src/hotspot/share/prims/jvmtiImpl.cpp
1 src/hotspot/share/prims/jvmtiTagMap.cpp
1 src/hotspot/share/prims/whitebox.cpp
5 src/hotspot/share/runtime/escapeBarrier.cpp
2 src/hotspot/share/runtime/handshake.cpp
1 src/hotspot/share/runtime/os.cpp
8 src/hotspot/share/runtime/safepoint.cpp
1 src/hotspot/share/runtime/thread.cpp
3 src/hotspot/share/runtime/threadSMR.hpp
3 src/hotspot/share/runtime/vmOperations.cpp
1 src/hotspot/share/services/heapDumper.cpp
1 src/hotspot/share/services/management.cpp
1 src/hotspot/share/services/threadService.cpp
1 src/hotspot/share/utilities/globalCounter.cpp
I believe the plan is to migrate to this newer, cleaner interface.
Obviously not with this bug, but down the road...
-------------
PR: https://git.openjdk.java.net/jdk/pull/4948
More information about the hotspot-runtime-dev
mailing list