hotspot/src/share/vm/runtime/biasedLocking.cpp
changeset 37251 9fc139ad74b5
parent 36186 06763de0d7ad
child 40655 9f644073d3a0
equal deleted inserted replaced
37250:2fecd8bdc8e9 37251:9fc139ad74b5
   147 static BiasedLocking::Condition revoke_bias(oop obj, bool allow_rebias, bool is_bulk, JavaThread* requesting_thread) {
   147 static BiasedLocking::Condition revoke_bias(oop obj, bool allow_rebias, bool is_bulk, JavaThread* requesting_thread) {
   148   markOop mark = obj->mark();
   148   markOop mark = obj->mark();
   149   if (!mark->has_bias_pattern()) {
   149   if (!mark->has_bias_pattern()) {
   150     if (log_is_enabled(Info, biasedlocking)) {
   150     if (log_is_enabled(Info, biasedlocking)) {
   151       ResourceMark rm;
   151       ResourceMark rm;
   152       log_info(biasedlocking)("  (Skipping revocation of object of type %s "
   152       log_info(biasedlocking)("  (Skipping revocation of object " INTPTR_FORMAT
   153                               "because it's no longer biased)",
   153                               ", mark " INTPTR_FORMAT ", type %s"
   154                               obj->klass()->external_name());
   154                               ", requesting thread " INTPTR_FORMAT
       
   155                               " because it's no longer biased)",
       
   156                               p2i((void *)obj), (intptr_t) mark,
       
   157                               obj->klass()->external_name(),
       
   158                               (intptr_t) requesting_thread);
   155     }
   159     }
   156     return BiasedLocking::NOT_BIASED;
   160     return BiasedLocking::NOT_BIASED;
   157   }
   161   }
   158 
   162 
   159   uint age = mark->age();
   163   uint age = mark->age();
   161   markOop unbiased_prototype = markOopDesc::prototype()->set_age(age);
   165   markOop unbiased_prototype = markOopDesc::prototype()->set_age(age);
   162 
   166 
   163   // Log at "info" level if not bulk, else "trace" level
   167   // Log at "info" level if not bulk, else "trace" level
   164   if (!is_bulk) {
   168   if (!is_bulk) {
   165     ResourceMark rm;
   169     ResourceMark rm;
   166     log_info(biasedlocking)("Revoking bias of object " INTPTR_FORMAT " , mark "
   170     log_info(biasedlocking)("Revoking bias of object " INTPTR_FORMAT ", mark "
   167                             INTPTR_FORMAT " , type %s , prototype header " INTPTR_FORMAT
   171                             INTPTR_FORMAT ", type %s, prototype header " INTPTR_FORMAT
   168                             " , allow rebias %d , requesting thread " INTPTR_FORMAT,
   172                             ", allow rebias %d, requesting thread " INTPTR_FORMAT,
   169                             p2i((void *)obj),
   173                             p2i((void *)obj),
   170                             (intptr_t) mark,
   174                             (intptr_t) mark,
   171                             obj->klass()->external_name(),
   175                             obj->klass()->external_name(),
   172                             (intptr_t) obj->klass()->prototype_header(),
   176                             (intptr_t) obj->klass()->prototype_header(),
   173                             (allow_rebias ? 1 : 0),
   177                             (allow_rebias ? 1 : 0),
   220     } else {
   224     } else {
   221       obj->set_mark(unbiased_prototype);
   225       obj->set_mark(unbiased_prototype);
   222     }
   226     }
   223     // Log at "info" level if not bulk, else "trace" level
   227     // Log at "info" level if not bulk, else "trace" level
   224     if (!is_bulk) {
   228     if (!is_bulk) {
   225       log_info(biasedlocking)("  Revoked bias of object biased toward dead thread");
   229       log_info(biasedlocking)("  Revoked bias of object biased toward dead thread ("
   226     } else {
   230                               PTR_FORMAT ")", p2i(biased_thread));
   227       log_trace(biasedlocking)("  Revoked bias of object biased toward dead thread");
   231     } else {
       
   232       log_trace(biasedlocking)("  Revoked bias of object biased toward dead thread ("
       
   233                                PTR_FORMAT ")", p2i(biased_thread));
   228     }
   234     }
   229     return BiasedLocking::BIAS_REVOKED;
   235     return BiasedLocking::BIAS_REVOKED;
       
   236   }
       
   237 
       
   238   // Log at "info" level if not bulk, else "trace" level
       
   239   if (!is_bulk) {
       
   240     log_info(biasedlocking)("  Revoked bias of object biased toward live thread ("
       
   241                             PTR_FORMAT ")", p2i(biased_thread));
       
   242   } else {
       
   243     log_trace(biasedlocking)("  Revoked bias of object biased toward live thread ("
       
   244                                PTR_FORMAT ")", p2i(biased_thread));
   230   }
   245   }
   231 
   246 
   232   // Thread owning bias is alive.
   247   // Thread owning bias is alive.
   233   // Check to see whether it currently owns the lock and, if so,
   248   // Check to see whether it currently owns the lock and, if so,
   234   // write down the needed displaced headers to the thread's stack.
   249   // write down the needed displaced headers to the thread's stack.