547 address stub; |
547 address stub; |
548 // Look up the code blob |
548 // Look up the code blob |
549 CodeBlob *cb = CodeCache::find_blob(pc); |
549 CodeBlob *cb = CodeCache::find_blob(pc); |
550 |
550 |
551 // Should be an nmethod |
551 // Should be an nmethod |
552 assert(cb && cb->is_compiled(), "safepoint polling: pc must refer to an nmethod"); |
552 guarantee(cb != NULL && cb->is_compiled(), "safepoint polling: pc must refer to an nmethod"); |
553 |
553 |
554 // Look up the relocation information |
554 // Look up the relocation information |
555 assert(((CompiledMethod*)cb)->is_at_poll_or_poll_return(pc), |
555 assert(((CompiledMethod*)cb)->is_at_poll_or_poll_return(pc), |
556 "safepoint polling: type must be poll"); |
556 "safepoint polling: type must be poll"); |
557 |
557 |
1800 |
1800 |
1801 bool SharedRuntime::should_fixup_call_destination(address destination, address entry_point, address caller_pc, Method* moop, CodeBlob* cb) { |
1801 bool SharedRuntime::should_fixup_call_destination(address destination, address entry_point, address caller_pc, Method* moop, CodeBlob* cb) { |
1802 if (destination != entry_point) { |
1802 if (destination != entry_point) { |
1803 CodeBlob* callee = CodeCache::find_blob(destination); |
1803 CodeBlob* callee = CodeCache::find_blob(destination); |
1804 // callee == cb seems weird. It means calling interpreter thru stub. |
1804 // callee == cb seems weird. It means calling interpreter thru stub. |
1805 if (callee == cb || callee->is_adapter_blob()) { |
1805 if (callee != NULL && (callee == cb || callee->is_adapter_blob())) { |
1806 // static call or optimized virtual |
1806 // static call or optimized virtual |
1807 if (TraceCallFixup) { |
1807 if (TraceCallFixup) { |
1808 tty->print("fixup callsite at " INTPTR_FORMAT " to compiled code for", p2i(caller_pc)); |
1808 tty->print("fixup callsite at " INTPTR_FORMAT " to compiled code for", p2i(caller_pc)); |
1809 moop->print_short_name(tty); |
1809 moop->print_short_name(tty); |
1810 tty->print_cr(" to " INTPTR_FORMAT, p2i(entry_point)); |
1810 tty->print_cr(" to " INTPTR_FORMAT, p2i(entry_point)); |
1849 // we did we'd leap into space because the callsite needs to use |
1849 // we did we'd leap into space because the callsite needs to use |
1850 // "to interpreter" stub in order to load up the Method*. Don't |
1850 // "to interpreter" stub in order to load up the Method*. Don't |
1851 // ask me how I know this... |
1851 // ask me how I know this... |
1852 |
1852 |
1853 CodeBlob* cb = CodeCache::find_blob(caller_pc); |
1853 CodeBlob* cb = CodeCache::find_blob(caller_pc); |
1854 if (!cb->is_compiled() || entry_point == moop->get_c2i_entry()) { |
1854 if (cb == NULL || !cb->is_compiled() || entry_point == moop->get_c2i_entry()) { |
1855 return; |
1855 return; |
1856 } |
1856 } |
1857 |
1857 |
1858 // The check above makes sure this is a nmethod. |
1858 // The check above makes sure this is a nmethod. |
1859 CompiledMethod* nm = cb->as_compiled_method_or_null(); |
1859 CompiledMethod* nm = cb->as_compiled_method_or_null(); |