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

8272723: Don't use Access API to access primitive fields #5187

Closed
wants to merge 7 commits into from

Conversation

rkennke
Copy link
Contributor

@rkennke rkennke commented Aug 19, 2021

For earlier incarnations of Shenandoah, we needed to put barriers before accessing primitive fields. This is no longer necessary nor implemented/used by any GC, and we should simplify the code to do plain access instead.

(We may want to remove remaining primitive access machinery in the Access API soon)

Testing:

  • build x86_32 and x86_64
  • tier1
  • tier2
  • hotspot_gc

Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8272723: Don't use Access API to access primitive fields

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5187

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

Using diff file

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

@bridgekeeper
Copy link

bridgekeeper bot commented Aug 19, 2021

👋 Welcome back rkennke! 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 Aug 19, 2021
@openjdk
Copy link

openjdk bot commented Aug 19, 2021

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

  • hotspot

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 hotspot-dev@openjdk.org label Aug 19, 2021
@mlbridge
Copy link

mlbridge bot commented Aug 19, 2021

Webrevs

@rkennke rkennke marked this pull request as draft Aug 19, 2021
@openjdk openjdk bot removed the rfr Pull request is ready for review label Aug 19, 2021
@shipilev
Copy link
Member

shipilev commented Aug 19, 2021

I think you missed the spots at least in in oop.cpp and typeArrayOop.inline.hpp too. Need to grep for HeapAccess in the entire Hotspot?

src/hotspot/share/oops/oop.hpp Outdated Show resolved Hide resolved
volatile T ret = RawAccess<MO_SEQ_CST>::load(addr());
return normalize_for_read(ret);
} else {
T ret = HeapAccess<MO_SEQ_CST>::load_at(_obj, _offset);
return normalize_for_read(ret);
}
GuardUnsafeAccess guard(_thread);
volatile T ret = Atomic::load_acquire(addr());
Copy link
Member

@stefank stefank Aug 20, 2021

Choose a reason for hiding this comment

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

Is MO_SEQ_CST to load_acquire mapping correct?

Copy link
Contributor

@fisk fisk Aug 20, 2021

Choose a reason for hiding this comment

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

No it is not.

Copy link
Contributor

@fisk fisk Aug 20, 2021

Choose a reason for hiding this comment

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

Is MO_SEQ_CST to load_acquire mapping correct?

We should probably retain RawAccess<MO_SEQ_CST> here to get the right semantics.

Copy link
Contributor Author

@rkennke rkennke Aug 20, 2021

Choose a reason for hiding this comment

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

I'll restore the volatile accesses to use RawAccess<MO_SEQ_CST> for now, but maybe it would be better in the long run to have simpler Atomic::load<MO_SEQ_CST> accessors?

Copy link
Member

@stefank stefank left a comment

Thanks for cleaning this up. I do have a few comments that I'd like to get addressed.

@rkennke rkennke marked this pull request as ready for review Aug 20, 2021
@openjdk openjdk bot added the rfr Pull request is ready for review label Aug 20, 2021
@bridgekeeper
Copy link

bridgekeeper bot commented Sep 17, 2021

@rkennke 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!

@rkennke
Copy link
Contributor Author

rkennke commented Sep 17, 2021

Ping?

@rkennke
Copy link
Contributor Author

rkennke commented Oct 7, 2021

This PR has been lingering for a while. Can I get another review, please? Maybe @fisk or @stefank?
Thanks, Roman

fisk
fisk approved these changes Oct 8, 2021
Copy link
Contributor

@fisk fisk left a comment

Looks good.

@openjdk
Copy link

openjdk bot commented Oct 8, 2021

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

8272723: Don't use Access API to access primitive fields

Reviewed-by: stefank, eosterlund

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

  • c032186: 8272968: AArch64: Remove redundant matching rules for commutative ops
  • a05873a: 8274952: jdk/jfr/api/consumer/TestRecordedFrameType.java failed when c1 disabled
  • 5ecc99b: 8274620: resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java is timing out
  • 2ff3977: 8275004: CDS build failure with gcc11
  • 296f853: 8274029: Remove jtreg tag manual=yesno for java/awt/print/Dialog/DialogOrient.java
  • 2c83559: 8274882: Cleanup redundant boxing in java.desktop
  • 6d1d4d5: 8268231: Aarch64: Use ldp in intrinsics for String.compareTo
  • aac6c4e: 8272229: BasicSplitPaneDivider:oneTouchExpandableChanged() returns leftButton and rightButton as null with GTKLookAndFeel
  • f640c7a: 8274806: Simplify equals() call on nullable variable and a constant in java.desktop
  • 9c431dd: 8274900: Too weak variable type leads to unnecessary cast in jdk.javadoc
  • ... and 570 more: https://git.openjdk.java.net/jdk/compare/a81e5e9353a635a2307ff4e5de8a304c14f08047...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 Oct 8, 2021
Copy link
Member

@stefank stefank left a comment

Looks good

@rkennke
Copy link
Contributor Author

rkennke commented Oct 11, 2021

/integrate

@openjdk
Copy link

openjdk bot commented Oct 11, 2021

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

  • 49f8ce6: 8274773: [TESTBUG] UnsafeIntrinsicsTest intermittently fails on weak memory model platform
  • c032186: 8272968: AArch64: Remove redundant matching rules for commutative ops
  • a05873a: 8274952: jdk/jfr/api/consumer/TestRecordedFrameType.java failed when c1 disabled
  • 5ecc99b: 8274620: resourcehogs/serviceability/sa/TestHeapDumpForLargeArray.java is timing out
  • 2ff3977: 8275004: CDS build failure with gcc11
  • 296f853: 8274029: Remove jtreg tag manual=yesno for java/awt/print/Dialog/DialogOrient.java
  • 2c83559: 8274882: Cleanup redundant boxing in java.desktop
  • 6d1d4d5: 8268231: Aarch64: Use ldp in intrinsics for String.compareTo
  • aac6c4e: 8272229: BasicSplitPaneDivider:oneTouchExpandableChanged() returns leftButton and rightButton as null with GTKLookAndFeel
  • f640c7a: 8274806: Simplify equals() call on nullable variable and a constant in java.desktop
  • ... and 571 more: https://git.openjdk.java.net/jdk/compare/a81e5e9353a635a2307ff4e5de8a304c14f08047...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Oct 11, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 11, 2021
@openjdk
Copy link

openjdk bot commented Oct 11, 2021

@rkennke Pushed as commit 3edee1e.

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

@rkennke rkennke deleted the JDK-8272723 branch Oct 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hotspot hotspot-dev@openjdk.org integrated Pull request has been integrated
4 participants