# HG changeset patch # User Man Cao # Date 1531878102 25200 # Tue Jul 17 18:41:42 2018 -0700 # Node ID ed80a7552b116f350609b0ca55a7910c54d8f5e2 # Parent 03f2bfdcb63646823a1060a181584acbad7c17ea Inline os::SpinPause() for X86 on non-Windows OS. diff --git a/src/hotspot/os_cpu/bsd_x86/bsd_x86_32.s b/src/hotspot/os_cpu/bsd_x86/bsd_x86_32.s --- a/src/hotspot/os_cpu/bsd_x86/bsd_x86_32.s +++ b/src/hotspot/os_cpu/bsd_x86/bsd_x86_32.s @@ -63,15 +63,6 @@ popl %eax ret - .globl SYMBOL(SpinPause) - ELF_TYPE(SpinPause,@function) - .p2align 4,,15 -SYMBOL(SpinPause): - rep - nop - movl $1, %eax - ret - # Support for void Copy::conjoint_bytes(void* from, # void* to, # size_t count) diff --git a/src/hotspot/os_cpu/bsd_x86/bsd_x86_64.s b/src/hotspot/os_cpu/bsd_x86/bsd_x86_64.s --- a/src/hotspot/os_cpu/bsd_x86/bsd_x86_64.s +++ b/src/hotspot/os_cpu/bsd_x86/bsd_x86_64.s @@ -46,15 +46,6 @@ .text - .globl SYMBOL(SpinPause) - .p2align 4,,15 - ELF_TYPE(SpinPause,@function) -SYMBOL(SpinPause): - rep - nop - movq $1, %rax - ret - # Support for void Copy::arrayof_conjoint_bytes(void* from, # void* to, # size_t count) diff --git a/src/hotspot/os_cpu/linux_x86/linux_x86_32.s b/src/hotspot/os_cpu/linux_x86/linux_x86_32.s --- a/src/hotspot/os_cpu/linux_x86/linux_x86_32.s +++ b/src/hotspot/os_cpu/linux_x86/linux_x86_32.s @@ -42,15 +42,6 @@ .text - .globl SpinPause - .type SpinPause,@function - .p2align 4,,15 -SpinPause: - rep - nop - movl $1, %eax - ret - # Support for void Copy::conjoint_bytes(void* from, # void* to, # size_t count) diff --git a/src/hotspot/os_cpu/linux_x86/linux_x86_64.s b/src/hotspot/os_cpu/linux_x86/linux_x86_64.s --- a/src/hotspot/os_cpu/linux_x86/linux_x86_64.s +++ b/src/hotspot/os_cpu/linux_x86/linux_x86_64.s @@ -38,15 +38,6 @@ .text - .globl SpinPause - .align 16 - .type SpinPause,@function -SpinPause: - rep - nop - movq $1, %rax - ret - # Support for void Copy::arrayof_conjoint_bytes(void* from, # void* to, # size_t count) diff --git a/src/hotspot/os_cpu/solaris_x86/solaris_x86_64.s b/src/hotspot/os_cpu/solaris_x86/solaris_x86_64.s --- a/src/hotspot/os_cpu/solaris_x86/solaris_x86_64.s +++ b/src/hotspot/os_cpu/solaris_x86/solaris_x86_64.s @@ -51,15 +51,6 @@ movq %fs:0x0,%rax ret - .globl SpinPause - .align 16 -SpinPause: - rep - nop - movq $1, %rax - ret - - / Support for void Copy::arrayof_conjoint_bytes(void* from, / void* to, / size_t count) diff --git a/src/hotspot/share/runtime/os.hpp b/src/hotspot/share/runtime/os.hpp --- a/src/hotspot/share/runtime/os.hpp +++ b/src/hotspot/share/runtime/os.hpp @@ -1031,6 +1031,13 @@ // of the global SpinPause() with C linkage. // It'd also be eligible for inlining on many platforms. +#if defined(X86) && !defined(_WINDOWS) +extern "C" int inline SpinPause() { + __asm__ __volatile__ ("pause"); + return 1; +} +#else extern "C" int SpinPause(); +#endif #endif // SHARE_VM_RUNTIME_OS_HPP