> 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.
Chen Liang has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision: - Rollback classfile boot speed changes - Merge branch 'master' of https://github.com/openjdk/jdk into fix/switch-gen-speed - Fix adding potentially unbound labels - 8354899: Reduce overhead associated with type switches ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24705/files - new: https://git.openjdk.org/jdk/pull/24705/files/cbc3fd34..2c17dd1c Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24705&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24705&range=00-01 Stats: 21331 lines in 383 files changed: 18828 ins; 1542 del; 961 mod Patch: https://git.openjdk.org/jdk/pull/24705.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24705/head:pull/24705 PR: https://git.openjdk.org/jdk/pull/24705