Mercurial > hg > truffle
diff src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp @ 671:d0994e5bebce
6822204: volatile fences should prefer lock:addl to actual mfence instructions
Reviewed-by: kvn, phh
author | never |
---|---|
date | Thu, 26 Mar 2009 14:31:45 -0700 |
parents | a61af66fc99e |
children | bd02caa94611 |
line wrap: on
line diff
--- a/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp Tue Mar 24 15:09:52 2009 -0700 +++ b/src/os_cpu/linux_x86/vm/orderAccess_linux_x86.inline.hpp Thu Mar 26 14:31:45 2009 -0700 @@ -44,11 +44,12 @@ inline void OrderAccess::fence() { if (os::is_MP()) { + // always use locked addl since mfence is sometimes expensive #ifdef AMD64 - __asm__ __volatile__ ("mfence":::"memory"); + __asm__ volatile ("lock; addl $0,0(%%rsp)" : : : "cc", "memory"); #else __asm__ volatile ("lock; addl $0,0(%%esp)" : : : "cc", "memory"); -#endif // AMD64 +#endif } }