< prev index next >

src/os/windows/vm/os_windows.cpp

Print this page

        

*** 112,129 **** static FILETIME process_creation_time; 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; --- 112,125 ---- static FILETIME process_creation_time; static FILETIME process_exit_time; static FILETIME process_user_time; static FILETIME process_kernel_time; ! #ifdef _M_AMD64 #define __CPU__ amd64 ! #else #define __CPU__ i486 #endif // save DLL module handle, used by GetModuleFileName HINSTANCE vm_lib_handle;
*** 349,390 **** stack_size += minfo.RegionSize; } else { 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; } size_t os::current_stack_size() { size_t sz; --- 345,354 ----
*** 1498,1516 **** static const arch_t arch_array[] = { {IMAGE_FILE_MACHINE_I386, (char*)"IA 32"}, {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) 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 #endif // Obtain a string for printf operation // lib_arch_str shall contain string what platform this .dll was built for --- 1462,1478 ---- static const arch_t arch_array[] = { {IMAGE_FILE_MACHINE_I386, (char*)"IA 32"}, {IMAGE_FILE_MACHINE_AMD64, (char*)"AMD 64"}, {IMAGE_FILE_MACHINE_IA64, (char*)"IA 64"} }; ! #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_AMD64 or _M_IX86 #endif // Obtain a string for printf operation // lib_arch_str shall contain string what platform this .dll was built for
*** 2159,2184 **** LONG Handle_Exception(struct _EXCEPTION_POINTERS* exceptionInfo, 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); } --- 2121,2130 ----
*** 2190,2200 **** 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; } --- 2136,2145 ----
*** 2214,2228 **** // From "Execution Protection in the Windows Operating System" draft 0.35 // Once a system header becomes available, the "real" define should be // 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 // All Visual C++ exceptions thrown from code generated by the Microsoft Visual // C++ compiler contain this error code. Because this is a compiler-generated --- 2159,2168 ----
*** 2259,2271 **** def_excpt(EXCEPTION_INVALID_DISPOSITION), def_excpt(EXCEPTION_GUARD_PAGE), 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 const char* os::exception_name(int exception_code, char *buf, size_t size) { --- 2199,2208 ----
*** 2282,2294 **** //----------------------------------------------------------------------------- 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] >= Assembler::REX && pc[0] <= Assembler::REX_WRXB && pc[1] == 0xF7 || pc[0] == 0xF7, "not an idiv opcode"); assert(pc[0] >= Assembler::REX && pc[0] <= Assembler::REX_WRXB && (pc[2] & ~0x7) == 0xF8 || (pc[1] & ~0x7) == 0xF8, "cannot handle non-register operands"); --- 2219,2228 ----
*** 2313,2323 **** 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; } //----------------------------------------------------------------------------- LONG WINAPI Handle_FLT_Exception(struct _EXCEPTION_POINTERS* exceptionInfo) { --- 2247,2256 ----
*** 2410,2435 **** //----------------------------------------------------------------------------- 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. if (StubRoutines::is_safefetch_fault(pc)) { return Handle_Exception(exceptionInfo, StubRoutines::continuation_for_safefetch_fault(pc)); --- 2343,2357 ----
*** 2542,2588 **** JavaThread* thread = (JavaThread*) t; bool in_java = thread->thread_state() == _thread_in_Java; // 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; PEXCEPTION_RECORD exceptionRecord = exceptionInfo->ExceptionRecord; address addr = (address) exceptionRecord->ExceptionInformation[1]; --- 2464,2473 ----
*** 2645,2691 **** return EXCEPTION_CONTINUE_EXECUTION; } else #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); } report_error(t, exception_code, pc, exceptionInfo->ExceptionRecord, exceptionInfo->ContextRecord); return EXCEPTION_CONTINUE_SEARCH; - #endif } } } #ifdef _WIN64 --- 2530,2546 ----
*** 2704,2729 **** report_error(t, exception_code, pc, exceptionInfo->ExceptionRecord, exceptionInfo->ContextRecord); 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) { case EXCEPTION_INT_DIVIDE_BY_ZERO: return Handle_Exception(exceptionInfo, SharedRuntime::continuation_for_implicit_exception(thread, pc, SharedRuntime::IMPLICIT_DIVIDE_BY_ZERO)); --- 2559,2568 ----
*** 3750,3773 **** // Get's a pc (hint) for a running thread. Currently used only for profiling. ExtendedPC os::get_thread_pc(Thread* thread) { 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 } else { return ExtendedPC(NULL); } - #endif } // GetCurrentThreadId() returns DWORD intx os::current_thread_id() { return GetCurrentThreadId(); } --- 3589,3607 ---- // Get's a pc (hint) for a running thread. Currently used only for profiling. ExtendedPC os::get_thread_pc(Thread* thread) { CONTEXT context; context.ContextFlags = CONTEXT_CONTROL; HANDLE handle = thread->osthread()->thread_handle(); if (GetThreadContext(handle, &context)) { ! #ifdef _M_AMD64 return ExtendedPC((address) context.Rip); ! #else return ExtendedPC((address) context.Eip); ! #endif } else { return ExtendedPC(NULL); } } // GetCurrentThreadId() returns DWORD intx os::current_thread_id() { return GetCurrentThreadId(); }
< prev index next >