< prev index next >

src/hotspot/os/windows/os_windows.cpp

Print this page

2712     }
2713 #endif
2714 
2715     if (in_java) {
2716       switch (exception_code) {
2717       case EXCEPTION_INT_DIVIDE_BY_ZERO:
2718         return Handle_Exception(exceptionInfo, SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO));
2719 
2720       case EXCEPTION_INT_OVERFLOW:
2721         return Handle_IDiv_Exception(exceptionInfo);
2722 
2723       } // switch
2724     }
2725 
2726 #if defined(_M_AMD64) || defined(_M_IX86)
2727     if ((in_java || in_native) && exception_code != EXCEPTION_UNCAUGHT_CXX_EXCEPTION) {
2728       LONG result=Handle_FLT_Exception(exceptionInfo);
2729       if (result==EXCEPTION_CONTINUE_EXECUTION) return result;
2730     }
2731 #endif




















2732   }
2733 

2734 #if !defined(USE_VECTORED_EXCEPTION_HANDLING)
2735   if (exception_code != EXCEPTION_BREAKPOINT) {
2736     report_error(t, exception_code, pc, exception_record,
2737                  exceptionInfo->ContextRecord);
2738   }
2739 #endif
2740   return EXCEPTION_CONTINUE_SEARCH;
2741 }
2742 
2743 #if defined(USE_VECTORED_EXCEPTION_HANDLING)
2744 LONG WINAPI topLevelVectoredExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {
2745   PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord;
2746 #if defined(_M_ARM64)
2747   address pc = (address) exceptionInfo->ContextRecord->Pc;
2748 #elif defined(_M_AMD64)
2749   address pc = (address) exceptionInfo->ContextRecord->Rip;
2750 #else
2751   address pc = (address) exceptionInfo->ContextRecord->Eip;
2752 #endif
2753 

2712     }
2713 #endif
2714 
2715     if (in_java) {
2716       switch (exception_code) {
2717       case EXCEPTION_INT_DIVIDE_BY_ZERO:
2718         return Handle_Exception(exceptionInfo, SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO));
2719 
2720       case EXCEPTION_INT_OVERFLOW:
2721         return Handle_IDiv_Exception(exceptionInfo);
2722 
2723       } // switch
2724     }
2725 
2726 #if defined(_M_AMD64) || defined(_M_IX86)
2727     if ((in_java || in_native) && exception_code != EXCEPTION_UNCAUGHT_CXX_EXCEPTION) {
2728       LONG result=Handle_FLT_Exception(exceptionInfo);
2729       if (result==EXCEPTION_CONTINUE_EXECUTION) return result;
2730     }
2731 #endif
2732 
2733     if (in_java && (exception_code == EXCEPTION_ILLEGAL_INSTRUCTION || exception_code == EXCEPTION_ILLEGAL_INSTRUCTION_2)) {
2734       // Check for UD trap caused by NOP patching.
2735       // If it is, patch return address to be deopt handler.
2736       if (NativeDeoptInstruction::is_deopt_at(pc)) {
2737         CodeBlob* cb = CodeCache::find_blob_unsafe(pc);
2738         if (cb != NULL && cb->is_compiled()) {
2739           CompiledMethod* cm = cb->as_compiled_method();
2740           frame fr = os::fetch_frame_from_context((void*)exceptionInfo->ContextRecord);
2741           address deopt = cm->is_method_handle_return(pc) ?
2742             cm->deopt_mh_handler_begin() :
2743             cm->deopt_handler_begin();
2744           assert(cm->insts_contains_inclusive(pc), "");
2745           cm->set_original_pc(&fr, pc);
2746           // Set pc to handler
2747           exceptionInfo->ContextRecord->PC_NAME = (DWORD64)deopt;
2748           return EXCEPTION_CONTINUE_EXECUTION;
2749         }
2750       }
2751     }
2752   }
2753 
2754 
2755 #if !defined(USE_VECTORED_EXCEPTION_HANDLING)
2756   if (exception_code != EXCEPTION_BREAKPOINT) {
2757     report_error(t, exception_code, pc, exception_record,
2758                  exceptionInfo->ContextRecord);
2759   }
2760 #endif
2761   return EXCEPTION_CONTINUE_SEARCH;
2762 }
2763 
2764 #if defined(USE_VECTORED_EXCEPTION_HANDLING)
2765 LONG WINAPI topLevelVectoredExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) {
2766   PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord;
2767 #if defined(_M_ARM64)
2768   address pc = (address) exceptionInfo->ContextRecord->Pc;
2769 #elif defined(_M_AMD64)
2770   address pc = (address) exceptionInfo->ContextRecord->Rip;
2771 #else
2772   address pc = (address) exceptionInfo->ContextRecord->Eip;
2773 #endif
2774 
< prev index next >