RFR: 8339492: StackMapDecoder::writeFrames makes lots of allocations [v2]

Shaojin Wen swen at openjdk.org
Wed Sep 4 01:08:20 UTC 2024


On Tue, 3 Sep 2024 17:33:37 GMT, David M. Lloyd <duke at openjdk.org> wrote:

>> Please review this change, which reduces the number of allocations in `StackMapDecoder::writeFrames` by using a sorted array instead of a `TreeMap<Integer, ...>` to sort and uniquify entries before writing. It also adds a validation missed by the original implementation.
>> 
>> Tested using `StackMapsTest`.
>
> David M. Lloyd has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Review feedback: reject duplicate stack map entries

It looks good, but can you provide the codeSize before and after the change? For example, add the JVM startup parameters `-XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining` to find `writeFrames` and see if this PR will change from less than 325 to greater than 325.

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

PR Comment: https://git.openjdk.org/jdk/pull/20841#issuecomment-2327714378


More information about the core-libs-dev mailing list