comparison src/os/windows/vm/os_windows.cpp @ 4680:acf7d88327fa

Fixed two asserts in the implicit div exception handling for Windows that are not valid for Graal (as it deoptimizes to some place before the div instead of exactly to the div bytecode).
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Thu, 23 Feb 2012 23:06:28 +0100
parents 04b9a2566eec
children 33df1aeaebbf
comparison
equal deleted inserted replaced
4679:7406229b269f 4680:acf7d88327fa
2081 assert(0, "Fix Handle_IDiv_Exception"); 2081 assert(0, "Fix Handle_IDiv_Exception");
2082 #elif _M_AMD64 2082 #elif _M_AMD64
2083 PCONTEXT ctx = exceptionInfo->ContextRecord; 2083 PCONTEXT ctx = exceptionInfo->ContextRecord;
2084 address pc = (address)ctx->Rip; 2084 address pc = (address)ctx->Rip;
2085 NOT_PRODUCT(Events::log("idiv overflow exception at " INTPTR_FORMAT , pc)); 2085 NOT_PRODUCT(Events::log("idiv overflow exception at " INTPTR_FORMAT , pc));
2086 assert(pc[0] == 0xF7 || (pc[1] == 0xF7 && (pc[0] == 0x41 || pc[0] == 0x49)), "not an idiv opcode"); 2086 //assert(pc[0] == 0xF7 || (pc[1] == 0xF7 && (pc[0] == 0x41 || pc[0] == 0x49)), "not an idiv opcode");
2087 //assert((pc[1] & ~0x7) == 0xF8, "cannot handle non-register operands"); 2087 //assert((pc[1] & ~0x7) == 0xF8, "cannot handle non-register operands");
2088 assert((long)ctx->Rax == (long)min_jint || pc[0] == 0x49, "unexpected idiv exception"); 2088 //assert((long)ctx->Rax == (long)min_jint || pc[0] == 0x49, "unexpected idiv exception");
2089 // set correct result values and continue after idiv instruction 2089 // set correct result values and continue after idiv instruction
2090 ctx->Rip = (DWORD)pc + 2; // idiv reg, reg is 2 bytes 2090 ctx->Rip = (DWORD)pc + 2; // idiv reg, reg is 2 bytes
2091 ctx->Rax = (DWORD)min_jint; // result 2091 ctx->Rax = (DWORD)min_jint; // result
2092 ctx->Rdx = (DWORD)0; // remainder 2092 ctx->Rdx = (DWORD)0; // remainder
2093 // Continue the execution 2093 // Continue the execution