--- old/src/hotspot/cpu/x86/globals_x86.hpp 2019-10-17 17:31:26.000000000 -0400 +++ new/src/hotspot/cpu/x86/globals_x86.hpp 2019-10-17 17:31:25.000000000 -0400 @@ -94,9 +94,20 @@ #if defined(_LP64) || defined(_WINDOWS) define_pd_global(bool, ThreadLocalHandshakes, true); +// ObjectMonitor ref_count is implemented in LP64 C2 fast_lock() +// and fast_unlock() so we don't need the handshake by default. +#ifdef _LP64 +define_pd_global(bool, HandshakeAfterDeflateIdleMonitors, false); +#else +define_pd_global(bool, HandshakeAfterDeflateIdleMonitors, true); +#endif #else // get_thread() is slow on linux 32 bit, therefore off by default define_pd_global(bool, ThreadLocalHandshakes, false); +// ObjectMonitor ref_count not implemented in C2 fast_lock() or +// fast_unlock() so use a handshake for safety. +// Will use a safepoint instead of a handshake on this platform. +define_pd_global(bool, HandshakeAfterDeflateIdleMonitors, true); #endif #define ARCH_FLAGS(develop, \