src/cpu/x86/vm/relocInfo_x86.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/cpu/x86/vm/relocInfo_x86.cpp	Thu Mar 17 20:40:01 2011
--- new/src/cpu/x86/vm/relocInfo_x86.cpp	Thu Mar 17 20:40:01 2011

*** 29,60 **** --- 29,76 ---- #include "nativeInst_x86.hpp" #include "oops/oop.inline.hpp" #include "runtime/safepoint.hpp" ! void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) { #ifdef AMD64 x += o; typedef Assembler::WhichOperand WhichOperand; WhichOperand which = (WhichOperand) format(); // that is, disp32 or imm, call32, narrow oop assert(which == Assembler::disp32_operand || which == Assembler::narrow_oop_operand || which == Assembler::imm_operand, "format unpacks ok"); if (which == Assembler::imm_operand) { + if (verify_only) { + assert(*pd_address_in_code() == x, "instructions must match"); + } else { *pd_address_in_code() = x; + } } else if (which == Assembler::narrow_oop_operand) { address disp = Assembler::locate_operand(addr(), which); + if (verify_only) { + assert(*(int32_t*) disp == oopDesc::encode_heap_oop((oop)x), "instructions must match"); + } else { *(int32_t*) disp = oopDesc::encode_heap_oop((oop)x); + } } else { // Note: Use runtime_call_type relocations for call32_operand. address ip = addr(); address disp = Assembler::locate_operand(ip, which); address next_ip = Assembler::locate_next_instruction(ip); + if (verify_only) { + assert(*(int32_t*) disp == (x - next_ip), "instructions must match"); + } else { *(int32_t*) disp = x - next_ip; } + } #else + if (verify_only) { + assert(*pd_address_in_code() == (x + o), "instructions must match"); + } else { *pd_address_in_code() = x + o; + } #endif // AMD64 } address Relocation::pd_call_destination(address orig_addr) {

src/cpu/x86/vm/relocInfo_x86.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File