367 }
368 }
369 }
370 }
371
372 if (thread->thread_state() == _thread_in_Java) {
373 // Java thread running in Java code => find exception handler if any
374 // a fault inside compiled code, the interpreter, or a stub
375
376 if (sig == SIGSEGV && os::is_poll_address((address)info->si_addr)) {
377 stub = SharedRuntime::get_poll_stub(pc);
378 } else if (sig == SIGBUS) {
379 // BugId 4454115: A read from a MappedByteBuffer can fault
380 // here if the underlying file has been truncated.
381 // Do not crash the VM in such a case.
382 CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
383 CompiledMethod* nm = (cb != NULL) ? cb->as_compiled_method_or_null() : NULL;
384 if (nm != NULL && nm->has_unsafe_access()) {
385 unsafe_access = true;
386 }
387 } else if (sig == SIGSEGV && !MacroAssembler::needs_explicit_null_check((intptr_t)info->si_addr)) {
388 // Determination of interpreter/vtable stub/compiled code null exception
389 CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
390 if (cb != NULL) {
391 stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
392 }
393 } else if (sig == SIGILL && *(int *)pc == NativeInstruction::zombie_illegal_instruction) {
394 // Zombie
395 stub = SharedRuntime::get_handle_wrong_method_stub();
396 }
397 } else if (thread->thread_state() == _thread_in_vm &&
398 sig == SIGBUS && thread->doing_unsafe_access()) {
399 unsafe_access = true;
400 }
401
402 // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC kicks in
403 // and the heap gets shrunk before the field access.
404 if (sig == SIGSEGV || sig == SIGBUS) {
405 address addr = JNI_FastGetField::find_slowcase_pc(pc);
406 if (addr != (address)-1) {
407 stub = addr;
675 return (*func)(compare_value, exchange_value, dest);
676 }
677 assert(Threads::number_of_threads() == 0, "for bootstrap only");
678
679 int32_t old_value = *dest;
680 if (old_value == compare_value)
681 *dest = exchange_value;
682 return old_value;
683 }
684
685
686 #ifndef PRODUCT
687 void os::verify_stack_alignment() {
688 }
689 #endif
690
691 int os::extra_bang_size_in_bytes() {
692 // ARM does not require an additional stack bang.
693 return 0;
694 }
695
|
367 }
368 }
369 }
370 }
371
372 if (thread->thread_state() == _thread_in_Java) {
373 // Java thread running in Java code => find exception handler if any
374 // a fault inside compiled code, the interpreter, or a stub
375
376 if (sig == SIGSEGV && os::is_poll_address((address)info->si_addr)) {
377 stub = SharedRuntime::get_poll_stub(pc);
378 } else if (sig == SIGBUS) {
379 // BugId 4454115: A read from a MappedByteBuffer can fault
380 // here if the underlying file has been truncated.
381 // Do not crash the VM in such a case.
382 CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
383 CompiledMethod* nm = (cb != NULL) ? cb->as_compiled_method_or_null() : NULL;
384 if (nm != NULL && nm->has_unsafe_access()) {
385 unsafe_access = true;
386 }
387 } else if (sig == SIGSEGV &&
388 MacroAssembler::uses_implicit_null_check(info->si_addr)) {
389 // Determination of interpreter/vtable stub/compiled code null exception
390 CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
391 if (cb != NULL) {
392 stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL);
393 }
394 } else if (sig == SIGILL && *(int *)pc == NativeInstruction::zombie_illegal_instruction) {
395 // Zombie
396 stub = SharedRuntime::get_handle_wrong_method_stub();
397 }
398 } else if (thread->thread_state() == _thread_in_vm &&
399 sig == SIGBUS && thread->doing_unsafe_access()) {
400 unsafe_access = true;
401 }
402
403 // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC kicks in
404 // and the heap gets shrunk before the field access.
405 if (sig == SIGSEGV || sig == SIGBUS) {
406 address addr = JNI_FastGetField::find_slowcase_pc(pc);
407 if (addr != (address)-1) {
408 stub = addr;
676 return (*func)(compare_value, exchange_value, dest);
677 }
678 assert(Threads::number_of_threads() == 0, "for bootstrap only");
679
680 int32_t old_value = *dest;
681 if (old_value == compare_value)
682 *dest = exchange_value;
683 return old_value;
684 }
685
686
687 #ifndef PRODUCT
688 void os::verify_stack_alignment() {
689 }
690 #endif
691
692 int os::extra_bang_size_in_bytes() {
693 // ARM does not require an additional stack bang.
694 return 0;
695 }
|