src/share/vm/runtime/sharedRuntime.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File 6951083 Sdiff src/share/vm/runtime

src/share/vm/runtime/sharedRuntime.cpp

Print this page




1418   // and patch the code with the same old data. Asi es la vida.
1419 
1420   if (moop->code() == NULL) return;
1421 
1422   if (nm->is_in_use()) {
1423 
1424     // Expect to find a native call there (unless it was no-inline cache vtable dispatch)
1425     MutexLockerEx ml_patch(Patching_lock, Mutex::_no_safepoint_check_flag);
1426     if (NativeCall::is_call_before(caller_pc + frame::pc_return_offset)) {
1427       NativeCall *call = nativeCall_before(caller_pc + frame::pc_return_offset);
1428       //
1429       // bug 6281185. We might get here after resolving a call site to a vanilla
1430       // virtual call. Because the resolvee uses the verified entry it may then
1431       // see compiled code and attempt to patch the site by calling us. This would
1432       // then incorrectly convert the call site to optimized and its downhill from
1433       // there. If you're lucky you'll get the assert in the bugid, if not you've
1434       // just made a call site that could be megamorphic into a monomorphic site
1435       // for the rest of its life! Just another racing bug in the life of
1436       // fixup_callers_callsite ...
1437       //
1438       RelocIterator iter(cb, call->instruction_address(), call->next_instruction_address());
1439       iter.next();
1440       assert(iter.has_current(), "must have a reloc at java call site");
1441       relocInfo::relocType typ = iter.reloc()->type();
1442       if ( typ != relocInfo::static_call_type &&
1443            typ != relocInfo::opt_virtual_call_type &&
1444            typ != relocInfo::static_stub_type) {
1445         return;
1446       }
1447       address destination = call->destination();
1448       if (destination != entry_point) {
1449         CodeBlob* callee = CodeCache::find_blob(destination);
1450         // callee == cb seems weird. It means calling interpreter thru stub.
1451         if (callee == cb || callee->is_adapter_blob()) {
1452           // static call or optimized virtual
1453           if (TraceCallFixup) {
1454             tty->print("fixup callsite           at " INTPTR_FORMAT " to compiled code for", caller_pc);
1455             moop->print_short_name(tty);
1456             tty->print_cr(" to " INTPTR_FORMAT, entry_point);
1457           }
1458           call->set_destination_mt_safe(entry_point);




1418   // and patch the code with the same old data. Asi es la vida.
1419 
1420   if (moop->code() == NULL) return;
1421 
1422   if (nm->is_in_use()) {
1423 
1424     // Expect to find a native call there (unless it was no-inline cache vtable dispatch)
1425     MutexLockerEx ml_patch(Patching_lock, Mutex::_no_safepoint_check_flag);
1426     if (NativeCall::is_call_before(caller_pc + frame::pc_return_offset)) {
1427       NativeCall *call = nativeCall_before(caller_pc + frame::pc_return_offset);
1428       //
1429       // bug 6281185. We might get here after resolving a call site to a vanilla
1430       // virtual call. Because the resolvee uses the verified entry it may then
1431       // see compiled code and attempt to patch the site by calling us. This would
1432       // then incorrectly convert the call site to optimized and its downhill from
1433       // there. If you're lucky you'll get the assert in the bugid, if not you've
1434       // just made a call site that could be megamorphic into a monomorphic site
1435       // for the rest of its life! Just another racing bug in the life of
1436       // fixup_callers_callsite ...
1437       //
1438       RelocIterator iter(nm, call->instruction_address(), call->next_instruction_address());
1439       iter.next();
1440       assert(iter.has_current(), "must have a reloc at java call site");
1441       relocInfo::relocType typ = iter.reloc()->type();
1442       if ( typ != relocInfo::static_call_type &&
1443            typ != relocInfo::opt_virtual_call_type &&
1444            typ != relocInfo::static_stub_type) {
1445         return;
1446       }
1447       address destination = call->destination();
1448       if (destination != entry_point) {
1449         CodeBlob* callee = CodeCache::find_blob(destination);
1450         // callee == cb seems weird. It means calling interpreter thru stub.
1451         if (callee == cb || callee->is_adapter_blob()) {
1452           // static call or optimized virtual
1453           if (TraceCallFixup) {
1454             tty->print("fixup callsite           at " INTPTR_FORMAT " to compiled code for", caller_pc);
1455             moop->print_short_name(tty);
1456             tty->print_cr(" to " INTPTR_FORMAT, entry_point);
1457           }
1458           call->set_destination_mt_safe(entry_point);


src/share/vm/runtime/sharedRuntime.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File