RFR: 8316694: Implement relocation of nmethod within CodeCache [v3]

Vladimir Kozlov kvn at openjdk.org
Fri May 30 00:16:58 UTC 2025


On Thu, 29 May 2025 23:22:25 GMT, Chad Rakoczy <duke at openjdk.org> wrote:

>> src/hotspot/share/code/nmethod.hpp line 587:
>> 
>>> 585:   address immutable_data_references_begin      () const { return           _immutable_data + _immutable_data_references_offset   ; }
>>> 586:   address immutable_data_references_end        () const { return            immutable_data_end(); }
>>> 587: 
>> 
>> If we are going to add typed fields to this data, maybe we should put it in a struct/class header at the beginning so we can access the field directly?
>
> @dean-long @vnkozlov I added `IMMUTABLE_DATA_REFERENCES` ([source](https://github.com/chadrako/jdk/blob/c5ff58f4e22cbbcdbe06997efe482f73fcee73f5/src/hotspot/share/code/nmethod.hpp#L577-L582)) to make the code more readable. Is that sufficient or would you like to see a struct to represent this instead?

The more I look on it the more I like Dean's idea. I am withdrawing my previous objection.
Let's have a  **NOT virtual** class similar to CodeBlob.
Consider moving associated `*_offset` fields from `nmethod` to new class.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23573#discussion_r2114924318


More information about the hotspot-compiler-dev mailing list