8276096: Simplify Unsafe.{load|store}Fence fallbacks by delegating to fullFence

Reviewed-by: psandoz, aph, dholmes
This commit is contained in:
Aleksey Shipilev 2021-11-04 08:03:51 +00:00
parent 558ee40a4a
commit fb0be81f01
3 changed files with 10 additions and 15 deletions

View file

@ -3395,7 +3395,10 @@ public final class Unsafe {
* @since 1.8
*/
@IntrinsicCandidate
public native void loadFence();
public final void loadFence() {
// If loadFence intrinsic is not available, fall back to full fence.
fullFence();
}
/**
* Ensures that loads and stores before the fence will not be reordered with
@ -3406,11 +3409,13 @@ public final class Unsafe {
*
* Provides a StoreStore barrier followed by a LoadStore barrier.
*
*
* @since 1.8
*/
@IntrinsicCandidate
public native void storeFence();
public final void storeFence() {
// If storeFence intrinsic is not available, fall back to full fence.
fullFence();
}
/**
* Ensures that loads and stores before the fence will not be reordered