Skip to content
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

8272307: [lworld] [AArch64] TestCallingConventionC1 test63 and test64 get incorrect result #527

Closed
wants to merge 1 commit into from

Conversation

nick-arm
Copy link
Member

@nick-arm nick-arm commented Aug 12, 2021

These two were hidden by the earlier IR test failures. The errors look like:

  Caused by: java.lang.RuntimeException: assertEquals: expected -1163019586 to equal 777
  at jdk.test.lib.Asserts.fail(Asserts.java:594)
  at jdk.test.lib.Asserts.assertEquals(Asserts.java:205)
  at jdk.test.lib.Asserts.assertEquals(Asserts.java:189)
  at jdk.test.lib.Asserts.assertEQ(Asserts.java:166)
  at compiler.valhalla.inlinetypes.TestCallingConventionC1.test64_verifier(TestCallingConventionC1.java:1518)
  ... 9 more

In the C1 scalarised entry point we call a runtime stub to allocate objects for buffering the incoming inline types. The runtime stub returns its result in r0 which is also j_rarg7 and might be holding a live argument value. To work around this we temporarily move j_rarg7 into r21 which is known to be free at this point and then move it back after the call. However if a GC occurs during the runtime call and an object held in j_rarg7 is moved, r21 will still be pointing at the old from-space copy after the call returns because it's not recorded in the oop map. Fix that by having the stub return the object array in r20 and leave r0-r7 untouched.


Progress

  • Change must not contain extraneous whitespace

Issue

  • JDK-8272307: [lworld] [AArch64] TestCallingConventionC1 test63 and test64 get incorrect result

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/valhalla pull/527/head:pull/527
$ git checkout pull/527

Update a local copy of the PR:
$ git checkout pull/527
$ git pull https://git.openjdk.java.net/valhalla pull/527/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 527

View PR using the GUI difftool:
$ git pr show -t 527

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/valhalla/pull/527.diff

… get incorrect result

These two were hidden by the earlier IR test failures.  The errors look
like:

  Caused by: java.lang.RuntimeException: assertEquals: expected -1163019586 to equal 777
  at jdk.test.lib.Asserts.fail(Asserts.java:594)
  at jdk.test.lib.Asserts.assertEquals(Asserts.java:205)
  at jdk.test.lib.Asserts.assertEquals(Asserts.java:189)
  at jdk.test.lib.Asserts.assertEQ(Asserts.java:166)
  at compiler.valhalla.inlinetypes.TestCallingConventionC1.test64_verifier(TestCallingConventionC1.java:1518)
  ... 9 more

In the C1 scalarised entry point we call a runtime stub to allocate
objects for buffering the incoming inline types.  The runtime stub
returns its result in r0 which is also j_rarg7 and might be holding a
live argument value.  To work around this we temporarily move j_rarg7
into r21 which is known to be free at this point and then move it back
after the call.  However if a GC occurs during the runtime call and an
object held in j_rarg7 is moved, r21 will still be pointing at the old
from-space copy after the call returns because it's not recorded in the
oop map.  Fix that by having the stub return the object array in r20 and
leave r0-r7 untouched.
@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Aug 12, 2021

👋 Welcome back ngasson! A progress list of the required criteria for merging this PR into lworld will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

@openjdk openjdk bot commented Aug 12, 2021

@nick-arm 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:

8272307: [lworld] [AArch64] TestCallingConventionC1 test63 and test64 get incorrect result

Reviewed-by: thartmann

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 lworld branch. If another commit should be pushed before you perform the /integrate command, your PR will be automatically rebased. If you prefer to avoid any potential automatic rebasing, please check the documentation for the /integrate command for further details.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@TobiHartmann) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

@mlbridge
Copy link

@mlbridge mlbridge bot commented Aug 12, 2021

Webrevs

Copy link
Member

@TobiHartmann TobiHartmann left a comment

Looks good to me.

@nick-arm
Copy link
Member Author

@nick-arm nick-arm commented Aug 13, 2021

Thanks @TobiHartmann!

@nick-arm
Copy link
Member Author

@nick-arm nick-arm commented Aug 13, 2021

/integrate

@openjdk openjdk bot added the sponsor label Aug 13, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Aug 13, 2021

@nick-arm
Your change (at version ff5a938) is now ready to be sponsored by a Committer.

@TobiHartmann
Copy link
Member

@TobiHartmann TobiHartmann commented Aug 13, 2021

/sponsor

@openjdk
Copy link

@openjdk openjdk bot commented Aug 13, 2021

Going to push as commit f85b10b.

@openjdk
Copy link

@openjdk openjdk bot commented Aug 13, 2021

@TobiHartmann @nick-arm Pushed as commit f85b10b.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants