2086 #ifdef _M_IA64 |
2086 #ifdef _M_IA64 |
2087 assert(0, "Fix Handle_IDiv_Exception"); |
2087 assert(0, "Fix Handle_IDiv_Exception"); |
2088 #elif _M_AMD64 |
2088 #elif _M_AMD64 |
2089 PCONTEXT ctx = exceptionInfo->ContextRecord; |
2089 PCONTEXT ctx = exceptionInfo->ContextRecord; |
2090 address pc = (address)ctx->Rip; |
2090 address pc = (address)ctx->Rip; |
2091 NOT_PRODUCT(Events::log("idiv overflow exception at " INTPTR_FORMAT , pc)); |
|
2092 assert(pc[0] == 0xF7, "not an idiv opcode"); |
2091 assert(pc[0] == 0xF7, "not an idiv opcode"); |
2093 assert((pc[1] & ~0x7) == 0xF8, "cannot handle non-register operands"); |
2092 assert((pc[1] & ~0x7) == 0xF8, "cannot handle non-register operands"); |
2094 assert(ctx->Rax == min_jint, "unexpected idiv exception"); |
2093 assert(ctx->Rax == min_jint, "unexpected idiv exception"); |
2095 // set correct result values and continue after idiv instruction |
2094 // set correct result values and continue after idiv instruction |
2096 ctx->Rip = (DWORD)pc + 2; // idiv reg, reg is 2 bytes |
2095 ctx->Rip = (DWORD)pc + 2; // idiv reg, reg is 2 bytes |
2098 ctx->Rdx = (DWORD)0; // remainder |
2097 ctx->Rdx = (DWORD)0; // remainder |
2099 // Continue the execution |
2098 // Continue the execution |
2100 #else |
2099 #else |
2101 PCONTEXT ctx = exceptionInfo->ContextRecord; |
2100 PCONTEXT ctx = exceptionInfo->ContextRecord; |
2102 address pc = (address)ctx->Eip; |
2101 address pc = (address)ctx->Eip; |
2103 NOT_PRODUCT(Events::log("idiv overflow exception at " INTPTR_FORMAT , pc)); |
|
2104 assert(pc[0] == 0xF7, "not an idiv opcode"); |
2102 assert(pc[0] == 0xF7, "not an idiv opcode"); |
2105 assert((pc[1] & ~0x7) == 0xF8, "cannot handle non-register operands"); |
2103 assert((pc[1] & ~0x7) == 0xF8, "cannot handle non-register operands"); |
2106 assert(ctx->Eax == min_jint, "unexpected idiv exception"); |
2104 assert(ctx->Eax == min_jint, "unexpected idiv exception"); |
2107 // set correct result values and continue after idiv instruction |
2105 // set correct result values and continue after idiv instruction |
2108 ctx->Eip = (DWORD)pc + 2; // idiv reg, reg is 2 bytes |
2106 ctx->Eip = (DWORD)pc + 2; // idiv reg, reg is 2 bytes |