RFR: 8365256: RelocIterator should use indexes instead of pointers

Vladimir Kozlov kvn at openjdk.org
Mon Aug 11 16:07:14 UTC 2025


On Thu, 31 Jul 2025 08:07:28 GMT, Johan Sjölen <jsjolen at openjdk.org> wrote:

>> Hi,
>> 
>> This PR replaces the `current` and `end` pointers with a `base` pointer alongside a `current` index and a `len`. This allows us to have `-1` as the initial value for current, while retaining `nullptr` as the 'dead' value for `_mutable_data`.
>> 
>> Performance testing shows no difference/performance improvements on DaCapo Linux x64. I don't think that these are actual improvements, but at least there are no clear regressions.
>> 
>> Testing: GHA
>
> src/hotspot/share/code/nmethod.cpp line 2156:
> 
>> 2154:   os::free(_immutable_data);
>> 2155:   _immutable_data = nullptr;
>> 2156: 
> 
> `free` and `delete` on null pointers are OK, no need to check.

May be add `_immutable_data_size = 0` for completeness.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26569#discussion_r2267257898


More information about the hotspot-compiler-dev mailing list