RFR: 8365256: RelocIterator should use indexes instead of pointers
Vladimir Kozlov
kvn at openjdk.org
Mon Aug 11 16:29:13 UTC 2025
On Thu, 31 Jul 2025 06:17:24 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
Thank you @jdksjolen for doing these changes.
The only reason I kept not null default (and purged) value is to avoid asserts we are hitting in various parts of this code which still assumes that mutable and immutable data is collocated with nmethod code and we can use pointers without issue.
I don't much worry about performance of relocation info. `metadata_do()` is used only with RedefineClasses which is triggering deoptimization anyway. `oops_do()` use relocation info for embedded oops only on x86. This is rare case and we can further reduce impact by adding nmethod's flag indicating presence of embedded oops.
-------------
PR Review: https://git.openjdk.org/jdk/pull/26569#pullrequestreview-3106711001
More information about the hotspot-compiler-dev
mailing list