Skip to content

Conversation

@vnkozlov
Copy link
Contributor

@vnkozlov vnkozlov commented Nov 17, 2023

Currently all platforms have declared their own address variable for method_entry_barrier stub. Some have even slightly different name: nmethod_entry_barrier. For Leyden project one address is preferable.
In aarch64 code changed movptr to lea instruction to get relocation info as on x86.

Tested x86 and aarch64, tier1-4, xcomp, stress. I need help to test on other platforms. Thanks!


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-8320272: Make method_entry_barrier address shared (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 16708

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 17, 2023

👋 Welcome back kvn! 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 openjdk bot added the rfr Pull request is ready for review label Nov 17, 2023
@openjdk
Copy link

openjdk bot commented Nov 17, 2023

@vnkozlov The following labels will be automatically applied to this pull request:

  • graal
  • hotspot

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

@openjdk openjdk bot added graal graal-dev@openjdk.org hotspot hotspot-dev@openjdk.org labels Nov 17, 2023
@mlbridge
Copy link

mlbridge bot commented Nov 17, 2023

Webrevs

@vnkozlov
Copy link
Contributor Author

Arm (32-bit) cross build is broken by recent changes 8301997

@vnkozlov
Copy link
Contributor Author

/cc hotspot-compiler

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Nov 17, 2023
@openjdk
Copy link

openjdk bot commented Nov 17, 2023

@vnkozlov
The hotspot-compiler label was successfully added.

@dean-long
Copy link
Member

This seems fine, but you could explain a little more why this is useful for Leyden? I would think having StubRoutines::method_entry_barrier() would be enough, and that it could reference the existing platform-specific name, minimizing changes. I don't understand why the storage needs to be shared in StubRoutines::_method_entry_barrier, for example.

@vnkozlov
Copy link
Contributor Author

vnkozlov commented Nov 17, 2023

This seems fine, but you could explain a little more why this is useful for Leyden? I would think having StubRoutines::method_entry_barrier() would be enough, and that it could reference the existing platform-specific name, minimizing changes. I don't understand why the storage needs to be shared in StubRoutines::_method_entry_barrier, for example.

Thank you for looking, Dean. Yes, your suggestion would work too. Leyden code calls StubRoutines::method_entry_barrier() to get address: SCCache.cpp#L3337
But we would need StubRoutines::method_entry_barrier() implementation for each platform in such case. And having duplication and different names does not feel right for me ;^)

AMD64_ONLY(nmethod_entry_barrier = StubRoutines::x86::method_entry_barrier());
AARCH64_ONLY(nmethod_entry_barrier = StubRoutines::aarch64::method_entry_barrier());
AMD64_ONLY(nmethod_entry_barrier = StubRoutines::method_entry_barrier());
AARCH64_ONLY(nmethod_entry_barrier = StubRoutines::method_entry_barrier());
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that's there's a single name you can remove the 2 per arch definitions in favor of single assignment statement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@openjdk
Copy link

openjdk bot commented Nov 18, 2023

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

8320272: Make method_entry_barrier address shared

Reviewed-by: dlong

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

  • a2c0fa6: 8320372: test/jdk/sun/security/x509/DNSName/LeadingPeriod.java validity check failed
  • 3aefd1c: 8320234: Merge doclint.Env.AccessKind with tool.AccessKind
  • d6d7bdc: 8319817: Charset constructor should make defensive copy of aliases
  • 0712b22: 8320147: Remove DumpSharedSpaces
  • 6e86904: 8319973: AArch64: Save and restore FPCR in the call stub
  • 04fd17e: 8320410: Reflow markdown in building.md
  • 7f23110: 8319928: Exceptions thrown by cleanup actions should be handled correctly
  • a6098e4: 8320280: RISC-V: Avoid passing t0 as temp register to MacroAssembler::lightweight_lock/unlock
  • 60c8d9c: 8320300: Adjust hs_err output in malloc/mmap error cases
  • 9f6a4a3: 8320386: Remove java/nio/channels/vthread/BlockingChannelOps.java#direct-register from ProblemList
  • ... and 11 more: https://git.openjdk.org/jdk/compare/9902d2eb177072c108933056cba544cc5a34bb54...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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Nov 18, 2023
@RealFYang
Copy link
Member

@vnkozlov : Hi, I have tested this on linux-riscv platform. Result looks fine.
Would you mind apply following small add-on change which adds relocation info for this platform too? Thanks.
16708-riscv.diff.txt

@vnkozlov
Copy link
Contributor Author

Thank you, @RealFYang, for testing. I applied your patch.

@vnkozlov
Copy link
Contributor Author

/integrate

@openjdk
Copy link

openjdk bot commented Nov 21, 2023

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

  • 9311749: 8320526: Use title case in building.md
  • 9598ff8: 8315969: compiler/rangechecks/TestRangeCheckHoistingScaledIV.java: make flagless
  • 53eb6f1: 8187591: -Werror turns incubator module warning to an error
  • 570dffb: 8310807: java/nio/channels/DatagramChannel/Connect.java timed out
  • 21a59b9: 8282726: java/net/vthread/BlockingSocketOps.java timeout/hang intermittently on Windows
  • 9232070: 8318480: Obsolete UseCounterDecay and remove CounterDecayMinIntervalLength
  • e055fae: 8264425: Update building.md on non-English locales on Windows
  • c4aee66: 8320222: Wrong bytecode accepted, and StackMap table generated
  • 604d29a: 8304446: javap --system flag doesn't override system APIs
  • 839dd65: 8319244: implement JVMTI handshakes support for virtual threads
  • ... and 32 more: https://git.openjdk.org/jdk/compare/9902d2eb177072c108933056cba544cc5a34bb54...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Nov 21, 2023

@vnkozlov Pushed as commit c4aba87.

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

@vnkozlov vnkozlov deleted the JDK-8320272 branch November 21, 2023 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

graal graal-dev@openjdk.org hotspot hotspot-dev@openjdk.org hotspot-compiler hotspot-compiler-dev@openjdk.org integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

4 participants