1.1 --- a/src/os/windows/vm/os_windows.cpp Mon May 04 16:53:05 2015 +0000 1.2 +++ b/src/os/windows/vm/os_windows.cpp Mon May 04 23:23:37 2015 -0400 1.3 @@ -110,11 +110,13 @@ 1.4 static FILETIME process_kernel_time; 1.5 1.6 #ifdef _M_IA64 1.7 -#define __CPU__ ia64 1.8 -#elif _M_AMD64 1.9 -#define __CPU__ amd64 1.10 + #define __CPU__ ia64 1.11 #else 1.12 -#define __CPU__ i486 1.13 + #ifdef _M_AMD64 1.14 + #define __CPU__ amd64 1.15 + #else 1.16 + #define __CPU__ i486 1.17 + #endif 1.18 #endif 1.19 1.20 // save DLL module handle, used by GetModuleFileName 1.21 @@ -2138,20 +2140,22 @@ 1.22 // at the beginning of the target bundle. 1.23 exceptionInfo->ContextRecord->StIPSR &= 0xFFFFF9FFFFFFFFFF; 1.24 assert(((DWORD64)handler & 0xF) == 0, "Target address must point to the beginning of a bundle!"); 1.25 -#elif _M_AMD64 1.26 +#else 1.27 + #ifdef _M_AMD64 1.28 // Do not blow up if no thread info available. 1.29 if (thread) { 1.30 thread->set_saved_exception_pc((address)(DWORD_PTR)exceptionInfo->ContextRecord->Rip); 1.31 } 1.32 // Set pc to handler 1.33 exceptionInfo->ContextRecord->Rip = (DWORD64)handler; 1.34 -#else 1.35 + #else 1.36 // Do not blow up if no thread info available. 1.37 if (thread) { 1.38 thread->set_saved_exception_pc((address)(DWORD_PTR)exceptionInfo->ContextRecord->Eip); 1.39 } 1.40 // Set pc to handler 1.41 exceptionInfo->ContextRecord->Eip = (DWORD)(DWORD_PTR)handler; 1.42 + #endif 1.43 #endif 1.44 1.45 // Continue the execution 1.46 @@ -2250,7 +2254,8 @@ 1.47 // (division by zero is handled explicitly) 1.48 #ifdef _M_IA64 1.49 assert(0, "Fix Handle_IDiv_Exception"); 1.50 -#elif _M_AMD64 1.51 +#else 1.52 + #ifdef _M_AMD64 1.53 PCONTEXT ctx = exceptionInfo->ContextRecord; 1.54 address pc = (address)ctx->Rip; 1.55 assert(pc[0] == 0xF7, "not an idiv opcode"); 1.56 @@ -2261,7 +2266,7 @@ 1.57 ctx->Rax = (DWORD)min_jint; // result 1.58 ctx->Rdx = (DWORD)0; // remainder 1.59 // Continue the execution 1.60 -#else 1.61 + #else 1.62 PCONTEXT ctx = exceptionInfo->ContextRecord; 1.63 address pc = (address)ctx->Eip; 1.64 assert(pc[0] == 0xF7, "not an idiv opcode"); 1.65 @@ -2272,6 +2277,7 @@ 1.66 ctx->Eax = (DWORD)min_jint; // result 1.67 ctx->Edx = (DWORD)0; // remainder 1.68 // Continue the execution 1.69 + #endif 1.70 #endif 1.71 return EXCEPTION_CONTINUE_EXECUTION; 1.72 } 1.73 @@ -2351,10 +2357,12 @@ 1.74 // This is needed for IA64 because "relocation" / "implicit null check" / "poll instruction" 1.75 // information is saved in the Unix format. 1.76 address pc_unix_format = (address) ((((uint64_t)pc) & 0xFFFFFFFFFFFFFFF0) | ((((uint64_t)pc) & 0xF) >> 2)); 1.77 -#elif _M_AMD64 1.78 +#else 1.79 + #ifdef _M_AMD64 1.80 address pc = (address) exceptionInfo->ContextRecord->Rip; 1.81 -#else 1.82 + #else 1.83 address pc = (address) exceptionInfo->ContextRecord->Eip; 1.84 + #endif 1.85 #endif 1.86 Thread* t = ThreadLocalStorage::get_thread_slow(); // slow & steady 1.87