RFR: 8293170: Improve encoding of the debuginfo nmethod section [v4]

Evgeny Astigeevich eastigeevich at openjdk.org
Tue Oct 11 17:36:20 UTC 2022


On Tue, 4 Oct 2022 20:31:44 GMT, Boris Ulasevich <bulasevich at openjdk.org> wrote:

>> The nmethod "scopes data" section is 10% of the size of nmethod. Now the data is compressed using the Pack200 algorithm, which is good for encoding small integers (LineNumberTable, etc). Using the fact that half of the data in the partition contains zeros, I reduce its size by another 30%.
>>  
>> Testing: jtreg hotspot&jdk, Renaissance benchmarks
>
> Boris Ulasevich has updated the pull request incrementally with one additional commit since the last revision:
> 
>   cleanup

src/hotspot/share/code/compressedStream.cpp line 198:

> 196:   if (nsize < min_expansion*2) {
> 197:     nsize = min_expansion*2;
> 198:   }

We will not need the code, if we initialise `_size` to `max2(initial_size, UNSIGNED5::MAX_LENGTH)` in the constructor. I don't think `initial_size` less than `UNSIGNED5::MAX_LENGTH` makes sense.

`grow()` is invoked when `_position >= _size`. So there are two cases:
1. `_position == _size`
2. `_position > _size`

`_position < 2 * _size` will be satisfied for case 1.
How do you guarantee `_position < 2 * _size` for case 2?

src/hotspot/share/code/compressedStream.hpp line 119:

> 117:   u_char* _buffer;
> 118:   int     _position; // current byte offset
> 119:   size_t  _byte_pos {0}; // current bit offset

Is it a bit offset in the byte at `_position`?
`_byte_pos` does not sound clear.

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

PR: https://git.openjdk.org/jdk/pull/10025


More information about the hotspot-compiler-dev mailing list