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

Evgeny Astigeevich eastigeevich at openjdk.org
Thu May 29 15:11:59 UTC 2025


On Sat, 15 Mar 2025 00:41:58 GMT, Vladimir Kozlov <kvn 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?
>
> I am not sure adding one integers field justifies new structure. It is better to keep this counter at the end of this block since it is accessed only few times.

IMO we should declare the type of `immutable_data_references` and use it in `sizeof` instead of `int`. `sizeof(int)` looks too cryptic.

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

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


More information about the hotspot-compiler-dev mailing list