--- old/src/hotspot/share/runtime/biasedLocking.cpp 2019-05-03 10:53:55.847395663 +0200 +++ new/src/hotspot/share/runtime/biasedLocking.cpp 2019-05-03 10:53:55.381379821 +0200 @@ -627,7 +627,7 @@ // 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 @@ -729,7 +729,8 @@ 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