RFR: 8338906: Avoid passing EnumDescs and extra classes to type switch methods that don't use them [v2]

Jan Lahoda jlahoda at openjdk.org
Mon Aug 26 14:41:08 UTC 2024


On Sat, 24 Aug 2024 21:16:34 GMT, Claes Redestad <redestad at openjdk.org> wrote:

>> This PR refactors SwitchBootstraps so that extra EnumDescs and classes are only passed into bootstraps when needed. Benchmarking shows that in many cases these are not needed, and avoiding passing them (via binding in the lists via `MethodHandle::insertArguments`) avoids some auxiliary MH combinator generation during bootstrap. 
>> 
>> Additional cleanups and refactoring further reduce bootstrap overhead and number of classes loaded.
>
> Claes Redestad has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Update src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java
>    
>    Co-authored-by: ExE Boss <3889017+ExE-Boss at users.noreply.github.com>
>  - Update src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java
>    
>    Co-authored-by: ExE Boss <3889017+ExE-Boss at users.noreply.github.com>

Looks reasonable to me.

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

Marked as reviewed by jlahoda (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/20693#pullrequestreview-2260865210


More information about the core-libs-dev mailing list