< prev index next >

src/hotspot/share/runtime/biasedLocking.cpp

Print this page
rev 47862 : imported patch 10.07.open.rebase_20171110.dcubed
rev 47866 : robinw CR: Fix some inefficient code, update some comments, fix some indents, and add some 'const' specifiers.


 198     // Object is anonymously biased. We can get here if, for
 199     // example, we revoke the bias due to an identity hash code
 200     // being computed for an object.
 201     if (!allow_rebias) {
 202       obj->set_mark(unbiased_prototype);
 203     }
 204     // Log at "info" level if not bulk, else "trace" level
 205     if (!is_bulk) {
 206       log_info(biasedlocking)("  Revoked bias of anonymously-biased object");
 207     } else {
 208       log_trace(biasedlocking)("  Revoked bias of anonymously-biased object");
 209     }
 210     return BiasedLocking::BIAS_REVOKED;
 211   }
 212 
 213   // Handle case where the thread toward which the object was biased has exited
 214   bool thread_is_alive = false;
 215   if (requesting_thread == biased_thread) {
 216     thread_is_alive = true;
 217   } else {
 218     for (JavaThreadIteratorWithHandle jtiwh; JavaThread *cur_thread = jtiwh.next(); ) {
 219       if (cur_thread == biased_thread) {
 220         thread_is_alive = true;
 221         break;
 222       }
 223     }
 224   }
 225   if (!thread_is_alive) {
 226     if (allow_rebias) {
 227       obj->set_mark(biased_prototype);
 228     } else {
 229       obj->set_mark(unbiased_prototype);
 230     }
 231     // Log at "info" level if not bulk, else "trace" level
 232     if (!is_bulk) {
 233       log_info(biasedlocking)("  Revoked bias of object biased toward dead thread ("
 234                               PTR_FORMAT ")", p2i(biased_thread));
 235     } else {
 236       log_trace(biasedlocking)("  Revoked bias of object biased toward dead thread ("
 237                                PTR_FORMAT ")", p2i(biased_thread));
 238     }
 239     return BiasedLocking::BIAS_REVOKED;
 240   }
 241 
 242   // Log at "info" level if not bulk, else "trace" level
 243   if (!is_bulk) {
 244     log_info(biasedlocking)("  Revoked bias of object biased toward live thread ("




 198     // Object is anonymously biased. We can get here if, for
 199     // example, we revoke the bias due to an identity hash code
 200     // being computed for an object.
 201     if (!allow_rebias) {
 202       obj->set_mark(unbiased_prototype);
 203     }
 204     // Log at "info" level if not bulk, else "trace" level
 205     if (!is_bulk) {
 206       log_info(biasedlocking)("  Revoked bias of anonymously-biased object");
 207     } else {
 208       log_trace(biasedlocking)("  Revoked bias of anonymously-biased object");
 209     }
 210     return BiasedLocking::BIAS_REVOKED;
 211   }
 212 
 213   // Handle case where the thread toward which the object was biased has exited
 214   bool thread_is_alive = false;
 215   if (requesting_thread == biased_thread) {
 216     thread_is_alive = true;
 217   } else {
 218     ThreadsListHandle tlh;
 219     thread_is_alive = tlh.includes(biased_thread);


 220   }


 221   if (!thread_is_alive) {
 222     if (allow_rebias) {
 223       obj->set_mark(biased_prototype);
 224     } else {
 225       obj->set_mark(unbiased_prototype);
 226     }
 227     // Log at "info" level if not bulk, else "trace" level
 228     if (!is_bulk) {
 229       log_info(biasedlocking)("  Revoked bias of object biased toward dead thread ("
 230                               PTR_FORMAT ")", p2i(biased_thread));
 231     } else {
 232       log_trace(biasedlocking)("  Revoked bias of object biased toward dead thread ("
 233                                PTR_FORMAT ")", p2i(biased_thread));
 234     }
 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 ("


< prev index next >