< prev index next >

src/hotspot/share/runtime/biasedLocking.cpp

Print this page
rev 54697 : imported patch 8221734-v2-merge
rev 54698 : imported patch 8221734-v2

@@ -625,11 +625,11 @@
   // We can revoke the biases of anonymously-biased objects
   // efficiently enough that we should not cause these revocations to
   // update the heuristics because doing so may cause unwanted bulk
   // revocations (which are expensive) to occur.
   markOop mark = obj->mark();
-  if (mark->is_biased_anonymously()) {
+  if (mark->is_biased_anonymously() && !attempt_rebias) {
     // We are probably trying to revoke the bias of this object due to
     // an identity hash code computation. Try to revoke the bias
     // without a safepoint. This is possible if we can successfully
     // compare-and-exchange an unbiased header into the mark word of
     // the object, meaning that no other thread has raced to acquire

@@ -727,11 +727,12 @@
     return NOT_BIASED;
   } else if (heuristics == HR_SINGLE_REVOKE) {
     markOop mark = obj->mark();
     Klass *k = obj->klass();
     markOop prototype_header = k->prototype_header();
-    if (mark->biased_locker_is((JavaThread*) THREAD) &&
+    if (mark->has_bias_pattern() &&
+        mark->biased_locker() == ((JavaThread*) THREAD) &&
         prototype_header->bias_epoch() == mark->bias_epoch()) {
       // A thread is trying to revoke the bias of an object biased
       // toward it, again likely due to an identity hash code
       // computation. We can again avoid a safepoint in this case
       // since we are only going to walk our own stack. There are no
< prev index next >