RFR: 8353175: Eliminate double iteration of stream in FieldDescriptor reinitialization [v2]
Radim Vansa
rvansa at openjdk.org
Wed Apr 9 14:35:36 UTC 2025
On Wed, 9 Apr 2025 08:05:18 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:
>> Radim Vansa has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Fix compilation error in assertion
>
> src/hotspot/share/oops/instanceKlass.cpp line 1944:
>
>> 1942: if (!fs.access_flags().is_static()) {
>> 1943: fd = fs.field_descriptor();
>> 1944: Tuple<int, int, FieldInfo> f(fs.offset(), fs.index(), fs.to_FieldInfo());
>
> `FieldInfo` contains the `offset`, so that's not necessary. Besides, the `index` is now only used for an `assert` in the `reinitialize` code. Why not get rid of the index argument and the assert?
>
> In other words: Get rid of the `Tuple` changes and have `fields_sorted` be a `GrowableArray` of `FiedlInfo` only.
The suggestions make sense, I'll apply them. Thanks!
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24290#discussion_r2035511849
More information about the hotspot-dev
mailing list