-
Notifications
You must be signed in to change notification settings - Fork 143
8372824: [lworld] C2 hits "Unexpected argument type" assertion with --enable-preview #1935
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: lworld
Are you sure you want to change the base?
Conversation
|
👋 Welcome back qamai! A progress list of the required criteria for merging this PR into |
|
@merykitty This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. 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 3 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
| // value object. The method is devirtualized, and replaced with a direct call with a | ||
| // scalarized receiver instead. | ||
| assert(arg_idx == 0 && !call->method()->is_static(), "must be the receiver"); | ||
| arg = InlineTypeNode::make_from_oop(this, arg, t->inline_klass()); |
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.
So this is post-parse call-devirtualization, i.e. JDK-8257211, right? Could we assert call->generator()->is_virtual_late_inline() here?
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.
Unfortunately, the CallNode here does not have a generator, because it is created just above. Checking is_late_inline does not work either, because we are too deep handling now. LateInlineVirtualCallGenerator::do_late_inline_check calls into Compile::call_generator to find the replacement. This method, after deciding that it does not want to inline the callee, will create a PredictedCallGenerator with the fast path being a DirectCallGenerator. And this DirectCallGenerator is the one calling the method we are in, and this subclass of CallGenerator does not return true for is_late_inline().
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.
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.
Thanks for the pointer, I have added some asserts that we are during call devirtualization, not during parsing.
TobiHartmann
left a comment
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.
Great! That looks good to me.
Since I overrode
MyValue1::equalsin #1929 ,TestIntrinsicshas failed with-XX:PerMethodSpecTrapLimit=0 -XX:PerMethodTrapLimit=0. The failed test is this one:During parsing,
Array::newInstanceis not inlined, sovais of typeObject[]andva[i]is of typeObject.Asserts.assertEQcallsva[i].equals(null)which resolves to aCallJavaDynamicwith its receiver of typeObject, which is passed in as an oop. During incremental inline, It is revealed thatvais aMyValue1[]andva[i]is of typeMyValue1. This allows the devirtualization ofva[i]::equals. Since this is a method call on a value object, the calling convention changes, which leads to the assert because the input is an oop.I relaxed the assert a little bit to allow changing of the calling convention due to devirtualization.
Please take a look and leave your review, thansk a lot.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/valhalla.git pull/1935/head:pull/1935$ git checkout pull/1935Update a local copy of the PR:
$ git checkout pull/1935$ git pull https://git.openjdk.org/valhalla.git pull/1935/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1935View PR using the GUI difftool:
$ git pr show -t 1935Using diff file
Download this PR as a diff file:
https://git.openjdk.org/valhalla/pull/1935.diff
Using Webrev
Link to Webrev Comment