comparison src/os_cpu/solaris_sparc/vm/os_solaris_sparc.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 f2110083203d
children af21010d1062
comparison
equal deleted inserted replaced
11088:ea4d24c1e0c6 11127:980532a806a5
301 #else 301 #else
302 return (bytes <= (size_t)3835*M); 302 return (bytes <= (size_t)3835*M);
303 #endif 303 #endif
304 } 304 }
305 305
306 extern "C" void Fetch32PFI () ;
307 extern "C" void Fetch32Resume () ;
308 extern "C" void FetchNPFI () ;
309 extern "C" void FetchNResume () ;
310
311 extern "C" JNIEXPORT int 306 extern "C" JNIEXPORT int
312 JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid, 307 JVM_handle_solaris_signal(int sig, siginfo_t* info, void* ucVoid,
313 int abort_if_unrecognized) { 308 int abort_if_unrecognized) {
314 ucontext_t* uc = (ucontext_t*) ucVoid; 309 ucontext_t* uc = (ucontext_t*) ucVoid;
315 310
377 // factor me: getPCfromContext 372 // factor me: getPCfromContext
378 pc = (address) uc->uc_mcontext.gregs[REG_PC]; 373 pc = (address) uc->uc_mcontext.gregs[REG_PC];
379 npc = (address) uc->uc_mcontext.gregs[REG_nPC]; 374 npc = (address) uc->uc_mcontext.gregs[REG_nPC];
380 375
381 // SafeFetch() support 376 // SafeFetch() support
382 // Implemented with either a fixed set of addresses such 377 if (StubRoutines::is_safefetch_fault(pc)) {
383 // as Fetch32*, or with Thread._OnTrap. 378 uc->uc_mcontext.gregs[REG_PC] = intptr_t(StubRoutines::continuation_for_safefetch_fault(pc));
384 if (uc->uc_mcontext.gregs[REG_PC] == intptr_t(Fetch32PFI)) { 379 uc->uc_mcontext.gregs[REG_nPC] = uc->uc_mcontext.gregs[REG_PC] + 4;
385 uc->uc_mcontext.gregs [REG_PC] = intptr_t(Fetch32Resume) ; 380 return 1;
386 uc->uc_mcontext.gregs [REG_nPC] = intptr_t(Fetch32Resume) + 4 ;
387 return true ;
388 }
389 if (uc->uc_mcontext.gregs[REG_PC] == intptr_t(FetchNPFI)) {
390 uc->uc_mcontext.gregs [REG_PC] = intptr_t(FetchNResume) ;
391 uc->uc_mcontext.gregs [REG_nPC] = intptr_t(FetchNResume) + 4 ;
392 return true ;
393 } 381 }
394 382
395 // Handle ALL stack overflow variations here 383 // Handle ALL stack overflow variations here
396 if (sig == SIGSEGV && info->si_code == SEGV_ACCERR) { 384 if (sig == SIGSEGV && info->si_code == SEGV_ACCERR) {
397 address addr = (address) info->si_addr; 385 address addr = (address) info->si_addr;