RFR: 8315850: Improve AbstractMap anonymous Iterator classes [v3]

Rémi Forax forax at openjdk.org
Fri Sep 8 19:20:38 UTC 2023


On Fri, 8 Sep 2023 18:55:29 GMT, altrisi <duke at openjdk.org> wrote:

>> Per Minborg has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Fix additional formating issue
>>  - Don't use polymorphism and reformat code
>
> With the recent changes this ends up just moving the iterator classes around (from anonymous to inner) and making a field final. I don't understand how fully splitting them (vs the previous `AbstractIterator` revision) helps against polymorphism, given they both would store the same `Iterator` types in the field (whatever the result of `entrySet` is), and the `next` method is two different implementations anyway, that I'd assume would be treated differently. Though I don't know enough about the JIT (or benchmarked this) to know if it does make a difference.

@altrisi,
the profile stored by the VM is attached to a specific bytecode, if you share that bytecode, you share the profile.

see https://wiki.openjdk.org/display/HotSpot/MethodData

-------------

PR Comment: https://git.openjdk.org/jdk/pull/15615#issuecomment-1712119725


More information about the core-libs-dev mailing list