< prev index next >

src/hotspot/share/runtime/biasedLocking.cpp

Print this page
rev 56251 : imported patch 8226705-v1
rev 56253 : [mq]: 8226705-v3-pat

@@ -724,26 +724,28 @@
   }
 
   assert(!obj->mark().has_bias_pattern(), "must not be biased");
 }
 
-void BiasedLocking::revoke_own_locks(Handle obj, TRAPS) {
+void BiasedLocking::revoke_own_lock(Handle obj, TRAPS) {
+  assert(THREAD->is_Java_thread(), "must be called by a JavaThread");
+  JavaThread* thread = (JavaThread*)THREAD;
+
   markWord mark = obj->mark();
 
   if (!mark.has_bias_pattern()) {
     return;
   }
 
   Klass *k = obj->klass();
-  markWord prototype_header = k->prototype_header();
-  assert(mark.biased_locker() == THREAD &&
-         prototype_header.bias_epoch() == mark.bias_epoch(), "Revoke failed, unhandled biased lock state");
+  assert(mark.biased_locker() == thread &&
+         k->prototype_header().bias_epoch() == mark.bias_epoch(), "Revoke failed, unhandled biased lock state");
   ResourceMark rm;
   log_info(biasedlocking)("Revoking bias by walking my own stack:");
   EventBiasedLockSelfRevocation event;
-  BiasedLocking::walk_stack_and_revoke(obj(), (JavaThread*) THREAD);
-  ((JavaThread*) THREAD)->set_cached_monitor_info(NULL);
+  BiasedLocking::walk_stack_and_revoke(obj(), (JavaThread*) thread);
+  thread->set_cached_monitor_info(NULL);
   assert(!obj->mark().has_bias_pattern(), "invariant");
   if (event.should_commit()) {
     post_self_revocation_event(&event, k);
   }
 }
< prev index next >