Skip to content

Commit c75c388

Browse files
author
David Holmes
committed
8318776: Require supports_cx8 to always be true
Reviewed-by: eosterlund, shade, dcubed
1 parent 14557e7 commit c75c388

39 files changed

+31
-444
lines changed

make/data/hotspot-symbols/symbols-unix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ JVM_SetStackWalkContinuation
203203
JVM_SetThreadPriority
204204
JVM_SleepNanos
205205
JVM_StartThread
206-
JVM_SupportsCX8
207206
JVM_TotalMemory
208207
JVM_UnloadLibrary
209208
JVM_WaitForReferencePendingList

src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1511,7 +1511,6 @@ void LIR_Assembler::casl(Register addr, Register newval, Register cmpval) {
15111511

15121512

15131513
void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) {
1514-
assert(VM_Version::supports_cx8(), "wrong machine");
15151514
Register addr;
15161515
if (op->addr()->is_register()) {
15171516
addr = as_reg(op->addr());

src/hotspot/cpu/aarch64/vm_version_aarch64.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ static SpinWait get_spin_wait_desc() {
6868
}
6969

7070
void VM_Version::initialize() {
71-
_supports_cx8 = true;
7271
_supports_atomic_getset4 = true;
7372
_supports_atomic_getadd4 = true;
7473
_supports_atomic_getset8 = true;

src/hotspot/cpu/arm/c1_LIRAssembler_arm.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,6 @@ void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) {
13851385
__ mov(dest, 1, eq);
13861386
__ mov(dest, 0, ne);
13871387
} else if (op->code() == lir_cas_long) {
1388-
assert(VM_Version::supports_cx8(), "wrong machine");
13891388
Register cmp_value_lo = op->cmp_value()->as_register_lo();
13901389
Register cmp_value_hi = op->cmp_value()->as_register_hi();
13911390
Register new_value_lo = op->new_value()->as_register_lo();

src/hotspot/cpu/arm/vm_version_arm_32.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,16 @@ void VM_Version::early_initialize() {
128128
// use proper dmb instruction
129129
get_os_cpu_info();
130130

131+
// Future cleanup: if SUPPORTS_NATIVE_CX8 is defined then we should not need
132+
// any alternative solutions. At present this allows for the theoretical
133+
// possibility of building for ARMv7 and then running on ARMv5 or 6. If that
134+
// is impossible then the ARM port folk should clean this up.
131135
_kuser_helper_version = *(int*)KUSER_HELPER_VERSION_ADDR;
136+
#ifndef SUPPORTS_NATIVE_CX8
132137
// armv7 has the ldrexd instruction that can be used to implement cx8
133138
// armv5 with linux >= 3.1 can use kernel helper routine
134139
_supports_cx8 = (supports_ldrexd() || supports_kuser_cmpxchg64());
140+
#endif
135141
}
136142

137143
void VM_Version::initialize() {
@@ -278,7 +284,7 @@ void VM_Version::initialize() {
278284
_supports_atomic_getadd8 = supports_ldrexd();
279285

280286
#ifdef COMPILER2
281-
assert(_supports_cx8 && _supports_atomic_getset4 && _supports_atomic_getadd4
287+
assert(supports_cx8() && _supports_atomic_getset4 && _supports_atomic_getadd4
282288
&& _supports_atomic_getset8 && _supports_atomic_getadd8, "C2: atomic operations must be supported");
283289
#endif
284290
char buf[512];

src/hotspot/cpu/ppc/vm_version_ppc.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,6 @@ void VM_Version::initialize() {
200200
print_features();
201201
}
202202

203-
// PPC64 supports 8-byte compare-exchange operations (see Atomic::cmpxchg)
204-
// and 'atomic long memory ops' (see Unsafe_GetLongVolatile).
205-
_supports_cx8 = true;
206-
207203
// Used by C1.
208204
_supports_atomic_getset4 = true;
209205
_supports_atomic_getadd4 = true;

src/hotspot/cpu/riscv/c1_LIRAssembler_riscv.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1251,7 +1251,6 @@ void LIR_Assembler::emit_opTypeCheck(LIR_OpTypeCheck* op) {
12511251
}
12521252

12531253
void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) {
1254-
assert(VM_Version::supports_cx8(), "wrong machine");
12551254
Register addr;
12561255
if (op->addr()->is_register()) {
12571256
addr = as_reg(op->addr());

src/hotspot/cpu/riscv/vm_version_riscv.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ RV_FEATURE_FLAGS(ADD_RV_FEATURE_IN_LIST)
4646
nullptr};
4747

4848
void VM_Version::initialize() {
49-
_supports_cx8 = true;
5049
_supports_atomic_getset4 = true;
5150
_supports_atomic_getadd4 = true;
5251
_supports_atomic_getset8 = true;

src/hotspot/cpu/s390/c1_LIRAssembler_s390.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2670,7 +2670,6 @@ void LIR_Assembler::emit_compare_and_swap(LIR_OpCompareAndSwap* op) {
26702670
Register addr = op->addr()->as_pointer_register();
26712671
Register t1_cmp = Z_R1_scratch;
26722672
if (op->code() == lir_cas_long) {
2673-
assert(VM_Version::supports_cx8(), "wrong machine");
26742673
Register cmp_value_lo = op->cmp_value()->as_register_lo();
26752674
Register new_value_lo = op->new_value()->as_register_lo();
26762675
__ z_lgr(t1_cmp, cmp_value_lo);

src/hotspot/cpu/s390/vm_version_s390.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -287,11 +287,6 @@ void VM_Version::initialize() {
287287
FLAG_SET_DEFAULT(UsePopCountInstruction, true);
288288
}
289289

290-
// z/Architecture supports 8-byte compare-exchange operations
291-
// (see Atomic::cmpxchg)
292-
// and 'atomic long memory ops' (see Unsafe_GetLongVolatile).
293-
_supports_cx8 = true;
294-
295290
_supports_atomic_getadd4 = VM_Version::has_LoadAndALUAtomicV1();
296291
_supports_atomic_getadd8 = VM_Version::has_LoadAndALUAtomicV1();
297292

0 commit comments

Comments
 (0)