1.1 --- a/src/cpu/x86/vm/relocInfo_x86.cpp Sun Mar 27 00:00:14 2011 -0700 1.2 +++ b/src/cpu/x86/vm/relocInfo_x86.cpp Sun Mar 27 13:17:37 2011 -0700 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -198,41 +198,44 @@ 1.11 1.12 void poll_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) { 1.13 #ifdef _LP64 1.14 - typedef Assembler::WhichOperand WhichOperand; 1.15 - WhichOperand which = (WhichOperand) format(); 1.16 - // This format is imm but it is really disp32 1.17 - which = Assembler::disp32_operand; 1.18 - address orig_addr = old_addr_for(addr(), src, dest); 1.19 - NativeInstruction* oni = nativeInstruction_at(orig_addr); 1.20 - int32_t* orig_disp = (int32_t*) Assembler::locate_operand(orig_addr, which); 1.21 - // This poll_addr is incorrect by the size of the instruction it is irrelevant 1.22 - intptr_t poll_addr = (intptr_t)oni + *orig_disp; 1.23 + if (!Assembler::is_polling_page_far()) { 1.24 + typedef Assembler::WhichOperand WhichOperand; 1.25 + WhichOperand which = (WhichOperand) format(); 1.26 + // This format is imm but it is really disp32 1.27 + which = Assembler::disp32_operand; 1.28 + address orig_addr = old_addr_for(addr(), src, dest); 1.29 + NativeInstruction* oni = nativeInstruction_at(orig_addr); 1.30 + int32_t* orig_disp = (int32_t*) Assembler::locate_operand(orig_addr, which); 1.31 + // This poll_addr is incorrect by the size of the instruction it is irrelevant 1.32 + intptr_t poll_addr = (intptr_t)oni + *orig_disp; 1.33 1.34 - NativeInstruction* ni = nativeInstruction_at(addr()); 1.35 - intptr_t new_disp = poll_addr - (intptr_t) ni; 1.36 + NativeInstruction* ni = nativeInstruction_at(addr()); 1.37 + intptr_t new_disp = poll_addr - (intptr_t) ni; 1.38 1.39 - int32_t* disp = (int32_t*) Assembler::locate_operand(addr(), which); 1.40 - * disp = (int32_t)new_disp; 1.41 - 1.42 + int32_t* disp = (int32_t*) Assembler::locate_operand(addr(), which); 1.43 + * disp = (int32_t)new_disp; 1.44 + } 1.45 #endif // _LP64 1.46 } 1.47 1.48 void poll_return_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) { 1.49 #ifdef _LP64 1.50 - typedef Assembler::WhichOperand WhichOperand; 1.51 - WhichOperand which = (WhichOperand) format(); 1.52 - // This format is imm but it is really disp32 1.53 - which = Assembler::disp32_operand; 1.54 - address orig_addr = old_addr_for(addr(), src, dest); 1.55 - NativeInstruction* oni = nativeInstruction_at(orig_addr); 1.56 - int32_t* orig_disp = (int32_t*) Assembler::locate_operand(orig_addr, which); 1.57 - // This poll_addr is incorrect by the size of the instruction it is irrelevant 1.58 - intptr_t poll_addr = (intptr_t)oni + *orig_disp; 1.59 + if (!Assembler::is_polling_page_far()) { 1.60 + typedef Assembler::WhichOperand WhichOperand; 1.61 + WhichOperand which = (WhichOperand) format(); 1.62 + // This format is imm but it is really disp32 1.63 + which = Assembler::disp32_operand; 1.64 + address orig_addr = old_addr_for(addr(), src, dest); 1.65 + NativeInstruction* oni = nativeInstruction_at(orig_addr); 1.66 + int32_t* orig_disp = (int32_t*) Assembler::locate_operand(orig_addr, which); 1.67 + // This poll_addr is incorrect by the size of the instruction it is irrelevant 1.68 + intptr_t poll_addr = (intptr_t)oni + *orig_disp; 1.69 1.70 - NativeInstruction* ni = nativeInstruction_at(addr()); 1.71 - intptr_t new_disp = poll_addr - (intptr_t) ni; 1.72 + NativeInstruction* ni = nativeInstruction_at(addr()); 1.73 + intptr_t new_disp = poll_addr - (intptr_t) ni; 1.74 1.75 - int32_t* disp = (int32_t*) Assembler::locate_operand(addr(), which); 1.76 - * disp = (int32_t)new_disp; 1.77 + int32_t* disp = (int32_t*) Assembler::locate_operand(addr(), which); 1.78 + * disp = (int32_t)new_disp; 1.79 + } 1.80 #endif // _LP64 1.81 }