RFR: 8193559: ugly DO_JAVA_THREADS macro should be replaced [v2]

Kim Barrett kbarrett at openjdk.java.net
Mon Jul 5 07:05:57 UTC 2021

On Sat, 3 Jul 2021 03:40:12 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:

>> This is a simple rewrite of what is "Possibly the ugliest for loop the world has seen."
>> Thanks to @stefank for the draft proposed fix. Thanks to @fisk for providing this
>> piece of history that I'm finally getting around to cleaning up. While this macro has
>> been with us for a long time, its time has passed...
>> Tested with Mach5 Tier[1-3].
> Daniel D. Daugherty has updated the pull request incrementally with one additional commit since the last revision:
>   kbarrett CR - delete unused _list member.

src/hotspot/share/runtime/thread.cpp line 2464:

> 2462: }
> 2463: 
> 2464: struct JavaThreadPrefetchedIterator {

I think the only really important difference between this new iterator class
and the existing JavaThreadIterator and JavaThreadIteratorWithHandle is that
the prefetched iterator prefetches. It seems like if that's useful there
then it's probably useful for the other two as well. I think these could all
be collapsed down to one iterator over ThreadsList that is typically used
via range-based for.


PR: https://git.openjdk.java.net/jdk/pull/4671

More information about the hotspot-gc-dev mailing list