8275830: C2: Receiver downcast is missing when inlining through method handle linkers #77
Conversation
|
@iwanowww |
Webrevs
|
import static compiler.cha.Utils.*; | ||
|
||
public class AbstractRootMethod { | ||
public static void main(String[] args) { | ||
run(AbstractClass.class); | ||
run(AbstractInterface.class); | ||
|
||
// Implementation limitation: CHA is not performed by C1 during inlining through MH linkers. | ||
if (!sun.hotspot.code.Compiler.isC1Enabled()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you also need to check that C2 is enabled (could be JVMCI).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Until JVMCI/Graal is migrated to vtable-based CHA, the tests are run only with C1/C2:
@requires !vm.graal.enabled & vm.opt.final.UseVtableBasedCHA == true
Fixed. |
@iwanowww This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been no new commits pushed to the
|
Thanks for the reviews, Vladimir and Dean. /integrate |
Going to push as commit 95a3010.
Your commit was automatically rebased without conflicts. |
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 omittedinvokedynamic
andMethodHandles
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
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk18 pull/77/head:pull/77
$ git checkout pull/77
Update a local copy of the PR:
$ git checkout pull/77
$ git pull https://git.openjdk.java.net/jdk18 pull/77/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 77
View PR using the GUI difftool:
$ git pr show -t 77
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk18/pull/77.diff