RFR: 8343789: Move mutable nmethod data out of CodeCache [v4]

Boris Ulasevich bulasevich at openjdk.org
Tue Dec 10 22:42:44 UTC 2024


On Fri, 22 Nov 2024 02:43:25 GMT, Dean Long <dlong at openjdk.org> wrote:

>> Boris Ulasevich has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   extra bool parameter for ldr_patchable
>
> src/hotspot/share/code/codeBlob.hpp line 108:
> 
>> 106: 
>> 107:   int      _size;                  // total size of CodeBlob in bytes
>> 108:   int      _relocation_size;       // size of relocation (could be bigger than 64Kb)
> 
> For offsets into the external mutable/immutable data, we could reduce codecache footprint further by moving these into a a header section of the external data block.  That also allows those blocks to be self-describing, which could help with error reporting or debugging.

Sounds reasonable. But the downside is that in this case the oops iterator needs an additional load (nmethod->mutable_data->oop_size) to check if the oops list is empty.

> src/hotspot/share/code/codeBlob.hpp line 135:
> 
>> 133:   CodeBlob(const char* name, CodeBlobKind kind, CodeBuffer* cb, int size, uint16_t header_size,
>> 134:            int16_t frame_complete_offset, int frame_size, OopMapSet* oop_maps, bool caller_must_gc_arguments,
>> 135:            int mutable_data_size = 0);
> 
> If we want to allow the default for mutable data size to be the relocations size, then instead of using = 0 here, you could do this instead:
> 
>  CodeBlob(const char* name, CodeBlobKind kind, CodeBuffer* cb, int size, uint16_t header_size,
>            int16_t frame_complete_offset, int frame_size, OopMapSet* oop_maps, bool caller_must_gc_arguments,
>            int mutable_data_size);
> 
>  CodeBlob(const char* name, CodeBlobKind kind, CodeBuffer* cb, int size, uint16_t header_size,
>            int16_t frame_complete_offset, int frame_size, OopMapSet* oop_maps, bool caller_must_gc_arguments) : 
>     CodeBlob(name, kind, cb, size, header_size,
>            frame_complete_offset, frame_size, oop_maps, caller_must_gc_arguments,
>            cb->total_relocation_size)
> {
> }
> 
> but I would prefer not to treat relocations as special, and have the caller always pass the correct value.

Agree.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21276#discussion_r1879014631
PR Review Comment: https://git.openjdk.org/jdk/pull/21276#discussion_r1879015667


More information about the hotspot-compiler-dev mailing list