hotspot/src/os/windows/vm/os_windows.cpp
changeset 40926 2fd1cf3e70e9
parent 40667 f9cf2db7f59f
child 40931 d4d2a4a0e023
equal deleted inserted replaced
40925:04b19236aa98 40926:2fd1cf3e70e9
  2502   // Check to see if we caught the safepoint code in the
  2502   // Check to see if we caught the safepoint code in the
  2503   // process of write protecting the memory serialization page.
  2503   // process of write protecting the memory serialization page.
  2504   // It write enables the page immediately after protecting it
  2504   // It write enables the page immediately after protecting it
  2505   // so just return.
  2505   // so just return.
  2506   if (exception_code == EXCEPTION_ACCESS_VIOLATION) {
  2506   if (exception_code == EXCEPTION_ACCESS_VIOLATION) {
  2507     JavaThread* thread = (JavaThread*) t;
  2507     if (t != NULL && t->is_Java_thread()) {
  2508     PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord;
  2508       JavaThread* thread = (JavaThread*) t;
  2509     address addr = (address) exceptionRecord->ExceptionInformation[1];
  2509       PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord;
  2510     if (os::is_memory_serialize_page(thread, addr)) {
  2510       address addr = (address) exceptionRecord->ExceptionInformation[1];
  2511       // Block current thread until the memory serialize page permission restored.
  2511       if (os::is_memory_serialize_page(thread, addr)) {
  2512       os::block_on_serialize_page_trap();
  2512         // Block current thread until the memory serialize page permission restored.
  2513       return EXCEPTION_CONTINUE_EXECUTION;
  2513         os::block_on_serialize_page_trap();
       
  2514         return EXCEPTION_CONTINUE_EXECUTION;
       
  2515       }
  2514     }
  2516     }
  2515   }
  2517   }
  2516 
  2518 
  2517   if ((exception_code == EXCEPTION_ACCESS_VIOLATION) &&
  2519   if ((exception_code == EXCEPTION_ACCESS_VIOLATION) &&
  2518       VM_Version::is_cpuinfo_segv_addr(pc)) {
  2520       VM_Version::is_cpuinfo_segv_addr(pc)) {
  2562         return Handle_Exception(exceptionInfo,
  2564         return Handle_Exception(exceptionInfo,
  2563                                 SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW));
  2565                                 SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW));
  2564       }
  2566       }
  2565 #endif
  2567 #endif
  2566       if (thread->stack_guards_enabled()) {
  2568       if (thread->stack_guards_enabled()) {
  2567         if (_thread_in_Java) {
  2569         if (in_java) {
  2568           frame fr;
  2570           frame fr;
  2569           PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord;
  2571           PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord;
  2570           address addr = (address) exceptionRecord->ExceptionInformation[1];
  2572           address addr = (address) exceptionRecord->ExceptionInformation[1];
  2571           if (os::win32::get_frame_at_stack_banging_point(thread, exceptionInfo, pc, &fr)) {
  2573           if (os::win32::get_frame_at_stack_banging_point(thread, exceptionInfo, pc, &fr)) {
  2572             assert(fr.is_java_frame(), "Must be a Java frame");
  2574             assert(fr.is_java_frame(), "Must be a Java frame");
  2574           }
  2576           }
  2575         }
  2577         }
  2576         // Yellow zone violation.  The o/s has unprotected the first yellow
  2578         // Yellow zone violation.  The o/s has unprotected the first yellow
  2577         // zone page for us.  Note:  must call disable_stack_yellow_zone to
  2579         // zone page for us.  Note:  must call disable_stack_yellow_zone to
  2578         // update the enabled status, even if the zone contains only one page.
  2580         // update the enabled status, even if the zone contains only one page.
       
  2581         assert(thread->thread_state() != _thread_in_vm, "Undersized StackShadowPages");
  2579         thread->disable_stack_yellow_reserved_zone();
  2582         thread->disable_stack_yellow_reserved_zone();
  2580         // If not in java code, return and hope for the best.
  2583         // If not in java code, return and hope for the best.
  2581         return in_java
  2584         return in_java
  2582             ? Handle_Exception(exceptionInfo, SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW))
  2585             ? Handle_Exception(exceptionInfo, SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW))
  2583             :  EXCEPTION_CONTINUE_EXECUTION;
  2586             :  EXCEPTION_CONTINUE_EXECUTION;