Navigation Menu

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

8262901: [macos_aarch64] NativeCallTest expected:<-3.8194101E18> but was:<3.02668882E10> #10238

Closed
wants to merge 3 commits into from

Conversation

omikhaltsova
Copy link

@omikhaltsova omikhaltsova commented Sep 12, 2022

This PR is opened as a follow-up for [1] and included the "must-done" fixes pointed by @teshull.

This patch for JVMCI includes the following fixes related to the macOS AArch64 calling convention:

  1. arguments may consume slots on the stack that are not multiples of 8 bytes [2]
  2. natural alignment of stack arguments [2]
  3. stack must remain 16-byte aligned [3][4]

Tested with tier1 on macOS AArch64 and Linux AArch64.

[1] #6641
[2] https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms
[3] https://docs.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-160#stack
[4] https://docs.microsoft.com/en-us/cpp/build/stack-usage?view=msvc-170


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8262901: [macos_aarch64] NativeCallTest expected:<-3.8194101E18> but was:<3.02668882E10>

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10238/head:pull/10238
$ git checkout pull/10238

Update a local copy of the PR:
$ git checkout pull/10238
$ git pull https://git.openjdk.org/jdk pull/10238/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10238

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10238.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 12, 2022

👋 Welcome back omikhaltcova! A progress list of the required criteria for merging this PR into master 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 bot commented Sep 12, 2022

@omikhaltsova The following label will be automatically applied to this pull request:

  • hotspot-compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Sep 12, 2022
@omikhaltsova omikhaltsova marked this pull request as ready for review September 12, 2022 15:50
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 12, 2022
@mlbridge
Copy link

mlbridge bot commented Sep 12, 2022

Webrevs

ValueKind<?> valueKind = valueKindFactory.getValueKind(kind);
locations[i] = StackSlot.get(valueKind, currentStackOffset, !type.out);
currentStackOffset += Math.max(valueKind.getPlatformKind().getSizeInBytes(), target.wordSize);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I'm curious: why not subclass AArch64HotSpotRegisterConfig here, or maybe even use an interface, rather than the boolean?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to be closer to the original review #6641 that requires only 2 fixes and tried to do only this in order to continue easily.

Could you clarify please what boolean you talk about? private final boolean macOS; that was pushed into class AArch64HotSpotRegisterConfig, right? I'm hesitating a bit because of the highlighted code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that macOS boolean.

Maybe it's not worth the effort, but it seems to me as though the use of the boolean in several places is something of a code smell, and this patch makes it more so. The control flow is not easy to follow.
I am wondering if refactoring it so that the code between L269 and L291 were broken out into two methods, one for MacOS and one for the others. I might be wrong, but I'd try it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the tip! Absolutely agree, it's worth doing refactoring here. I'll try to follow this way.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@theRealAph could you please take a look! I've made some additional refactoring in order to get rid of those "boolean"s where it's possible. I moved them from AArch64HotSpotVMConfig to TargetDescription. This makes an access to them easier across the code. As a 2nd step it's possible to substitute these "boolean"s with "enum" if it's needed. But imho it's better to keep them as "boolean"s at the moment.
In addition I see a new class RISCV64HotSpotVMConfig (committed after this pr) that also declared the same boolean:
final boolean linuxOs = Services.getSavedProperty("os.name", "").startsWith("Linux");
If this refactoring is made, this "boolean" won't be needed as well because it can be accessed from TargetDescription.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks reasonable enough.

@omikhaltsova
Copy link
Author

The pre-submit tests for linux-x64-hs-minimal and macos-aarch64 were reran manually and succeeded.

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 18, 2022

@omikhaltsova This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@omikhaltsova
Copy link
Author

@teshull could you please take a look! I tried to make fixes according to your comments in #6641

Copy link
Contributor

@theRealAph theRealAph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks.

ValueKind<?> valueKind = valueKindFactory.getValueKind(kind);
locations[i] = StackSlot.get(valueKind, currentStackOffset, !type.out);
currentStackOffset += Math.max(valueKind.getPlatformKind().getSizeInBytes(), target.wordSize);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks reasonable enough.

@openjdk
Copy link

openjdk bot commented Nov 7, 2022

@omikhaltsova 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:

8262901: [macos_aarch64] NativeCallTest expected:<-3.8194101E18> but was:<3.02668882E10>

Reviewed-by: aph

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 905 new commits pushed to the master branch:

  • 4a68210: 6972078: Can not select single directory with GTKLookAndFeel
  • 4465361: 8295948: Support for Zicbop/prefetch instructions on RISC-V
  • f2acdfd: 8296638: RISC-V: NegVI node emits wrong code when vector element basic type is T_BYTE/T_SHORT
  • bfc5816: 8295475: Move non-resource allocation strategies out of ResourceObj
  • e802b12: 8296196: Class.getEnumConstants() throws undocumented ClassCastException and NullPointerException
  • 78a08a0: 8295430: Use cmsDoTransformLineStride instead of cmsDoTransform in the loop
  • f0a6e71: 8295812: Skip the "half float" support in LittleCMS during the build
  • 79c0092: 8285635: javax/swing/JRootPane/DefaultButtonTest.java failed with Default Button not pressed for L&F: com.sun.java.swing.plaf.motif.MotifLookAndFeel
  • 0981bfb: 8296156: [macos] Resize DMG windows and background to fit additional DMG contents
  • 93fed9b: 8296448: RISC-V: Fix temp usages of heapbase register killed by MacroAssembler::en/decode_klass_not_null
  • ... and 895 more: https://git.openjdk.org/jdk/compare/30def49c7286e2a6c2585bc85084b003eec4543a...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this 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 (@theRealAph) 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).

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 7, 2022
@teshull
Copy link

teshull commented Nov 10, 2022

@omikhaltsova Your changes look good to me. Thanks!

@omikhaltsova
Copy link
Author

@theRealAph @teshull thanks for the review!

@omikhaltsova
Copy link
Author

/integrate

@openjdk openjdk bot added the sponsor Pull request is ready to be sponsored label Nov 10, 2022
@openjdk
Copy link

openjdk bot commented Nov 10, 2022

@omikhaltsova
Your change (at version 8b9922a) is now ready to be sponsored by a Committer.

@AntonKozlov
Copy link
Member

/sponsor

@openjdk
Copy link

openjdk bot commented Nov 10, 2022

Going to push as commit 6b456f7.
Since your change was applied there have been 909 commits pushed to the master branch:

  • e1badb7: 8295871: G1: Use different explicit claim marks for CLDs
  • 9ef7852: 8290714: Make com.sun.jndi.dns.DnsClient virtual threads friendly
  • d6468be: 8293886: The abstract keyword can be removed in AESCipher
  • 54c986e: 8296715: CLDR v42 update for tzdata 2022f
  • 4a68210: 6972078: Can not select single directory with GTKLookAndFeel
  • 4465361: 8295948: Support for Zicbop/prefetch instructions on RISC-V
  • f2acdfd: 8296638: RISC-V: NegVI node emits wrong code when vector element basic type is T_BYTE/T_SHORT
  • bfc5816: 8295475: Move non-resource allocation strategies out of ResourceObj
  • e802b12: 8296196: Class.getEnumConstants() throws undocumented ClassCastException and NullPointerException
  • 78a08a0: 8295430: Use cmsDoTransformLineStride instead of cmsDoTransform in the loop
  • ... and 899 more: https://git.openjdk.org/jdk/compare/30def49c7286e2a6c2585bc85084b003eec4543a...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Nov 10, 2022
@openjdk openjdk bot closed this Nov 10, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review sponsor Pull request is ready to be sponsored labels Nov 10, 2022
@openjdk
Copy link

openjdk bot commented Nov 10, 2022

@AntonKozlov @omikhaltsova Pushed as commit 6b456f7.

💡 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
Labels
hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated
4 participants