< prev index next >

test/hotspot/gtest/oops/test_markOop.cpp

Print this page
rev 56635 : v2.00 -> v2.05 (CR5/v2.05/8-for-jdk13) patches combined into one; merge with 8229212.patch; merge with jdk-14+11; merge with 8230184.patch; merge with 8230876.patch; merge with jdk-14+15; merge with jdk-14+18.

@@ -116,10 +116,14 @@
   }
 
   // This is no longer biased, because ObjectLocker revokes the bias.
   assert_test_pattern(h_obj, "is_neutral no_hash");
 
+  // Hash the object then print it.
+  intx hash = h_obj->identity_hash();
+  assert_test_pattern(h_obj, "is_neutral hash=0x");
+
   // Wait gets the lock inflated.
   {
     ObjectLocker ol(h_obj, THREAD);
 
     Semaphore done(0);

@@ -130,16 +134,20 @@
     ol.wait(THREAD);
     assert_test_pattern(h_obj, "monitor");
     done.wait_with_safepoint_check(THREAD);  // wait till the thread is done.
   }
 
+  if (!AsyncDeflateIdleMonitors) {
+    // With AsyncDeflateIdleMonitors, the collect() call below
+    // does not guarantee monitor deflation.
   // Make the object older. Not all GCs use this field.
   Universe::heap()->collect(GCCause::_java_lang_system_gc);
   if (UseParallelGC) {
     assert_test_pattern(h_obj, "is_neutral no_hash age 1");
   }
 
   // Hash the object then print it.
   intx hash = h_obj->identity_hash();
   assert_test_pattern(h_obj, "is_neutral hash=0x");
+  }
 }
 #endif // PRODUCT
< prev index next >