RFR: 8293170: Improve encoding of the debuginfo nmethod section [v6]
Evgeny Astigeevich
eastigeevich at openjdk.org
Sun Oct 30 17:56:14 UTC 2022
On Thu, 20 Oct 2022 12:04:32 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:
>
> minor renaming. adding encoding examples table
src/hotspot/share/code/debugInfo.hpp line 298:
> 296: // debugging information. Used by ScopeDesc.
> 297:
> 298: class DebugInfoReadStream : public CompressedSparseDataReadStream {
I don't think `DebugInfoReadStream`/`DebugInfoWriteStream` need public inheritance. The relation is more like composition.
I would have implemented them like:
class DebugInfoReadStream : private CompressedSparseDataReadStream {
public:
// we are using only needed functions from CompressedSparseDataReadStream.
using CompressedSparseDataReadStream::buffer();
using CompressedSparseDataReadStream::read_int();
using ...
};
Or
template <typename DataReadStream> class DebugInfoReadStream {
public:
// define only needed functions which use a minimum number of functions from DataReadStream
};
I prefer the templates because we can easily switch between different implementations of `DataReadStream`/DataWriteStream` without doing this kind of modifications.
-------------
PR: https://git.openjdk.org/jdk/pull/10025
More information about the hotspot-compiler-dev
mailing list