< prev index next >

src/hotspot/share/runtime/deoptimization.cpp

Print this page
rev 56098 : imported patch 8226705-8221734-baseline
rev 56099 : imported patch 8226705-rebase


1455   GrowableArray<Handle>* objects_to_revoke = new GrowableArray<Handle>();
1456   get_monitors_from_stack(objects_to_revoke, thread, fr, map);
1457 
1458   if (SafepointSynchronize::is_at_safepoint()) {
1459     BiasedLocking::revoke_at_safepoint(objects_to_revoke);
1460   } else {
1461     BiasedLocking::revoke(objects_to_revoke, thread);
1462   }
1463 }
1464 
1465 void Deoptimization::revoke_using_handshake(JavaThread* thread, frame fr, RegisterMap* map) {
1466   if (!UseBiasedLocking) {
1467     return;
1468   }
1469   GrowableArray<Handle>* objects_to_revoke = new GrowableArray<Handle>();
1470   get_monitors_from_stack(objects_to_revoke, thread, fr, map);
1471 
1472   int len = objects_to_revoke->length();
1473   for (int i = 0; i < len; i++) {
1474     oop obj = (objects_to_revoke->at(i))();
1475     BiasedLocking::revoke_own_locks_in_handshake(objects_to_revoke->at(i), thread);
1476     assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now");
1477   }
1478 }
1479 
1480 
1481 void Deoptimization::deoptimize_single_frame(JavaThread* thread, frame fr, Deoptimization::DeoptReason reason) {
1482   assert(fr.can_be_deoptimized(), "checking frame type");
1483 
1484   gather_statistics(reason, Action_none, Bytecodes::_illegal);
1485 
1486   if (LogCompilation && xtty != NULL) {
1487     CompiledMethod* cm = fr.cb()->as_compiled_method_or_null();
1488     assert(cm != NULL, "only compiled methods can deopt");
1489 
1490     ttyLocker ttyl;
1491     xtty->begin_head("deoptimized thread='" UINTX_FORMAT "' reason='%s' pc='" INTPTR_FORMAT "'",(uintx)thread->osthread()->thread_id(), trap_reason_name(reason), p2i(fr.pc()));
1492     cm->log_identity(xtty);
1493     xtty->end_head();
1494     for (ScopeDesc* sd = cm->scope_desc_at(fr.pc()); ; sd = sd->sender()) {
1495       xtty->begin_elem("jvms bci='%d'", sd->bci());
1496       xtty->method(sd->method());




1455   GrowableArray<Handle>* objects_to_revoke = new GrowableArray<Handle>();
1456   get_monitors_from_stack(objects_to_revoke, thread, fr, map);
1457 
1458   if (SafepointSynchronize::is_at_safepoint()) {
1459     BiasedLocking::revoke_at_safepoint(objects_to_revoke);
1460   } else {
1461     BiasedLocking::revoke(objects_to_revoke, thread);
1462   }
1463 }
1464 
1465 void Deoptimization::revoke_using_handshake(JavaThread* thread, frame fr, RegisterMap* map) {
1466   if (!UseBiasedLocking) {
1467     return;
1468   }
1469   GrowableArray<Handle>* objects_to_revoke = new GrowableArray<Handle>();
1470   get_monitors_from_stack(objects_to_revoke, thread, fr, map);
1471 
1472   int len = objects_to_revoke->length();
1473   for (int i = 0; i < len; i++) {
1474     oop obj = (objects_to_revoke->at(i))();
1475     BiasedLocking::revoke_own_locks(objects_to_revoke->at(i), thread);
1476     assert(!obj->mark().has_bias_pattern(), "biases should be revoked by now");
1477   }
1478 }
1479 
1480 
1481 void Deoptimization::deoptimize_single_frame(JavaThread* thread, frame fr, Deoptimization::DeoptReason reason) {
1482   assert(fr.can_be_deoptimized(), "checking frame type");
1483 
1484   gather_statistics(reason, Action_none, Bytecodes::_illegal);
1485 
1486   if (LogCompilation && xtty != NULL) {
1487     CompiledMethod* cm = fr.cb()->as_compiled_method_or_null();
1488     assert(cm != NULL, "only compiled methods can deopt");
1489 
1490     ttyLocker ttyl;
1491     xtty->begin_head("deoptimized thread='" UINTX_FORMAT "' reason='%s' pc='" INTPTR_FORMAT "'",(uintx)thread->osthread()->thread_id(), trap_reason_name(reason), p2i(fr.pc()));
1492     cm->log_identity(xtty);
1493     xtty->end_head();
1494     for (ScopeDesc* sd = cm->scope_desc_at(fr.pc()); ; sd = sd->sender()) {
1495       xtty->begin_elem("jvms bci='%d'", sd->bci());
1496       xtty->method(sd->method());


< prev index next >