2617 }
2618
2619
2620 bool nmethod::is_patchable_at(address instr_addr) {
2621 assert(insts_contains(instr_addr), "wrong nmethod used");
2622 if (is_zombie()) {
2623 // a zombie may never be patched
2624 return false;
2625 }
2626 return true;
2627 }
2628
2629
2630 address nmethod::continuation_for_implicit_exception(address pc) {
2631 // Exception happened outside inline-cache check code => we are inside
2632 // an active nmethod => use cpc to determine a return address
2633 int exception_offset = pc - code_begin();
2634 int cont_offset = ImplicitExceptionTable(this).at( exception_offset );
2635 #ifdef ASSERT
2636 if (cont_offset == 0) {
2637 Thread* thread = ThreadLocalStorage::get_thread_slow();
2638 ResetNoHandleMark rnm; // Might be called from LEAF/QUICK ENTRY
2639 HandleMark hm(thread);
2640 ResourceMark rm(thread);
2641 CodeBlob* cb = CodeCache::find_blob(pc);
2642 assert(cb != NULL && cb == this, "");
2643 tty->print_cr("implicit exception happened at " INTPTR_FORMAT, p2i(pc));
2644 print();
2645 method()->print_codes();
2646 print_code();
2647 print_pcs();
2648 }
2649 #endif
2650 if (cont_offset == 0) {
2651 // Let the normal error handling report the exception
2652 return NULL;
2653 }
2654 return code_begin() + cont_offset;
2655 }
2656
2657
|
2617 }
2618
2619
2620 bool nmethod::is_patchable_at(address instr_addr) {
2621 assert(insts_contains(instr_addr), "wrong nmethod used");
2622 if (is_zombie()) {
2623 // a zombie may never be patched
2624 return false;
2625 }
2626 return true;
2627 }
2628
2629
2630 address nmethod::continuation_for_implicit_exception(address pc) {
2631 // Exception happened outside inline-cache check code => we are inside
2632 // an active nmethod => use cpc to determine a return address
2633 int exception_offset = pc - code_begin();
2634 int cont_offset = ImplicitExceptionTable(this).at( exception_offset );
2635 #ifdef ASSERT
2636 if (cont_offset == 0) {
2637 Thread* thread = Thread::current();
2638 ResetNoHandleMark rnm; // Might be called from LEAF/QUICK ENTRY
2639 HandleMark hm(thread);
2640 ResourceMark rm(thread);
2641 CodeBlob* cb = CodeCache::find_blob(pc);
2642 assert(cb != NULL && cb == this, "");
2643 tty->print_cr("implicit exception happened at " INTPTR_FORMAT, p2i(pc));
2644 print();
2645 method()->print_codes();
2646 print_code();
2647 print_pcs();
2648 }
2649 #endif
2650 if (cont_offset == 0) {
2651 // Let the normal error handling report the exception
2652 return NULL;
2653 }
2654 return code_begin() + cont_offset;
2655 }
2656
2657
|