comparison src/os/windows/vm/os_windows.cpp @ 3675:3a05d8465ff1

Relaxed idiv exception handler assert.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Mon, 21 Nov 2011 14:12:10 +0100
parents be4ca325525a
children 285d51520d4c
comparison
equal deleted inserted replaced
3674:d3d3dd0a3421 3675:3a05d8465ff1
2072 assert(0, "Fix Handle_IDiv_Exception"); 2072 assert(0, "Fix Handle_IDiv_Exception");
2073 #elif _M_AMD64 2073 #elif _M_AMD64
2074 PCONTEXT ctx = exceptionInfo->ContextRecord; 2074 PCONTEXT ctx = exceptionInfo->ContextRecord;
2075 address pc = (address)ctx->Rip; 2075 address pc = (address)ctx->Rip;
2076 NOT_PRODUCT(Events::log("idiv overflow exception at " INTPTR_FORMAT , pc)); 2076 NOT_PRODUCT(Events::log("idiv overflow exception at " INTPTR_FORMAT , pc));
2077 assert(pc[0] == 0xF7, "not an idiv opcode"); 2077 assert(pc[0] == 0xF7 || (pc[1] == 0xF7 && pc[0] == 0x41), "not an idiv opcode");
2078 assert((pc[1] & ~0x7) == 0xF8, "cannot handle non-register operands"); 2078 //assert((pc[1] & ~0x7) == 0xF8, "cannot handle non-register operands");
2079 assert(ctx->Rax == min_jint, "unexpected idiv exception"); 2079 assert((long)ctx->Rax == (long)min_jint, "unexpected idiv exception");
2080 // set correct result values and continue after idiv instruction 2080 // set correct result values and continue after idiv instruction
2081 ctx->Rip = (DWORD)pc + 2; // idiv reg, reg is 2 bytes 2081 ctx->Rip = (DWORD)pc + 2; // idiv reg, reg is 2 bytes
2082 ctx->Rax = (DWORD)min_jint; // result 2082 ctx->Rax = (DWORD)min_jint; // result
2083 ctx->Rdx = (DWORD)0; // remainder 2083 ctx->Rdx = (DWORD)0; // remainder
2084 // Continue the execution 2084 // Continue the execution