RFR: 8354899: Reduce overhead associated with type switches

Adam Sotona asotona at openjdk.org
Tue Apr 22 08:08:01 UTC 2025


On Thu, 17 Apr 2025 00:08:55 GMT, Chen Liang <liach at openjdk.org> wrote:

> The downcallHandle method in Linker has a complex implementation, and type switches is triggered in multiple places in that handle.
> 
> After bytestacks analysis of a simple program that links the native implementation of Class::forName0, it turns out that:
> 1. there are a few missed usages of type switch in ClassFile API
> 2. type switch can speed up generation by using explicit stack maps, as stack map gen is over 50% of the generation instructions because the switch is branch-heavy, but the frames are actually simple.
> 
> These two combined are not that significant in the overall overhead of downcallHandle, but would be helpful for other workloads.

Both parts of this PR look good to me, however they seem to be unrelated.
I would suggest to create another PR for #1, as the Class-File API JDK boot safety is not related to the SUBJ.

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

PR Comment: https://git.openjdk.org/jdk/pull/24705#issuecomment-2820507514


More information about the core-libs-dev mailing list