Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions src/hotspot/os_cpu/bsd_aarch64/os_bsd_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,6 @@ void os::current_thread_enable_wx(WXMode mode) {
}
#endif

static inline void atomic_copy64(const volatile void *src, volatile void *dst) {
*(jlong *) dst = *(const jlong *) src;
}

extern "C" {
int SpinPause() {
// We don't use StubRoutines::aarch64::spin_wait stub in order to
Expand Down Expand Up @@ -559,43 +555,43 @@ extern "C" {
if (from > to) {
const jshort *end = from + count;
while (from < end)
*(to++) = *(from++);
*((volatile jshort*) to++) = *(from++);
}
else if (from < to) {
const jshort *end = from;
from += count - 1;
to += count - 1;
while (from >= end)
*(to--) = *(from--);
*((volatile jshort*) to--) = *(from--);
}
}
void _Copy_conjoint_jints_atomic(const jint* from, jint* to, size_t count) {
if (from > to) {
const jint *end = from + count;
while (from < end)
*(to++) = *(from++);
*((volatile jint*) to++) = *(from++);
}
else if (from < to) {
const jint *end = from;
from += count - 1;
to += count - 1;
while (from >= end)
*(to--) = *(from--);
*((volatile jint*) to--) = *(from--);
}
}

void _Copy_conjoint_jlongs_atomic(const jlong* from, jlong* to, size_t count) {
if (from > to) {
const jlong *end = from + count;
while (from < end)
atomic_copy64(from++, to++);
*((volatile jlong*) to++) = *(from++);
}
else if (from < to) {
const jlong *end = from;
from += count - 1;
to += count - 1;
while (from >= end)
atomic_copy64(from--, to--);
*((volatile jlong*) to--) = *(from--);
}
}

Expand Down
16 changes: 6 additions & 10 deletions src/hotspot/os_cpu/linux_aarch64/os_linux_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,6 @@ int os::extra_bang_size_in_bytes() {
return 0;
}

static inline void atomic_copy64(const volatile void *src, volatile void *dst) {
*(jlong *) dst = *(const jlong *) src;
}

extern "C" {
int SpinPause() {
using spin_wait_func_ptr_t = void (*)();
Expand All @@ -409,43 +405,43 @@ extern "C" {
if (from > to) {
const jshort *end = from + count;
while (from < end)
*(to++) = *(from++);
*((volatile jshort*) to++) = *(from++);
}
else if (from < to) {
const jshort *end = from;
from += count - 1;
to += count - 1;
while (from >= end)
*(to--) = *(from--);
*((volatile jshort*) to--) = *(from--);
}
}
void _Copy_conjoint_jints_atomic(const jint* from, jint* to, size_t count) {
if (from > to) {
const jint *end = from + count;
while (from < end)
*(to++) = *(from++);
*((volatile jint*) to++) = *(from++);
}
else if (from < to) {
const jint *end = from;
from += count - 1;
to += count - 1;
while (from >= end)
*(to--) = *(from--);
*((volatile jint*) to--) = *(from--);
}
}

void _Copy_conjoint_jlongs_atomic(const jlong* from, jlong* to, size_t count) {
if (from > to) {
const jlong *end = from + count;
while (from < end)
atomic_copy64(from++, to++);
*((volatile jlong*) to++) = *(from++);
}
else if (from < to) {
const jlong *end = from;
from += count - 1;
to += count - 1;
while (from >= end)
atomic_copy64(from--, to--);
*((volatile jlong*) to--) = *(from--);
}
}

Expand Down