RFR: 8329433: Reduce nmethod header size [v7]
Vladimir Kozlov
kvn at openjdk.org
Thu Apr 18 00:41:05 UTC 2024
On Wed, 17 Apr 2024 22:23:47 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:
>> This is part of changes which try to reduce size of `nmethod` and `codeblob` data vs code in CodeCache.
>> These changes reduced size of `nmethod` header from 288 to 232 bytes. From 304 to 248 in optimized VM:
>>
>> Statistics for 1282 bytecoded nmethods for C2:
>> total in heap = 5560352 (100%)
>> header = 389728 (7.009053%)
>>
>> vs
>>
>> Statistics for 1322 bytecoded nmethods for C2:
>> total in heap = 8307120 (100%)
>> header = 327856 (3.946687%)
>>
>>
>> Several unneeded fields in `nmethod` and `CodeBlob` were removed. Some fields were changed from `int` to `int16_t` with added corresponding asserts to make sure their values are fit into 16 bits.
>>
>> I did additional cleanup after recent `CompiledMethod` removal.
>>
>> Tested tier1-7,stress,xcomp and performance testing.
>
> Vladimir Kozlov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains eight commits:
>
> - Merge master
> - remove trailing space
> - Shuffle fields initialization
> - Address comments. Used checked_cast.
> - Use 16-bits types for header_size and frame_complete_offset arguments
> - Union fields which usages do not overlap
> - Moved some fields initialization into init_defaults()
> - 8329433: Reduce nmethod header size
Merge [#18637](https://github.com/openjdk/jdk/pull/18637) added an other `short` field `_num_stack_arg_slots` which pushed `nmethod` size back to 240 bytes in product VM. I will not do changes in **this** PR to compensate it.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/18768#issuecomment-2062779812
More information about the serviceability-dev
mailing list