comparison src/os_cpu/bsd_x86/vm/os_bsd_x86.cpp @ 11127:980532a806a5

8016697: Use stubs to implement safefetch Summary: Implement Safefetch as stub routines. This reduces compiler and os dependencies. Reviewed-by: twisti, kvn
author goetz
date Thu, 20 Jun 2013 15:02:05 +0200
parents 71f13276159d
children af21010d1062
comparison
equal deleted inserted replaced
11088:ea4d24c1e0c6 11127:980532a806a5
383 // From IA32 System Programming Guide 383 // From IA32 System Programming Guide
384 enum { 384 enum {
385 trap_page_fault = 0xE 385 trap_page_fault = 0xE
386 }; 386 };
387 387
388 extern "C" void Fetch32PFI () ;
389 extern "C" void Fetch32Resume () ;
390 #ifdef AMD64
391 extern "C" void FetchNPFI () ;
392 extern "C" void FetchNResume () ;
393 #endif // AMD64
394
395 extern "C" JNIEXPORT int 388 extern "C" JNIEXPORT int
396 JVM_handle_bsd_signal(int sig, 389 JVM_handle_bsd_signal(int sig,
397 siginfo_t* info, 390 siginfo_t* info,
398 void* ucVoid, 391 void* ucVoid,
399 int abort_if_unrecognized) { 392 int abort_if_unrecognized) {
452 445
453 //%note os_trap_1 446 //%note os_trap_1
454 if (info != NULL && uc != NULL && thread != NULL) { 447 if (info != NULL && uc != NULL && thread != NULL) {
455 pc = (address) os::Bsd::ucontext_get_pc(uc); 448 pc = (address) os::Bsd::ucontext_get_pc(uc);
456 449
457 if (pc == (address) Fetch32PFI) { 450 if (StubRoutines::is_safefetch_fault(pc)) {
458 uc->context_pc = intptr_t(Fetch32Resume) ; 451 uc->context_pc = intptr_t(StubRoutines::continuation_for_safefetch_fault(pc));
459 return 1 ; 452 return 1;
460 } 453 }
461 #ifdef AMD64
462 if (pc == (address) FetchNPFI) {
463 uc->context_pc = intptr_t (FetchNResume) ;
464 return 1 ;
465 }
466 #endif // AMD64
467 454
468 // Handle ALL stack overflow variations here 455 // Handle ALL stack overflow variations here
469 if (sig == SIGSEGV || sig == SIGBUS) { 456 if (sig == SIGSEGV || sig == SIGBUS) {
470 address addr = (address) info->si_addr; 457 address addr = (address) info->si_addr;
471 458