544 address stub; |
544 address stub; |
545 // Look up the code blob |
545 // Look up the code blob |
546 CodeBlob *cb = CodeCache::find_blob(pc); |
546 CodeBlob *cb = CodeCache::find_blob(pc); |
547 |
547 |
548 // Should be an nmethod |
548 // Should be an nmethod |
549 assert( cb && cb->is_nmethod(), "safepoint polling: pc must refer to an nmethod" ); |
549 guarantee(cb != NULL && cb->is_nmethod(), "safepoint polling: pc must refer to an nmethod"); |
550 |
550 |
551 // Look up the relocation information |
551 // Look up the relocation information |
552 assert( ((nmethod*)cb)->is_at_poll_or_poll_return(pc), |
552 assert( ((nmethod*)cb)->is_at_poll_or_poll_return(pc), |
553 "safepoint polling: type must be poll" ); |
553 "safepoint polling: type must be poll" ); |
554 |
554 |
1707 // we did we'd leap into space because the callsite needs to use |
1707 // we did we'd leap into space because the callsite needs to use |
1708 // "to interpreter" stub in order to load up the Method*. Don't |
1708 // "to interpreter" stub in order to load up the Method*. Don't |
1709 // ask me how I know this... |
1709 // ask me how I know this... |
1710 |
1710 |
1711 CodeBlob* cb = CodeCache::find_blob(caller_pc); |
1711 CodeBlob* cb = CodeCache::find_blob(caller_pc); |
1712 if (!cb->is_nmethod() || entry_point == moop->get_c2i_entry()) { |
1712 if (cb == NULL || !cb->is_nmethod() || entry_point == moop->get_c2i_entry()) { |
1713 return; |
1713 return; |
1714 } |
1714 } |
1715 |
1715 |
1716 // The check above makes sure this is a nmethod. |
1716 // The check above makes sure this is a nmethod. |
1717 nmethod* nm = cb->as_nmethod_or_null(); |
1717 nmethod* nm = cb->as_nmethod_or_null(); |
1758 } |
1758 } |
1759 address destination = call->destination(); |
1759 address destination = call->destination(); |
1760 if (destination != entry_point) { |
1760 if (destination != entry_point) { |
1761 CodeBlob* callee = CodeCache::find_blob(destination); |
1761 CodeBlob* callee = CodeCache::find_blob(destination); |
1762 // callee == cb seems weird. It means calling interpreter thru stub. |
1762 // callee == cb seems weird. It means calling interpreter thru stub. |
1763 if (callee == cb || callee->is_adapter_blob()) { |
1763 if (callee != NULL && (callee == cb || callee->is_adapter_blob())) { |
1764 // static call or optimized virtual |
1764 // static call or optimized virtual |
1765 if (TraceCallFixup) { |
1765 if (TraceCallFixup) { |
1766 tty->print("fixup callsite at " INTPTR_FORMAT " to compiled code for", caller_pc); |
1766 tty->print("fixup callsite at " INTPTR_FORMAT " to compiled code for", caller_pc); |
1767 moop->print_short_name(tty); |
1767 moop->print_short_name(tty); |
1768 tty->print_cr(" to " INTPTR_FORMAT, entry_point); |
1768 tty->print_cr(" to " INTPTR_FORMAT, entry_point); |