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

Correct references to Unsafe.compareAndExchange methods #18914

Merged

Conversation

keithc-ca
Copy link
Contributor

The Unsafe method names no longer end with 'Volatile' so table entries for such names would never match. The misleading suffix was removed from the related INL methods.

The references were added before the initial release of OpenJ9 which was after they were removed
upstream; see ibmruntimes/openj9-openjdk-jdk9@eeee04c.

The Unsafe method names no longer end with 'Volatile' so table entries
for such names would never match. The misleading suffix was removed
from the related INL methods.

Signed-off-by: Keith W. Campbell <[email protected]>
@keithc-ca keithc-ca requested a review from gacholio February 7, 2024 17:25
@keithc-ca keithc-ca requested a review from dsouzai as a code owner February 7, 2024 17:25
@gacholio
Copy link
Contributor

gacholio commented Feb 7, 2024

Are the volatile methods gone from the current OpenJDK Java 8 releases (the headstream VM has to support every JDK level, though only the current release of each level).?

@keithc-ca
Copy link
Contributor Author

I couldn't find them in any flavour of Java 8 (not Semeru builds, nor IBM builds).

@gacholio
Copy link
Contributor

gacholio commented Feb 7, 2024

How have we been running the non-volatile versions? If we already have those implementations, should we not just delete the volatile versions rather than renaming them?

@keithc-ca
Copy link
Contributor Author

This simply makes the names of the implementing functions match the names of the methods they support, and removes table entries that would only be useful if the compareAndExchange*Volatile methods actually existed.

The Java 9 commit linked above includes this change to Unsafe.java:

<   public final native Object compareAndExchangeObjectVolatile(Object o, long offset,
<                                                               Object expected,
<                                                               Object x);
--
>   public final native Object compareAndExchangeObject(Object o, long offset,
>                                                       Object expected,
>                                                       Object x);

Prior to this change both compareAndExchangeObject and compareAndExchangeObjectVolatile would be recognized and handled the same way. Support for the latter method is no longer needed.

@gacholio
Copy link
Contributor

gacholio commented Feb 7, 2024

jenkins test sanity zlinux jdk8

@gacholio gacholio merged commit 525b78a into eclipse-openj9:master Feb 8, 2024
5 checks passed
@keithc-ca keithc-ca deleted the compareAndExchangeVolatile branch February 8, 2024 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants