< prev index next >

src/hotspot/os/windows/os_windows.cpp

Print this page




2470 
2471 #ifdef _WIN64
2472       // Special care for fast JNI field accessors.
2473       // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC kicks
2474       // in and the heap gets shrunk before the field access.
2475       if (exception_code == EXCEPTION_ACCESS_VIOLATION) {
2476         address addr = JNI_FastGetField::find_slowcase_pc(pc);
2477         if (addr != (address)-1) {
2478           return Handle_Exception(exceptionInfo, addr);
2479         }
2480       }
2481 #endif
2482 
2483       // Stack overflow or null pointer exception in native code.
2484       report_error(t, exception_code, pc, exceptionInfo->ExceptionRecord,
2485                    exceptionInfo->ContextRecord);
2486       return EXCEPTION_CONTINUE_SEARCH;
2487     } // /EXCEPTION_ACCESS_VIOLATION
2488     // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2489 













2490     if (in_java) {
2491       switch (exception_code) {
2492       case EXCEPTION_INT_DIVIDE_BY_ZERO:
2493         return Handle_Exception(exceptionInfo, SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO));
2494 
2495       case EXCEPTION_INT_OVERFLOW:
2496         return Handle_IDiv_Exception(exceptionInfo);
2497 
2498       } // switch
2499     }
2500     if (((thread->thread_state() == _thread_in_Java) ||
2501          (thread->thread_state() == _thread_in_native)) &&
2502          exception_code != EXCEPTION_UNCAUGHT_CXX_EXCEPTION) {
2503       LONG result=Handle_FLT_Exception(exceptionInfo);
2504       if (result==EXCEPTION_CONTINUE_EXECUTION) return result;
2505     }
2506   }
2507 
2508   if (exception_code != EXCEPTION_BREAKPOINT) {
2509     report_error(t, exception_code, pc, exceptionInfo->ExceptionRecord,




2470 
2471 #ifdef _WIN64
2472       // Special care for fast JNI field accessors.
2473       // jni_fast_Get<Primitive>Field can trap at certain pc's if a GC kicks
2474       // in and the heap gets shrunk before the field access.
2475       if (exception_code == EXCEPTION_ACCESS_VIOLATION) {
2476         address addr = JNI_FastGetField::find_slowcase_pc(pc);
2477         if (addr != (address)-1) {
2478           return Handle_Exception(exceptionInfo, addr);
2479         }
2480       }
2481 #endif
2482 
2483       // Stack overflow or null pointer exception in native code.
2484       report_error(t, exception_code, pc, exceptionInfo->ExceptionRecord,
2485                    exceptionInfo->ContextRecord);
2486       return EXCEPTION_CONTINUE_SEARCH;
2487     } // /EXCEPTION_ACCESS_VIOLATION
2488     // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2489 
2490     if (exception_code == EXCEPTION_IN_PAGE_ERROR) {
2491       CodeBlob* cb;
2492       CompiledMethod* nm;
2493       JavaThread* thread = (JavaThread*)t;
2494       if (in_java) {
2495         cb = CodeCache::find_blob_unsafe(pc);
2496         nm = (cb != NULL) ? cb->as_compiled_method_or_null() : NULL;
2497       }
2498       if (thread->doing_unsafe_access() || (nm != NULL && nm->has_unsafe_access())) {
2499         return Handle_Exception(exceptionInfo, SharedRuntime::handle_unsafe_access(thread, (address)Assembler::locate_next_instruction(pc)));
2500       }
2501     }
2502 
2503     if (in_java) {
2504       switch (exception_code) {
2505       case EXCEPTION_INT_DIVIDE_BY_ZERO:
2506         return Handle_Exception(exceptionInfo, SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO));
2507 
2508       case EXCEPTION_INT_OVERFLOW:
2509         return Handle_IDiv_Exception(exceptionInfo);
2510 
2511       } // switch
2512     }
2513     if (((thread->thread_state() == _thread_in_Java) ||
2514          (thread->thread_state() == _thread_in_native)) &&
2515          exception_code != EXCEPTION_UNCAUGHT_CXX_EXCEPTION) {
2516       LONG result=Handle_FLT_Exception(exceptionInfo);
2517       if (result==EXCEPTION_CONTINUE_EXECUTION) return result;
2518     }
2519   }
2520 
2521   if (exception_code != EXCEPTION_BREAKPOINT) {
2522     report_error(t, exception_code, pc, exceptionInfo->ExceptionRecord,


< prev index next >