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

8327729: Remove deprecated xxxObject methods from jdk.internal.misc.Unsafe #18176

Closed
wants to merge 4 commits into from

Conversation

eirbjo
Copy link
Contributor

@eirbjo eirbjo commented Mar 10, 2024

Please review this PR which removes the 19 deprecated xxObject* alias methods from jdk.internal.misc.Unsafe.

These methods were added in JDK-8213043 (JDK 12), presumably to allow jsr166.jar to be used across JDK versions. This was a follow-up fix after JDK-8207146 had renamed these methods to `xxReference*'.

Since OpenJDK is now the single source of truth for java.util.concurrent, time has come to remove these deprecated alias methods.

This change was initially discussed here: https://mail.openjdk.org/pipermail/core-libs-dev/2024-March/119993.html

Testing: This is a pure deletion of deprecated methods, so the PR includes no test changes and the noreg-cleanup label is added in the JBS. I have verified that all test/jdk/java/util/concurrent/* tests pass.

Tagging @DougLea and @Martin-Buchholz to verify that this removal is timely.


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-8327729: Remove deprecated xxxObject methods from jdk.internal.misc.Unsafe (Enhancement - P4)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 18176

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 10, 2024

👋 Welcome back eirbjo! 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 Mar 10, 2024

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

  • core-libs

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 core-libs core-libs-dev@openjdk.org label Mar 10, 2024
@eirbjo eirbjo marked this pull request as ready for review March 10, 2024 06:18
@openjdk openjdk bot added the rfr Pull request is ready for review label Mar 10, 2024
@mlbridge
Copy link

mlbridge bot commented Mar 10, 2024

Webrevs

Copy link
Member

@Martin-Buchholz Martin-Buchholz left a comment

Choose a reason for hiding this comment

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

Thanks for the tidying - I agree the time is right.

@openjdk
Copy link

openjdk bot commented Mar 10, 2024

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

8327729: Remove deprecated xxxObject methods from jdk.internal.misc.Unsafe

Reviewed-by: martin, alanb, mchung

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

  • 0a6e64e: 8327424: ProblemList serviceability/sa/TestJmapCore.java on all platforms with ZGC
  • c65d308: 8327812: JFR: Remove debug message in Function.Maximum
  • b9bc31f: 8327790: Improve javadoc for ResolvedJavaType.hasFinalizableSubclass
  • 18de932: 8325991: Accelerate Poly1305 on x86_64 using AVX2 instructions
  • d74b907: 8327093: Add truncate function to BitMap API
  • ffd43c9: 8327461: KeyStore getEntry is not thread-safe
  • 680ac2c: 8327689: RISC-V: adjust test filters of zfh extension
  • 570ad67: 8269428: java/util/concurrent/ConcurrentHashMap/ToArray.java timed out
  • 63dd6d1: 8327387: G1: Refactor region liveness processing after completion of concurrent marking
  • f2b5ffd: 8326578: Clean up networking properties documentation
  • ... and 170 more: https://git.openjdk.org/jdk/compare/bb6b04897b5d83dd89fc11074dd66af024f9c6fc...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 Mar 10, 2024
Copy link
Contributor

@AlanBateman AlanBateman left a comment

Choose a reason for hiding this comment

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

Removal of unused methods from an internal class, no impact to sun.misc.Unsafe.

…eg/gc/shenandoah/compiler/TestUnsafeLoadStoreMergedHeapStableTests.java
@eirbjo
Copy link
Contributor Author

eirbjo commented Mar 10, 2024

Thanks for reviewing, Martin and Alan.

GHA revealed two call sites for getAndSetObject in the test test/hotspot/jtreg/gc/shenandoah/compiler/TestUnsafeLoadStoreMergedHeapStableTests.java.

I have replaced these with the getAndSetReference, grepped for any remaining uses without finding anything. Let's see what GHA says.

@eirbjo
Copy link
Contributor Author

eirbjo commented Mar 10, 2024

/label add hotspot, hotspot-gc, shenandoah

@openjdk openjdk bot added hotspot hotspot-dev@openjdk.org hotspot-gc hotspot-gc-dev@openjdk.org shenandoah shenandoah-dev@openjdk.org labels Mar 10, 2024
@openjdk
Copy link

openjdk bot commented Mar 10, 2024

@eirbjo
The hotspot label was successfully added.

The hotspot-gc label was successfully added.

The shenandoah label was successfully added.

@jaikiran
Copy link
Member

Hello Eirik, I've triggered internal CI testing of the current state of this PR to run tier1, tier2 and tier3.

@AlanBateman
Copy link
Contributor

GHA revealed two call sites for getAndSetObject in the test test/hotspot/jtreg/gc/shenandoah/compiler/TestUnsafeLoadStoreMergedHeapStableTests.java.

I have replaced these with the getAndSetReference, grepped for any remaining uses without finding anything. Let's see what GHA says.

Yes, you'll need to run all tests to make sure that there aren't any others, e.g. test/hotspot/jtreg/compiler/stable/TestUnstableStable.java.

@eirbjo
Copy link
Contributor Author

eirbjo commented Mar 10, 2024

Yes, you'll need to run all tests to make sure that there aren't any others, e.g. test/hotspot/jtreg/compiler/stable/TestUnstableStable.java.

I've updated TestUnstableStable to use putReference and also fixed a stray code comment reference to Unsafe.compareAndSetObject in BufferedInputStream.

@jaikiran Expect TestUnstableStable above to fail your CI run.

@DougLea
Copy link
Contributor

DougLea commented Mar 10, 2024

OK with me.

@jaikiran
Copy link
Member

@jaikiran Expect TestUnstableStable above to fail your CI run.

Right, that's the only test that failed (with a compilation error) on all platforms.

@eirbjo
Copy link
Contributor Author

eirbjo commented Mar 11, 2024

Yes, you'll need to run all tests to make sure that there aren't any others, e.g. test/hotspot/jtreg/compiler/stable/TestUnstableStable.java.

Alan,

With @jaikiran running Oracle CI tier1, tier2, tier3 and observing only the now-fixed TestUnstableStable.java test fail, would you consider re-approving the current state of this PR?

Copy link
Member

@mlchung mlchung left a comment

Choose a reason for hiding this comment

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

This should wait for @jaikiran approval confirming the test result is good.

@jaikiran
Copy link
Member

Hello Eirik, Mandy, tier1, tier2, tier3 testing of the latest approved state of this PR passed without failures.

@eirbjo
Copy link
Contributor Author

eirbjo commented Mar 12, 2024

Thanks for helping out with this cleanup effort, Jaikiran, Alan, Mandy, Doug and Martin!

/integrate

@openjdk
Copy link

openjdk bot commented Mar 12, 2024

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

  • 313e814: 8324682: Remove redefinition of NULL for XLC compiler
  • 8a3bdd5: 8327995: Remove unused Unused_Variable
  • 201042f: 8327487: Further augment WorstCaseTests with more cases
  • 379ad1f: 8312444: Delete unused parameters and variables in SocketPermission
  • 782206b: 8327748: Convert javax/swing/JFileChooser/6798062/bug6798062.java applet test to main
  • 0776fff: 8327794: RISC-V: enable extension features based on impid (Rivos specific change)
  • cfd9209: 8327751: Convert javax/swing/JInternalFrame/6726866/bug6726866.java applet test to main
  • 2cf3524: 8325433: Type annotations on primitive types are not linked
  • 5056902: 8327361: Update some comments after JDK-8139457
  • 78beb03: 8327750: Convert javax/swing/JFileChooser/FileFilterDescription/FileFilterDescription.java applet test to main
  • ... and 190 more: https://git.openjdk.org/jdk/compare/bb6b04897b5d83dd89fc11074dd66af024f9c6fc...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Mar 12, 2024

@eirbjo Pushed as commit 5b41466.

💡 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
core-libs core-libs-dev@openjdk.org hotspot hotspot-dev@openjdk.org hotspot-gc hotspot-gc-dev@openjdk.org integrated Pull request has been integrated shenandoah shenandoah-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

6 participants