[jdk18] RFR: 8275830: C2: Receiver downcast is missing when inlining through method handle linkers

Vladimir Ivanov vlivanov at openjdk.java.net
Mon Jan 3 18:54:32 UTC 2022


JDK-8268405 introduced receiver downcasts when inlining through virtual calls
when CHA reveals a unique target method under an abstract or default method.
But it handled only cases when invocation is performed using
`invokevirtual`/`invokeinterface` bytecodes and completely omitted `invokedynamic` and
`MethodHandles` cases. 

The fix covers missing cases by checking whether invocation happens through 
corresponding method handle linkers (`MethodHandle.linkToVirtual`/`MethodHandle.linkToInterface`).

Testing: hs-tier1 - hs-tier4

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

Commit messages:
 - 8275830: C2: Receiver downcast is missing when inlining through method handle linkers

Changes: https://git.openjdk.java.net/jdk18/pull/77/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk18&pr=77&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8275830
  Stats: 116 lines in 4 files changed: 92 ins; 11 del; 13 mod
  Patch: https://git.openjdk.java.net/jdk18/pull/77.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk18 pull/77/head:pull/77

PR: https://git.openjdk.java.net/jdk18/pull/77


More information about the hotspot-compiler-dev mailing list