src/hotspot/share/runtime/biasedLocking.cpp
changeset 55479 80b27dc96ca3
parent 55005 9b70ebd131b4
child 55514 03468b206457
equal deleted inserted replaced
55478:ae2e53e379cb 55479:80b27dc96ca3
   624   assert(event->should_commit(), "invariant");
   624   assert(event->should_commit(), "invariant");
   625   event->set_revokedClass(k);
   625   event->set_revokedClass(k);
   626   event->set_disableBiasing(!op->is_bulk_rebias());
   626   event->set_disableBiasing(!op->is_bulk_rebias());
   627   event->set_safepointId(op->safepoint_id());
   627   event->set_safepointId(op->safepoint_id());
   628   event->commit();
   628   event->commit();
   629 }
       
   630 
       
   631 BiasedLocking::Condition BiasedLocking::revoke_own_locks_in_handshake(Handle obj, TRAPS) {
       
   632   markOop mark = obj->mark();
       
   633 
       
   634   if (!mark->has_bias_pattern()) {
       
   635     return NOT_BIASED;
       
   636   }
       
   637 
       
   638   Klass *k = obj->klass();
       
   639   markOop prototype_header = k->prototype_header();
       
   640   assert(mark->biased_locker() == THREAD &&
       
   641          prototype_header->bias_epoch() == mark->bias_epoch(), "Revoke failed, unhandled biased lock state");
       
   642   ResourceMark rm;
       
   643   log_info(biasedlocking)("Revoking bias by walking my own stack:");
       
   644   EventBiasedLockSelfRevocation event;
       
   645   BiasedLocking::Condition cond = revoke_bias(obj(), false, false, (JavaThread*) THREAD, NULL);
       
   646   ((JavaThread*) THREAD)->set_cached_monitor_info(NULL);
       
   647   assert(cond == BIAS_REVOKED, "why not?");
       
   648   if (event.should_commit()) {
       
   649     post_self_revocation_event(&event, k);
       
   650   }
       
   651   return cond;
       
   652 }
   629 }
   653 
   630 
   654 BiasedLocking::Condition BiasedLocking::revoke_and_rebias(Handle obj, bool attempt_rebias, TRAPS) {
   631 BiasedLocking::Condition BiasedLocking::revoke_and_rebias(Handle obj, bool attempt_rebias, TRAPS) {
   655   assert(!SafepointSynchronize::is_at_safepoint(), "must not be called while at safepoint");
   632   assert(!SafepointSynchronize::is_at_safepoint(), "must not be called while at safepoint");
   656 
   633