RFR: 8365256: RelocIterator should use indexes instead of pointers
Johan Sjölen
jsjolen at openjdk.org
Mon Aug 18 14:26:13 UTC 2025
On Thu, 31 Jul 2025 19:00:10 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
>
> The build failures are all from after [Explicitly assign _mutable_data to nullptr](https://github.com/openjdk/jdk/pull/26569/commits/75a3853b65f264666c470a3ba6b1791dce6c775d), fixing the issues should be trivial.
>
>> Is this change intended to resolve JDK-8361382 (NMT header corruption)? If so, please link it in the PR description and describe how the new logic prevents that corruption.
>
> It's not intended to resolve it, but it does remove one potential source of the issue.
>
>> However, since relocation iteration is on a performance-critical path, benchmarks should be run to ensure that the added integer field and array indexing introduce no measurable regression.
>
> Yeah, we can check that. Note that we have the same size, as we replaced 1 8-byte field with 2 4-byte fields. I also suspect that the pointer addition (probably a `lea r0, [ r0 + r1 ]` on x64) won't introduce a performance regression, but nothing wrong with checking.
> @jdksjolen please run tier1-4 testing in mach5, GHA is not enough for such changes.
Two tests fail (rest are green) in my testing. I will ping you when I've solved those issues.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26569#issuecomment-3197152716
More information about the hotspot-compiler-dev
mailing list