comparison src/os_cpu/linux_x86/vm/os_linux_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 9ba41a4a71ff
children af21010d1062
comparison
equal deleted inserted replaced
11088:ea4d24c1e0c6 11127:980532a806a5
207 // From IA32 System Programming Guide 207 // From IA32 System Programming Guide
208 enum { 208 enum {
209 trap_page_fault = 0xE 209 trap_page_fault = 0xE
210 }; 210 };
211 211
212 extern "C" void Fetch32PFI () ;
213 extern "C" void Fetch32Resume () ;
214 #ifdef AMD64
215 extern "C" void FetchNPFI () ;
216 extern "C" void FetchNResume () ;
217 #endif // AMD64
218
219 extern "C" JNIEXPORT int 212 extern "C" JNIEXPORT int
220 JVM_handle_linux_signal(int sig, 213 JVM_handle_linux_signal(int sig,
221 siginfo_t* info, 214 siginfo_t* info,
222 void* ucVoid, 215 void* ucVoid,
223 int abort_if_unrecognized) { 216 int abort_if_unrecognized) {
276 269
277 //%note os_trap_1 270 //%note os_trap_1
278 if (info != NULL && uc != NULL && thread != NULL) { 271 if (info != NULL && uc != NULL && thread != NULL) {
279 pc = (address) os::Linux::ucontext_get_pc(uc); 272 pc = (address) os::Linux::ucontext_get_pc(uc);
280 273
281 if (pc == (address) Fetch32PFI) { 274 if (StubRoutines::is_safefetch_fault(pc)) {
282 uc->uc_mcontext.gregs[REG_PC] = intptr_t(Fetch32Resume) ; 275 uc->uc_mcontext.gregs[REG_PC] = intptr_t(StubRoutines::continuation_for_safefetch_fault(pc));
283 return 1 ; 276 return 1;
284 } 277 }
285 #ifdef AMD64
286 if (pc == (address) FetchNPFI) {
287 uc->uc_mcontext.gregs[REG_PC] = intptr_t (FetchNResume) ;
288 return 1 ;
289 }
290 #endif // AMD64
291 278
292 #ifndef AMD64 279 #ifndef AMD64
293 // Halt if SI_KERNEL before more crashes get misdiagnosed as Java bugs 280 // Halt if SI_KERNEL before more crashes get misdiagnosed as Java bugs
294 // This can happen in any running code (currently more frequently in 281 // This can happen in any running code (currently more frequently in
295 // interpreter code but has been seen in compiled code) 282 // interpreter code but has been seen in compiled code)