From a692523e95f34b2e74a63225b098b0c1d4a3636a Mon Sep 17 00:00:00 2001
From: "Daniel D. Daugherty" <dcubed@openjdk.org>
Date: Tue, 5 May 2015 18:57:57 -0700
Subject: [PATCH] 8079359: disable JDK-8061553 optimization while JDK-8077392
 is resolved

Borrow an unused SyncFlags value to disable the "fast enter" optimization.

Reviewed-by: lana, dsamersoff, amurillo
---
 hotspot/src/share/vm/runtime/sharedRuntime.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp
index bf10ebf1ca4..80a075e73d7 100644
--- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp
+++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp
@@ -1793,7 +1793,9 @@ JRT_END
 
 // Handles the uncommon case in locking, i.e., contention or an inflated lock.
 JRT_BLOCK_ENTRY(void, SharedRuntime::complete_monitor_locking_C(oopDesc* _obj, BasicLock* lock, JavaThread* thread))
-  if (!SafepointSynchronize::is_synchronizing()) {
+  // Disable ObjectSynchronizer::quick_enter() in default config
+  // until JDK-8077392 is resolved.
+  if ((SyncFlags & 256) != 0 && !SafepointSynchronize::is_synchronizing()) {
     // Only try quick_enter() if we're not trying to reach a safepoint
     // so that the calling thread reaches the safepoint more quickly.
     if (ObjectSynchronizer::quick_enter(_obj, thread, lock)) return;