2408 return EXCEPTION_CONTINUE_SEARCH; 2409 } 2410 } 2411 #endif // _WIN64 2412 2413 // Check to see if we caught the safepoint code in the 2414 // process of write protecting the memory serialization page. 2415 // It write enables the page immediately after protecting it 2416 // so just return. 2417 if ( exception_code == EXCEPTION_ACCESS_VIOLATION ) { 2418 JavaThread* thread = (JavaThread*) t; 2419 PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord; 2420 address addr = (address) exceptionRecord->ExceptionInformation[1]; 2421 if ( os::is_memory_serialize_page(thread, addr) ) { 2422 // Block current thread until the memory serialize page permission restored. 2423 os::block_on_serialize_page_trap(); 2424 return EXCEPTION_CONTINUE_EXECUTION; 2425 } 2426 } 2427 2428 if (t != NULL && t->is_Java_thread()) { 2429 JavaThread* thread = (JavaThread*) t; 2430 bool in_java = thread->thread_state() == _thread_in_Java; 2431 2432 // Handle potential stack overflows up front. 2433 if (exception_code == EXCEPTION_STACK_OVERFLOW) { 2434 if (os::uses_stack_guard_pages()) { 2435 #ifdef _M_IA64 2436 // Use guard page for register stack. 2437 PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord; 2438 address addr = (address) exceptionRecord->ExceptionInformation[1]; 2439 // Check for a register stack overflow on Itanium 2440 if (thread->addr_inside_register_stack_red_zone(addr)) { 2441 // Fatal red zone violation happens if the Java program 2442 // catches a StackOverflow error and does so much processing 2443 // that it runs beyond the unprotected yellow guard zone. As 2444 // a result, we are out of here. 2445 fatal("ERROR: Unrecoverable stack overflow happened. JVM will exit."); 2446 } else if(thread->addr_inside_register_stack(addr)) { 2447 // Disable the yellow zone which sets the state that | 2408 return EXCEPTION_CONTINUE_SEARCH; 2409 } 2410 } 2411 #endif // _WIN64 2412 2413 // Check to see if we caught the safepoint code in the 2414 // process of write protecting the memory serialization page. 2415 // It write enables the page immediately after protecting it 2416 // so just return. 2417 if ( exception_code == EXCEPTION_ACCESS_VIOLATION ) { 2418 JavaThread* thread = (JavaThread*) t; 2419 PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord; 2420 address addr = (address) exceptionRecord->ExceptionInformation[1]; 2421 if ( os::is_memory_serialize_page(thread, addr) ) { 2422 // Block current thread until the memory serialize page permission restored. 2423 os::block_on_serialize_page_trap(); 2424 return EXCEPTION_CONTINUE_EXECUTION; 2425 } 2426 } 2427 2428 if ((exception_code == EXCEPTION_ACCESS_VIOLATION) && 2429 VM_Version::is_cpuinfo_segv_addr(pc)) { 2430 // Verify that OS save/restore AVX registers. 2431 return Handle_Exception(exceptionInfo, VM_Version::cpuinfo_cont_addr()); 2432 } 2433 2434 if (t != NULL && t->is_Java_thread()) { 2435 JavaThread* thread = (JavaThread*) t; 2436 bool in_java = thread->thread_state() == _thread_in_Java; 2437 2438 // Handle potential stack overflows up front. 2439 if (exception_code == EXCEPTION_STACK_OVERFLOW) { 2440 if (os::uses_stack_guard_pages()) { 2441 #ifdef _M_IA64 2442 // Use guard page for register stack. 2443 PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord; 2444 address addr = (address) exceptionRecord->ExceptionInformation[1]; 2445 // Check for a register stack overflow on Itanium 2446 if (thread->addr_inside_register_stack_red_zone(addr)) { 2447 // Fatal red zone violation happens if the Java program 2448 // catches a StackOverflow error and does so much processing 2449 // that it runs beyond the unprotected yellow guard zone. As 2450 // a result, we are out of here. 2451 fatal("ERROR: Unrecoverable stack overflow happened. JVM will exit."); 2452 } else if(thread->addr_inside_register_stack(addr)) { 2453 // Disable the yellow zone which sets the state that |