--- old/src/os/windows/vm/os_windows.cpp 2017-06-07 14:33:10.424244340 -0400 +++ new/src/os/windows/vm/os_windows.cpp 2017-06-07 14:33:09.901217513 -0400 @@ -114,14 +114,10 @@ static FILETIME process_user_time; static FILETIME process_kernel_time; -#ifdef _M_IA64 - #define __CPU__ ia64 +#ifdef _M_AMD64 + #define __CPU__ amd64 #else - #ifdef _M_AMD64 - #define __CPU__ amd64 - #else - #define __CPU__ i486 - #endif + #define __CPU__ i486 #endif // save DLL module handle, used by GetModuleFileName @@ -351,38 +347,6 @@ break; } } - -#ifdef _M_IA64 - // IA64 has memory and register stacks - // - // This is the stack layout you get on NT/IA64 if you specify 1MB stack limit - // at thread creation (1MB backing store growing upwards, 1MB memory stack - // growing downwards, 2MB summed up) - // - // ... - // ------- top of stack (high address) ----- - // | - // | 1MB - // | Backing Store (Register Stack) - // | - // | / \ - // | | - // | | - // | | - // ------------------------ stack base ----- - // | 1MB - // | Memory Stack - // | - // | | - // | | - // | | - // | \ / - // | - // ----- bottom of stack (low address) ----- - // ... - - stack_size = stack_size / 2; -#endif return stack_bottom + stack_size; } @@ -1500,15 +1464,13 @@ {IMAGE_FILE_MACHINE_AMD64, (char*)"AMD 64"}, {IMAGE_FILE_MACHINE_IA64, (char*)"IA 64"} }; -#if (defined _M_IA64) - static const uint16_t running_arch = IMAGE_FILE_MACHINE_IA64; -#elif (defined _M_AMD64) +#if (defined _M_AMD64) static const uint16_t running_arch = IMAGE_FILE_MACHINE_AMD64; #elif (defined _M_IX86) static const uint16_t running_arch = IMAGE_FILE_MACHINE_I386; #else #error Method os::dll_load requires that one of following \ - is defined :_M_IA64,_M_AMD64 or _M_IX86 + is defined :_M_AMD64 or _M_IX86 #endif @@ -2161,38 +2123,21 @@ address handler) { JavaThread* thread = (JavaThread*) Thread::current_or_null(); // Save pc in thread -#ifdef _M_IA64 - // Do not blow up if no thread info available. - if (thread) { - // Saving PRECISE pc (with slot information) in thread. - uint64_t precise_pc = (uint64_t) exceptionInfo->ExceptionRecord->ExceptionAddress; - // Convert precise PC into "Unix" format - precise_pc = (precise_pc & 0xFFFFFFFFFFFFFFF0) | ((precise_pc & 0xF) >> 2); - thread->set_saved_exception_pc((address)precise_pc); - } - // Set pc to handler - 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; + // 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; @@ -2216,11 +2161,6 @@ // included or copied here. #define EXCEPTION_INFO_EXEC_VIOLATION 0x08 -// Handle NAT Bit consumption on IA64. -#ifdef _M_IA64 - #define EXCEPTION_REG_NAT_CONSUMPTION STATUS_REG_NAT_CONSUMPTION -#endif - // Windows Vista/2008 heap corruption check #define EXCEPTION_HEAP_CORRUPTION 0xC0000374 @@ -2261,9 +2201,6 @@ def_excpt(EXCEPTION_INVALID_HANDLE), def_excpt(EXCEPTION_UNCAUGHT_CXX_EXCEPTION), def_excpt(EXCEPTION_HEAP_CORRUPTION) -#ifdef _M_IA64 - , def_excpt(EXCEPTION_REG_NAT_CONSUMPTION) -#endif }; #undef def_excpt @@ -2284,9 +2221,6 @@ 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; @@ -2315,7 +2249,6 @@ ctx->Edx = (DWORD)0; // remainder // Continue the execution #endif -#endif return EXCEPTION_CONTINUE_EXECUTION; } @@ -2412,22 +2345,11 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo) { if (InterceptOSException) return EXCEPTION_CONTINUE_SEARCH; DWORD exception_code = exceptionInfo->ExceptionRecord->ExceptionCode; -#ifdef _M_IA64 - // On Itanium, we need the "precise pc", which has the slot number coded - // into the least 4 bits: 0000=slot0, 0100=slot1, 1000=slot2 (Windows format). - address pc = (address) exceptionInfo->ExceptionRecord->ExceptionAddress; - // 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 = Thread::current_or_null_safe(); // Handle SafeFetch32 and SafeFetchN exceptions. @@ -2544,43 +2466,6 @@ // Handle potential stack overflows up front. if (exception_code == EXCEPTION_STACK_OVERFLOW) { -#ifdef _M_IA64 - // Use guard page for register stack. - PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord; - address addr = (address) exceptionRecord->ExceptionInformation[1]; - // Check for a register stack overflow on Itanium - if (thread->addr_inside_register_stack_red_zone(addr)) { - // Fatal red zone violation happens if the Java program - // catches a StackOverflow error and does so much processing - // that it runs beyond the unprotected yellow guard zone. As - // a result, we are out of here. - fatal("ERROR: Unrecoverable stack overflow happened. JVM will exit."); - } else if(thread->addr_inside_register_stack(addr)) { - // Disable the yellow zone which sets the state that - // we've got a stack overflow problem. - if (thread->stack_yellow_reserved_zone_enabled()) { - thread->disable_stack_yellow_reserved_zone(); - } - // Give us some room to process the exception. - thread->disable_register_stack_guard(); - // Tracing with +Verbose. - if (Verbose) { - tty->print_cr("SOF Compiled Register Stack overflow at " INTPTR_FORMAT " (SIGSEGV)", pc); - tty->print_cr("Register Stack access at " INTPTR_FORMAT, addr); - tty->print_cr("Register Stack base " INTPTR_FORMAT, thread->register_stack_base()); - tty->print_cr("Register Stack [" INTPTR_FORMAT "," INTPTR_FORMAT "]", - thread->register_stack_base(), - thread->register_stack_base() + thread->stack_size()); - } - - // Reguard the permanent register stack red zone just to be sure. - // We saw Windows silently disabling this without telling us. - thread->enable_register_stack_red_zone(); - - return Handle_Exception(exceptionInfo, - SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::STACK_OVERFLOW)); - } -#endif if (thread->stack_guards_enabled()) { if (in_java) { frame fr; @@ -2647,35 +2532,6 @@ #endif { // Null pointer exception. -#ifdef _M_IA64 - // Process implicit null checks in compiled code. Note: Implicit null checks - // can happen even if "ImplicitNullChecks" is disabled, e.g. in vtable stubs. - if (CodeCache::contains((void*) pc_unix_format) && !MacroAssembler::needs_explicit_null_check((intptr_t) addr)) { - CodeBlob *cb = CodeCache::find_blob_unsafe(pc_unix_format); - // Handle implicit null check in UEP method entry - if (cb && (cb->is_frame_complete_at(pc) || - (cb->is_nmethod() && ((nmethod *)cb)->inlinecache_check_contains(pc)))) { - if (Verbose) { - intptr_t *bundle_start = (intptr_t*) ((intptr_t) pc_unix_format & 0xFFFFFFFFFFFFFFF0); - tty->print_cr("trap: null_check at " INTPTR_FORMAT " (SIGSEGV)", pc_unix_format); - tty->print_cr(" to addr " INTPTR_FORMAT, addr); - tty->print_cr(" bundle is " INTPTR_FORMAT " (high), " INTPTR_FORMAT " (low)", - *(bundle_start + 1), *bundle_start); - } - return Handle_Exception(exceptionInfo, - SharedRuntime::continuation_for_implicit_exception(thread, pc_unix_format, SharedRuntime::IMPLICIT_NULL)); - } - } - - // Implicit null checks were processed above. Hence, we should not reach - // here in the usual case => die! - if (Verbose) tty->print_raw_cr("Access violation, possible null pointer exception"); - report_error(t, exception_code, pc, exceptionInfo->ExceptionRecord, - exceptionInfo->ContextRecord); - return EXCEPTION_CONTINUE_SEARCH; - -#else // !IA64 - if (!MacroAssembler::needs_explicit_null_check((intptr_t)addr)) { address stub = SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_NULL); if (stub != NULL) return Handle_Exception(exceptionInfo, stub); @@ -2683,7 +2539,6 @@ report_error(t, exception_code, pc, exceptionInfo->ExceptionRecord, exceptionInfo->ContextRecord); return EXCEPTION_CONTINUE_SEARCH; -#endif } } } @@ -2706,22 +2561,6 @@ return EXCEPTION_CONTINUE_SEARCH; } // /EXCEPTION_ACCESS_VIOLATION // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -#if defined _M_IA64 - else if ((exception_code == EXCEPTION_ILLEGAL_INSTRUCTION || - exception_code == EXCEPTION_ILLEGAL_INSTRUCTION_2)) { - M37 handle_wrong_method_break(0, NativeJump::HANDLE_WRONG_METHOD, PR0); - - // Compiled method patched to be non entrant? Following conditions must apply: - // 1. must be first instruction in bundle - // 2. must be a break instruction with appropriate code - if ((((uint64_t) pc & 0x0F) == 0) && - (((IPF_Bundle*) pc)->get_slot0() == handle_wrong_method_break.bits())) { - return Handle_Exception(exceptionInfo, - (address)SharedRuntime::get_handle_wrong_method_stub()); - } - } // /EXCEPTION_ILLEGAL_INSTRUCTION -#endif - if (in_java) { switch (exception_code) { @@ -3752,20 +3591,15 @@ CONTEXT context; context.ContextFlags = CONTEXT_CONTROL; HANDLE handle = thread->osthread()->thread_handle(); -#ifdef _M_IA64 - assert(0, "Fix get_thread_pc"); - return ExtendedPC(NULL); -#else if (GetThreadContext(handle, &context)) { -#ifdef _M_AMD64 - return ExtendedPC((address) context.Rip); -#else - return ExtendedPC((address) context.Eip); -#endif + #ifdef _M_AMD64 + return ExtendedPC((address) context.Rip); + #else + return ExtendedPC((address) context.Eip); + #endif } else { return ExtendedPC(NULL); } -#endif } // GetCurrentThreadId() returns DWORD --- old/src/share/vm/oops/oop.inline.hpp 2017-06-07 14:33:12.178334309 -0400 +++ new/src/share/vm/oops/oop.inline.hpp 2017-06-07 14:33:11.660307739 -0400 @@ -232,23 +232,8 @@ // length of the array, shift (multiply) it appropriately, // up to wordSize, add the header, and align to object size. size_t size_in_bytes; -#ifdef _M_IA64 - // The Windows Itanium Aug 2002 SDK hoists this load above - // the check for s < 0. An oop at the end of the heap will - // cause an access violation if this load is performed on a non - // array oop. Making the reference volatile prohibits this. - // (%%% please explain by what magic the length is actually fetched!) - volatile int *array_length; - array_length = (volatile int *)( (intptr_t)this + - arrayOopDesc::length_offset_in_bytes() ); - assert(array_length > 0, "Integer arithmetic problem somewhere"); - // Put into size_t to avoid overflow. - size_in_bytes = (size_t) array_length; - size_in_bytes = size_in_bytes << Klass::layout_helper_log2_element_size(lh); -#else size_t array_length = (size_t) ((arrayOop)this)->length(); size_in_bytes = array_length << Klass::layout_helper_log2_element_size(lh); -#endif size_in_bytes += Klass::layout_helper_header_size(lh); // This code could be simplified, but by keeping array_header_in_bytes