8013633: Cleanup platform ifdefs in unsafe.cpp
Replace ifdefs with SUPPORTS_NATIVE_CX8 set in platform include file Reviewed-by: dholmes, dlong
This commit is contained in:
parent
a4ca5b8a49
commit
de01ed0a09
@ -30,4 +30,6 @@ const int BytesPerInstWord = 4;
|
|||||||
|
|
||||||
const int StackAlignmentInBytes = (2*wordSize);
|
const int StackAlignmentInBytes = (2*wordSize);
|
||||||
|
|
||||||
|
#define SUPPORTS_NATIVE_CX8
|
||||||
|
|
||||||
#endif // CPU_SPARC_VM_GLOBALDEFINITIONS_SPARC_HPP
|
#endif // CPU_SPARC_VM_GLOBALDEFINITIONS_SPARC_HPP
|
||||||
|
@ -27,4 +27,6 @@
|
|||||||
|
|
||||||
const int StackAlignmentInBytes = 16;
|
const int StackAlignmentInBytes = 16;
|
||||||
|
|
||||||
|
#define SUPPORTS_NATIVE_CX8
|
||||||
|
|
||||||
#endif // CPU_X86_VM_GLOBALDEFINITIONS_X86_HPP
|
#endif // CPU_X86_VM_GLOBALDEFINITIONS_X86_HPP
|
||||||
|
@ -315,10 +315,7 @@ UNSAFE_ENTRY(void, Unsafe_SetObjectVolatile(JNIEnv *env, jobject unsafe, jobject
|
|||||||
OrderAccess::fence();
|
OrderAccess::fence();
|
||||||
UNSAFE_END
|
UNSAFE_END
|
||||||
|
|
||||||
#if defined(SPARC) || defined(X86)
|
#ifndef SUPPORTS_NATIVE_CX8
|
||||||
// Sparc and X86 have atomic jlong (8 bytes) instructions
|
|
||||||
|
|
||||||
#else
|
|
||||||
// Keep old code for platforms which may not have atomic jlong (8 bytes) instructions
|
// Keep old code for platforms which may not have atomic jlong (8 bytes) instructions
|
||||||
|
|
||||||
// Volatile long versions must use locks if !VM_Version::supports_cx8().
|
// Volatile long versions must use locks if !VM_Version::supports_cx8().
|
||||||
@ -356,7 +353,7 @@ UNSAFE_ENTRY(void, Unsafe_SetLongVolatile(JNIEnv *env, jobject unsafe, jobject o
|
|||||||
}
|
}
|
||||||
UNSAFE_END
|
UNSAFE_END
|
||||||
|
|
||||||
#endif // not SPARC and not X86
|
#endif // not SUPPORTS_NATIVE_CX8
|
||||||
|
|
||||||
#define DEFINE_GETSETOOP(jboolean, Boolean) \
|
#define DEFINE_GETSETOOP(jboolean, Boolean) \
|
||||||
\
|
\
|
||||||
@ -420,8 +417,7 @@ DEFINE_GETSETOOP_VOLATILE(jint, Int);
|
|||||||
DEFINE_GETSETOOP_VOLATILE(jfloat, Float);
|
DEFINE_GETSETOOP_VOLATILE(jfloat, Float);
|
||||||
DEFINE_GETSETOOP_VOLATILE(jdouble, Double);
|
DEFINE_GETSETOOP_VOLATILE(jdouble, Double);
|
||||||
|
|
||||||
#if defined(SPARC) || defined(X86)
|
#ifdef SUPPORTS_NATIVE_CX8
|
||||||
// Sparc and X86 have atomic jlong (8 bytes) instructions
|
|
||||||
DEFINE_GETSETOOP_VOLATILE(jlong, Long);
|
DEFINE_GETSETOOP_VOLATILE(jlong, Long);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -450,8 +446,7 @@ UNSAFE_END
|
|||||||
|
|
||||||
UNSAFE_ENTRY(void, Unsafe_SetOrderedLong(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jlong x))
|
UNSAFE_ENTRY(void, Unsafe_SetOrderedLong(JNIEnv *env, jobject unsafe, jobject obj, jlong offset, jlong x))
|
||||||
UnsafeWrapper("Unsafe_SetOrderedLong");
|
UnsafeWrapper("Unsafe_SetOrderedLong");
|
||||||
#if defined(SPARC) || defined(X86)
|
#ifdef SUPPORTS_NATIVE_CX8
|
||||||
// Sparc and X86 have atomic jlong (8 bytes) instructions
|
|
||||||
SET_FIELD_VOLATILE(obj, offset, jlong, x);
|
SET_FIELD_VOLATILE(obj, offset, jlong, x);
|
||||||
#else
|
#else
|
||||||
// Keep old code for platforms which may not have atomic long (8 bytes) instructions
|
// Keep old code for platforms which may not have atomic long (8 bytes) instructions
|
||||||
|
Loading…
x
Reference in New Issue
Block a user