< prev index next >

src/share/vm/code/nmethod.cpp

Print this page




2645 }
2646 
2647 
2648 bool nmethod::is_patchable_at(address instr_addr) {
2649   assert(insts_contains(instr_addr), "wrong nmethod used");
2650   if (is_zombie()) {
2651     // a zombie may never be patched
2652     return false;
2653   }
2654   return true;
2655 }
2656 
2657 
2658 address nmethod::continuation_for_implicit_exception(address pc) {
2659   // Exception happened outside inline-cache check code => we are inside
2660   // an active nmethod => use cpc to determine a return address
2661   int exception_offset = pc - code_begin();
2662   int cont_offset = ImplicitExceptionTable(this).at( exception_offset );
2663 #ifdef ASSERT
2664   if (cont_offset == 0) {
2665     Thread* thread = ThreadLocalStorage::get_thread_slow();
2666     ResetNoHandleMark rnm; // Might be called from LEAF/QUICK ENTRY
2667     HandleMark hm(thread);
2668     ResourceMark rm(thread);
2669     CodeBlob* cb = CodeCache::find_blob(pc);
2670     assert(cb != NULL && cb == this, "");
2671     tty->print_cr("implicit exception happened at " INTPTR_FORMAT, p2i(pc));
2672     print();
2673     method()->print_codes();
2674     print_code();
2675     print_pcs();
2676   }
2677 #endif
2678   if (cont_offset == 0) {
2679     // Let the normal error handling report the exception
2680     return NULL;
2681   }
2682   return code_begin() + cont_offset;
2683 }
2684 
2685 




2645 }
2646 
2647 
2648 bool nmethod::is_patchable_at(address instr_addr) {
2649   assert(insts_contains(instr_addr), "wrong nmethod used");
2650   if (is_zombie()) {
2651     // a zombie may never be patched
2652     return false;
2653   }
2654   return true;
2655 }
2656 
2657 
2658 address nmethod::continuation_for_implicit_exception(address pc) {
2659   // Exception happened outside inline-cache check code => we are inside
2660   // an active nmethod => use cpc to determine a return address
2661   int exception_offset = pc - code_begin();
2662   int cont_offset = ImplicitExceptionTable(this).at( exception_offset );
2663 #ifdef ASSERT
2664   if (cont_offset == 0) {
2665     Thread* thread = Thread::current();
2666     ResetNoHandleMark rnm; // Might be called from LEAF/QUICK ENTRY
2667     HandleMark hm(thread);
2668     ResourceMark rm(thread);
2669     CodeBlob* cb = CodeCache::find_blob(pc);
2670     assert(cb != NULL && cb == this, "");
2671     tty->print_cr("implicit exception happened at " INTPTR_FORMAT, p2i(pc));
2672     print();
2673     method()->print_codes();
2674     print_code();
2675     print_pcs();
2676   }
2677 #endif
2678   if (cont_offset == 0) {
2679     // Let the normal error handling report the exception
2680     return NULL;
2681   }
2682   return code_begin() + cont_offset;
2683 }
2684 
2685 


< prev index next >