< prev index next >

src/hotspot/share/runtime/deoptimization.cpp

Print this page
rev 54936 : imported patch 8221734-v3
rev 54937 : imported patch 8221734-v4


1302   get_monitors_from_stack(objects_to_revoke, thread, fr, map);
1303 
1304   if (SafepointSynchronize::is_at_safepoint()) {
1305     BiasedLocking::revoke_at_safepoint(objects_to_revoke);
1306   } else {
1307     BiasedLocking::revoke(objects_to_revoke);
1308   }
1309 }
1310 
1311 void Deoptimization::revoke_handshake(JavaThread* thread, frame fr, RegisterMap* map) {
1312   if (!UseBiasedLocking) {
1313     return;
1314   }
1315   GrowableArray<Handle>* objects_to_revoke = new GrowableArray<Handle>();
1316   get_monitors_from_stack(objects_to_revoke, thread, fr, map);
1317 
1318   int len = objects_to_revoke->length();
1319   for (int i = 0; i < len; i++) {
1320     oop obj = (objects_to_revoke->at(i))();
1321     markOop mark = obj->mark();
1322     assert(!mark->has_bias_pattern() || mark->biased_locker() == thread, "Can't revoke");
1323     BiasedLocking::revoke_own_locks_in_handshake(objects_to_revoke->at(i), thread);
1324     assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now");
1325   }
1326 }
1327 
1328 
1329 void Deoptimization::deoptimize_single_frame(JavaThread* thread, frame fr, Deoptimization::DeoptReason reason) {
1330   assert(fr.can_be_deoptimized(), "checking frame type");
1331 
1332   gather_statistics(reason, Action_none, Bytecodes::_illegal);
1333 
1334   if (LogCompilation && xtty != NULL) {
1335     CompiledMethod* cm = fr.cb()->as_compiled_method_or_null();
1336     assert(cm != NULL, "only compiled methods can deopt");
1337 
1338     ttyLocker ttyl;
1339     xtty->begin_head("deoptimized thread='" UINTX_FORMAT "' reason='%s' pc='" INTPTR_FORMAT "'",(uintx)thread->osthread()->thread_id(), trap_reason_name(reason), p2i(fr.pc()));
1340     cm->log_identity(xtty);
1341     xtty->end_head();
1342     for (ScopeDesc* sd = cm->scope_desc_at(fr.pc()); ; sd = sd->sender()) {




1302   get_monitors_from_stack(objects_to_revoke, thread, fr, map);
1303 
1304   if (SafepointSynchronize::is_at_safepoint()) {
1305     BiasedLocking::revoke_at_safepoint(objects_to_revoke);
1306   } else {
1307     BiasedLocking::revoke(objects_to_revoke);
1308   }
1309 }
1310 
1311 void Deoptimization::revoke_handshake(JavaThread* thread, frame fr, RegisterMap* map) {
1312   if (!UseBiasedLocking) {
1313     return;
1314   }
1315   GrowableArray<Handle>* objects_to_revoke = new GrowableArray<Handle>();
1316   get_monitors_from_stack(objects_to_revoke, thread, fr, map);
1317 
1318   int len = objects_to_revoke->length();
1319   for (int i = 0; i < len; i++) {
1320     oop obj = (objects_to_revoke->at(i))();
1321     markOop mark = obj->mark();

1322     BiasedLocking::revoke_own_locks_in_handshake(objects_to_revoke->at(i), thread);
1323     assert(!obj->mark()->has_bias_pattern(), "biases should be revoked by now");
1324   }
1325 }
1326 
1327 
1328 void Deoptimization::deoptimize_single_frame(JavaThread* thread, frame fr, Deoptimization::DeoptReason reason) {
1329   assert(fr.can_be_deoptimized(), "checking frame type");
1330 
1331   gather_statistics(reason, Action_none, Bytecodes::_illegal);
1332 
1333   if (LogCompilation && xtty != NULL) {
1334     CompiledMethod* cm = fr.cb()->as_compiled_method_or_null();
1335     assert(cm != NULL, "only compiled methods can deopt");
1336 
1337     ttyLocker ttyl;
1338     xtty->begin_head("deoptimized thread='" UINTX_FORMAT "' reason='%s' pc='" INTPTR_FORMAT "'",(uintx)thread->osthread()->thread_id(), trap_reason_name(reason), p2i(fr.pc()));
1339     cm->log_identity(xtty);
1340     xtty->end_head();
1341     for (ScopeDesc* sd = cm->scope_desc_at(fr.pc()); ; sd = sd->sender()) {


< prev index next >