< prev index next >

hotspot/src/os/windows/vm/os_windows.cpp

Print this page
rev 7342 : 8077674: BSD build failures due to undefined macros
Reviewed-by: dsamersoff, kbarrett, hseigel

*** 108,122 **** static FILETIME process_exit_time; static FILETIME process_user_time; static FILETIME process_kernel_time; #ifdef _M_IA64 ! #define __CPU__ ia64 ! #elif _M_AMD64 ! #define __CPU__ amd64 #else ! #define __CPU__ i486 #endif // save DLL module handle, used by GetModuleFileName HINSTANCE vm_lib_handle; --- 108,124 ---- static FILETIME process_exit_time; static FILETIME process_user_time; static FILETIME process_kernel_time; #ifdef _M_IA64 ! #define __CPU__ ia64 #else ! #ifdef _M_AMD64 ! #define __CPU__ amd64 ! #else ! #define __CPU__ i486 ! #endif #endif // save DLL module handle, used by GetModuleFileName HINSTANCE vm_lib_handle;
*** 2136,2159 **** exceptionInfo->ContextRecord->StIIP = (DWORD64)handler; // Clear out psr.ri (= Restart Instruction) in order to continue // at the beginning of the target bundle. exceptionInfo->ContextRecord->StIPSR &= 0xFFFFF9FFFFFFFFFF; assert(((DWORD64)handler & 0xF) == 0, "Target address must point to the beginning of a bundle!"); ! #elif _M_AMD64 // Do not blow up if no thread info available. if (thread) { thread->set_saved_exception_pc((address)(DWORD_PTR)exceptionInfo->ContextRecord->Rip); } // Set pc to handler exceptionInfo->ContextRecord->Rip = (DWORD64)handler; ! #else // Do not blow up if no thread info available. if (thread) { thread->set_saved_exception_pc((address)(DWORD_PTR)exceptionInfo->ContextRecord->Eip); } // Set pc to handler exceptionInfo->ContextRecord->Eip = (DWORD)(DWORD_PTR)handler; #endif // Continue the execution return EXCEPTION_CONTINUE_EXECUTION; } --- 2138,2163 ---- exceptionInfo->ContextRecord->StIIP = (DWORD64)handler; // Clear out psr.ri (= Restart Instruction) in order to continue // at the beginning of the target bundle. exceptionInfo->ContextRecord->StIPSR &= 0xFFFFF9FFFFFFFFFF; assert(((DWORD64)handler & 0xF) == 0, "Target address must point to the beginning of a bundle!"); ! #else ! #ifdef _M_AMD64 // Do not blow up if no thread info available. if (thread) { thread->set_saved_exception_pc((address)(DWORD_PTR)exceptionInfo->ContextRecord->Rip); } // Set pc to handler exceptionInfo->ContextRecord->Rip = (DWORD64)handler; ! #else // Do not blow up if no thread info available. if (thread) { thread->set_saved_exception_pc((address)(DWORD_PTR)exceptionInfo->ContextRecord->Eip); } // Set pc to handler exceptionInfo->ContextRecord->Eip = (DWORD)(DWORD_PTR)handler; + #endif #endif // Continue the execution return EXCEPTION_CONTINUE_EXECUTION; }
*** 2248,2279 **** LONG Handle_IDiv_Exception(struct _EXCEPTION_POINTERS* exceptionInfo) { // handle exception caused by idiv; should only happen for -MinInt/-1 // (division by zero is handled explicitly) #ifdef _M_IA64 assert(0, "Fix Handle_IDiv_Exception"); ! #elif _M_AMD64 PCONTEXT ctx = exceptionInfo->ContextRecord; address pc = (address)ctx->Rip; assert(pc[0] == 0xF7, "not an idiv opcode"); assert((pc[1] & ~0x7) == 0xF8, "cannot handle non-register operands"); assert(ctx->Rax == min_jint, "unexpected idiv exception"); // set correct result values and continue after idiv instruction ctx->Rip = (DWORD)pc + 2; // idiv reg, reg is 2 bytes ctx->Rax = (DWORD)min_jint; // result ctx->Rdx = (DWORD)0; // remainder // Continue the execution ! #else PCONTEXT ctx = exceptionInfo->ContextRecord; address pc = (address)ctx->Eip; assert(pc[0] == 0xF7, "not an idiv opcode"); assert((pc[1] & ~0x7) == 0xF8, "cannot handle non-register operands"); assert(ctx->Eax == min_jint, "unexpected idiv exception"); // set correct result values and continue after idiv instruction ctx->Eip = (DWORD)pc + 2; // idiv reg, reg is 2 bytes ctx->Eax = (DWORD)min_jint; // result ctx->Edx = (DWORD)0; // remainder // Continue the execution #endif return EXCEPTION_CONTINUE_EXECUTION; } #ifndef _WIN64 --- 2252,2285 ---- LONG Handle_IDiv_Exception(struct _EXCEPTION_POINTERS* exceptionInfo) { // handle exception caused by idiv; should only happen for -MinInt/-1 // (division by zero is handled explicitly) #ifdef _M_IA64 assert(0, "Fix Handle_IDiv_Exception"); ! #else ! #ifdef _M_AMD64 PCONTEXT ctx = exceptionInfo->ContextRecord; address pc = (address)ctx->Rip; assert(pc[0] == 0xF7, "not an idiv opcode"); assert((pc[1] & ~0x7) == 0xF8, "cannot handle non-register operands"); assert(ctx->Rax == min_jint, "unexpected idiv exception"); // set correct result values and continue after idiv instruction ctx->Rip = (DWORD)pc + 2; // idiv reg, reg is 2 bytes ctx->Rax = (DWORD)min_jint; // result ctx->Rdx = (DWORD)0; // remainder // Continue the execution ! #else PCONTEXT ctx = exceptionInfo->ContextRecord; address pc = (address)ctx->Eip; assert(pc[0] == 0xF7, "not an idiv opcode"); assert((pc[1] & ~0x7) == 0xF8, "cannot handle non-register operands"); assert(ctx->Eax == min_jint, "unexpected idiv exception"); // set correct result values and continue after idiv instruction ctx->Eip = (DWORD)pc + 2; // idiv reg, reg is 2 bytes ctx->Eax = (DWORD)min_jint; // result ctx->Edx = (DWORD)0; // remainder // Continue the execution + #endif #endif return EXCEPTION_CONTINUE_EXECUTION; } #ifndef _WIN64
*** 2349,2362 **** // Convert the pc to "Unix format", which has the slot number coded // into the least 2 bits: 0000=slot0, 0001=slot1, 0010=slot2 // This is needed for IA64 because "relocation" / "implicit null check" / "poll instruction" // information is saved in the Unix format. address pc_unix_format = (address) ((((uint64_t)pc) & 0xFFFFFFFFFFFFFFF0) | ((((uint64_t)pc) & 0xF) >> 2)); - #elif _M_AMD64 - address pc = (address) exceptionInfo->ContextRecord->Rip; #else address pc = (address) exceptionInfo->ContextRecord->Eip; #endif Thread* t = ThreadLocalStorage::get_thread_slow(); // slow & steady // Handle SafeFetch32 and SafeFetchN exceptions. if (StubRoutines::is_safefetch_fault(pc)) { --- 2355,2370 ---- // Convert the pc to "Unix format", which has the slot number coded // into the least 2 bits: 0000=slot0, 0001=slot1, 0010=slot2 // This is needed for IA64 because "relocation" / "implicit null check" / "poll instruction" // information is saved in the Unix format. address pc_unix_format = (address) ((((uint64_t)pc) & 0xFFFFFFFFFFFFFFF0) | ((((uint64_t)pc) & 0xF) >> 2)); #else + #ifdef _M_AMD64 + address pc = (address) exceptionInfo->ContextRecord->Rip; + #else address pc = (address) exceptionInfo->ContextRecord->Eip; + #endif #endif Thread* t = ThreadLocalStorage::get_thread_slow(); // slow & steady // Handle SafeFetch32 and SafeFetchN exceptions. if (StubRoutines::is_safefetch_fault(pc)) {
< prev index next >