RFR: 8257211: C2: Enable call devirtualization during post-parse phase [v2]
Vladimir Ivanov
vlivanov at openjdk.java.net
Wed Dec 2 08:38:08 UTC 2020
> As of now, call devirtualization is performed only during parsing. After parsing is over, virtual calls stay unchanged even if there's enough information available to successfully devirtualize them.
>
> Proposed patch enhances incremental inlining with virtual call support. The implementation is similar to how late inlining through MethodHandle linkers works: `CallGenerator` is linked from related `CallJavaNode` and once the call becomes eligible for devirtualization, it is put on the late inline list for future processing. It enables inlining through the call, but also even when inlining doesn't happen, devirtualization is beneficial anyway: it strength-reduces a virtual call to a static call (optimised virtual).
>
> Also, the patch introduces a dedicated pass over inline list very late in the pipeline specifically to strength reduce virtual calls to static ones w/o even attempting inlining. And it covers late inlining of MethodHandle linkers along the way.
>
> Initial version of the patch has been integrated into `panama-dev` (`vectorIntrinsics` branch) in July, 2020 [1] and since then it went through multiple rounds of testing and a number of bugs were fixed.
>
> (Original motivation for the work was Vector API which suffered severe performance regression after major API and implementation refactoring (`vector-unstable` branch), but it turned out it benefits ordinary Java code as well.)
>
> Testing:
> - [x] hs-tier1-6 w/ and w/o `-XX:+AlwaysIncrementalInline` and `-XX:+StressMethodHandleLinkerInlining`
>
> Thanks!
>
> [1] https://hg.openjdk.java.net/panama/dev/rev/5b601a43ac88
Vladimir Ivanov has updated the pull request incrementally with one additional commit since the last revision:
Remove invalid assert.
-------------
Changes:
- all: https://git.openjdk.java.net/jdk/pull/1550/files
- new: https://git.openjdk.java.net/jdk/pull/1550/files/e39d8f4b..b2ecc7e3
Webrevs:
- full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1550&range=01
- incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1550&range=00-01
Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod
Patch: https://git.openjdk.java.net/jdk/pull/1550.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/1550/head:pull/1550
PR: https://git.openjdk.java.net/jdk/pull/1550
More information about the hotspot-compiler-dev
mailing list