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

Optimize jdk.internal.misc.Unsafe.storeStoreFence() into no-op on x86 platforms #19042

Open
jmesyou opened this issue Feb 28, 2024 · 1 comment

Comments

@jmesyou
Copy link
Contributor

jmesyou commented Feb 28, 2024

The @IntrinsicCandidate method storeStoreFence in jdk.internal.misc.Unsafe has the following implementation:

    /**
     * Ensures that stores before the fence will not be reordered with
     * stores after the fence.
     *
     * @since 9
     */
    @IntrinsicCandidate
    public final void storeStoreFence() {
        // If storeStoreFence intrinsic is not available, fall back to storeFence.
        storeFence();
    }

to prevent the reordering of stores and ensure the visibility of prior stores to subsequent stores. Currently, the JIT compiler does not supply an intrinsic for this method and so it is forwarded to a Unsafe.storeFence() call. This forwarded storeFence() call is unnecessary as the x86 memory model (see sec. 9.2.3.2) ensures stores are seen in program order.

@Er-Sadiq
Copy link

Hi , I am working on a fix will raise a PR soon
Thank you

Er-Sadiq added a commit to Er-Sadiq/openj9 that referenced this issue Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants