< prev index next >

src/hotspot/os_cpu/linux_sparc/os_linux_sparc.cpp


398     warning("fixed up memory fault in +VerifyOops at address "                                                                       
399             INTPTR_FORMAT, p2i(fault));                                                                                              
400     return true;                                                                                                                     
401   }                                                                                                                                  
402   return false;                                                                                                                      
403 }                                                                                                                                    
404 
405 inline static bool checkFPFault(address pc, int code,                                                                                
406                                 JavaThread* thread, address* stub) {                                                                 
407   if (code == FPE_INTDIV || code == FPE_FLTDIV) {                                                                                    
408     *stub =                                                                                                                          
409       SharedRuntime::                                                                                                                
410       continuation_for_implicit_exception(thread,                                                                                    
411                                           pc,                                                                                        
412                                           SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO);                                                   
413     return true;                                                                                                                     
414   }                                                                                                                                  
415   return false;                                                                                                                      
416 }                                                                                                                                    
417 
418 inline static bool checkNullPointer(address pc, intptr_t fault,                                                                      
419                                     JavaThread* thread, address* stub) {                                                             
420   if (!MacroAssembler::needs_explicit_null_check(fault)) {                                                                           
421     // Determination of interpreter/vtable stub/compiled code null                                                                   
422     // exception                                                                                                                     
423     *stub =                                                                                                                          
424       SharedRuntime::                                                                                                                
425       continuation_for_implicit_exception(thread, pc,                                                                                
426                                           SharedRuntime::IMPLICIT_NULL);                                                             
427     return true;                                                                                                                     
428   }                                                                                                                                  
429   return false;                                                                                                                      
430 }                                                                                                                                    
431 
432 inline static bool checkFastJNIAccess(address pc, address* stub) {                                                                   
433   address addr = JNI_FastGetField::find_slowcase_pc(pc);                                                                             
434   if (addr != (address)-1) {                                                                                                         
435     *stub = addr;                                                                                                                    
436     return true;                                                                                                                     
437   }                                                                                                                                  
438   return false;                                                                                                                      
439 }                                                                                                                                    

398     warning("fixed up memory fault in +VerifyOops at address "
399             INTPTR_FORMAT, p2i(fault));
400     return true;
401   }
402   return false;
403 }
404 
405 inline static bool checkFPFault(address pc, int code,
406                                 JavaThread* thread, address* stub) {
407   if (code == FPE_INTDIV || code == FPE_FLTDIV) {
408     *stub =
409       SharedRuntime::
410       continuation_for_implicit_exception(thread,
411                                           pc,
412                                           SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO);
413     return true;
414   }
415   return false;
416 }
417 
418 inline static bool checkNullPointer(address pc, void* fault,
419                                     JavaThread* thread, address* stub) {
420   if (MacroAssembler::uses_implicit_null_check(fault)) {
421     // Determination of interpreter/vtable stub/compiled code null
422     // exception
423     *stub =
424       SharedRuntime::
425       continuation_for_implicit_exception(thread, pc,
426                                           SharedRuntime::IMPLICIT_NULL);
427     return true;
428   }
429   return false;
430 }
431 
432 inline static bool checkFastJNIAccess(address pc, address* stub) {
433   address addr = JNI_FastGetField::find_slowcase_pc(pc);
434   if (addr != (address)-1) {
435     *stub = addr;
436     return true;
437   }
438   return false;
439 }

582         }                                                                                                                            
583 
584         if ((sig == SIGSEGV || sig == SIGBUS) &&                                                                                     
585             checkVerifyOops(pc, (address)info->si_addr, &stub)) {                                                                    
586           break;                                                                                                                     
587         }                                                                                                                            
588 
589         if ((sig == SIGSEGV) && checkZombie(uc, &pc, &stub)) {                                                                       
590           break;                                                                                                                     
591         }                                                                                                                            
592 
593         if ((sig == SIGILL) && checkICMiss(uc, &pc, &stub)) {                                                                        
594           break;                                                                                                                     
595         }                                                                                                                            
596 
597         if ((sig == SIGFPE) && checkFPFault(pc, info->si_code, thread, &stub)) {                                                     
598           break;                                                                                                                     
599         }                                                                                                                            
600 
601         if ((sig == SIGSEGV) &&                                                                                                      
602             checkNullPointer(pc, (intptr_t)info->si_addr, thread, &stub)) {                                                          
603           break;                                                                                                                     
604         }                                                                                                                            
605       } while (0);                                                                                                                   
606 
607       // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC kicks in                                                      
608       // and the heap gets shrunk before the field access.                                                                           
609       if ((sig == SIGSEGV) || (sig == SIGBUS)) {                                                                                     
610         checkFastJNIAccess(pc, &stub);                                                                                               
611       }                                                                                                                              
612     }                                                                                                                                
613 
614     if (stub != NULL) {                                                                                                              
615       // save all thread context in case we need to restore it                                                                       
616       thread->set_saved_exception_pc(pc);                                                                                            
617       thread->set_saved_exception_npc(npc);                                                                                          
618       os::Linux::ucontext_set_pc((ucontext_t*)uc, stub);                                                                             
619       return true;                                                                                                                   
620     }                                                                                                                                
621   }                                                                                                                                  

582         }
583 
584         if ((sig == SIGSEGV || sig == SIGBUS) &&
585             checkVerifyOops(pc, (address)info->si_addr, &stub)) {
586           break;
587         }
588 
589         if ((sig == SIGSEGV) && checkZombie(uc, &pc, &stub)) {
590           break;
591         }
592 
593         if ((sig == SIGILL) && checkICMiss(uc, &pc, &stub)) {
594           break;
595         }
596 
597         if ((sig == SIGFPE) && checkFPFault(pc, info->si_code, thread, &stub)) {
598           break;
599         }
600 
601         if ((sig == SIGSEGV) &&
602             checkNullPointer(pc, info->si_addr, thread, &stub)) {
603           break;
604         }
605       } while (0);
606 
607       // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC kicks in
608       // and the heap gets shrunk before the field access.
609       if ((sig == SIGSEGV) || (sig == SIGBUS)) {
610         checkFastJNIAccess(pc, &stub);
611       }
612     }
613 
614     if (stub != NULL) {
615       // save all thread context in case we need to restore it
616       thread->set_saved_exception_pc(pc);
617       thread->set_saved_exception_npc(npc);
618       os::Linux::ucontext_set_pc((ucontext_t*)uc, stub);
619       return true;
620     }
621   }
< prev index next >