comparison src/os_cpu/linux_x86/vm/os_linux_x86.cpp @ 8151:b8f261ba79c6

Minimize diff to plain HotSpot version.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Thu, 07 Mar 2013 21:00:29 +0100
parents 5fc51c1ecdeb
children b9a918201d47
comparison
equal deleted inserted replaced
8150:b66f831ac5ab 8151:b8f261ba79c6
280 uc->uc_mcontext.gregs[REG_PC] = intptr_t (FetchNResume) ; 280 uc->uc_mcontext.gregs[REG_PC] = intptr_t (FetchNResume) ;
281 return 1 ; 281 return 1 ;
282 } 282 }
283 #endif // AMD64 283 #endif // AMD64
284 284
285 if (TraceSignals) {
286 CodeBlob* cb = CodeCache::find_blob(pc);
287 if (cb != NULL && cb->is_nmethod()) {
288 nmethod* nm = (nmethod*)cb;
289 int rel = pc - nm->code_begin();
290 tty->print_cr(err_msg("Implicit exception at %d of method %s", rel, nm->method()->name()->as_C_string()));
291 } else {
292 tty->print_cr("No code blob found for %x", pc);
293 }
294 }
295
296 // Handle ALL stack overflow variations here 285 // Handle ALL stack overflow variations here
297 if (sig == SIGSEGV) { 286 if (sig == SIGSEGV) {
298 address addr = (address) info->si_addr; 287 address addr = (address) info->si_addr;
299 288
300 // check if fault address is within thread stack 289 // check if fault address is within thread stack
304 if (thread->in_stack_yellow_zone(addr)) { 293 if (thread->in_stack_yellow_zone(addr)) {
305 thread->disable_stack_yellow_zone(); 294 thread->disable_stack_yellow_zone();
306 if (thread->thread_state() == _thread_in_Java) { 295 if (thread->thread_state() == _thread_in_Java) {
307 // Throw a stack overflow exception. Guard pages will be reenabled 296 // Throw a stack overflow exception. Guard pages will be reenabled
308 // while unwinding the stack. 297 // while unwinding the stack.
309 if (WizardMode) tty->print("implicit: %08x%08x\n", ((long long)pc) >> 32, pc);
310 stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW); 298 stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW);
311 } else { 299 } else {
312 // Thread was in the vm or native code. Return and try to finish. 300 // Thread was in the vm or native code. Return and try to finish.
313 return 1; 301 return 1;
314 } 302 }
390 fatal("please update this code."); 378 fatal("please update this code.");
391 } 379 }
392 #endif // AMD64 380 #endif // AMD64
393 } else if (sig == SIGSEGV && 381 } else if (sig == SIGSEGV &&
394 !MacroAssembler::needs_explicit_null_check((intptr_t)info->si_addr)) { 382 !MacroAssembler::needs_explicit_null_check((intptr_t)info->si_addr)) {
395 if (TraceSignals) {
396 tty->print_cr("Implicit exception continuation");
397 }
398 // Determination of interpreter/vtable stub/compiled code null exception 383 // Determination of interpreter/vtable stub/compiled code null exception
399 stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL); 384 stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
400 } else if (sig == SIGSEGV) {
401 if (TraceSignals) {
402 tty->print_cr("would have needed explicit null check %d", (intptr_t)info->si_addr);
403 }
404 } 385 }
405 } else if (thread->thread_state() == _thread_in_vm && 386 } else if (thread->thread_state() == _thread_in_vm &&
406 sig == SIGBUS && /* info->si_code == BUS_OBJERR && */ 387 sig == SIGBUS && /* info->si_code == BUS_OBJERR && */
407 thread->doing_unsafe_access()) { 388 thread->doing_unsafe_access()) {
408 stub = StubRoutines::handler_for_unsafe_access(); 389 stub = StubRoutines::handler_for_unsafe_access();