< prev index next >

src/hotspot/cpu/x86/relocInfo_x86.cpp

Print this page




  34 #include "runtime/safepointMechanism.hpp"
  35 
  36 
  37 void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
  38 #ifdef AMD64
  39   x += o;
  40   typedef Assembler::WhichOperand WhichOperand;
  41   WhichOperand which = (WhichOperand) format(); // that is, disp32 or imm, call32, narrow oop
  42   assert(which == Assembler::disp32_operand ||
  43          which == Assembler::narrow_oop_operand ||
  44          which == Assembler::imm_operand, "format unpacks ok");
  45   if (which == Assembler::imm_operand) {
  46     if (verify_only) {
  47       guarantee(*pd_address_in_code() == x, "instructions must match");
  48     } else {
  49       *pd_address_in_code() = x;
  50     }
  51   } else if (which == Assembler::narrow_oop_operand) {
  52     address disp = Assembler::locate_operand(addr(), which);
  53     // both compressed oops and compressed classes look the same
  54     if (CompressedOops::is_in((void*)x)) {
  55     if (verify_only) {
  56       guarantee(*(uint32_t*) disp == CompressedOops::encode((oop)x), "instructions must match");
  57     } else {
  58       *(int32_t*) disp = CompressedOops::encode((oop)x);
  59     }
  60   } else {
  61       if (verify_only) {
  62         guarantee(*(uint32_t*) disp == CompressedKlassPointers::encode((Klass*)x), "instructions must match");
  63       } else {
  64         *(int32_t*) disp = CompressedKlassPointers::encode((Klass*)x);
  65       }
  66     }
  67   } else {
  68     // Note:  Use runtime_call_type relocations for call32_operand.
  69     address ip = addr();
  70     address disp = Assembler::locate_operand(ip, which);
  71     address next_ip = Assembler::locate_next_instruction(ip);
  72     if (verify_only) {
  73       guarantee(*(int32_t*) disp == (x - next_ip), "instructions must match");
  74     } else {




  34 #include "runtime/safepointMechanism.hpp"
  35 
  36 
  37 void Relocation::pd_set_data_value(address x, intptr_t o, bool verify_only) {
  38 #ifdef AMD64
  39   x += o;
  40   typedef Assembler::WhichOperand WhichOperand;
  41   WhichOperand which = (WhichOperand) format(); // that is, disp32 or imm, call32, narrow oop
  42   assert(which == Assembler::disp32_operand ||
  43          which == Assembler::narrow_oop_operand ||
  44          which == Assembler::imm_operand, "format unpacks ok");
  45   if (which == Assembler::imm_operand) {
  46     if (verify_only) {
  47       guarantee(*pd_address_in_code() == x, "instructions must match");
  48     } else {
  49       *pd_address_in_code() = x;
  50     }
  51   } else if (which == Assembler::narrow_oop_operand) {
  52     address disp = Assembler::locate_operand(addr(), which);
  53     // both compressed oops and compressed classes look the same
  54     if (Universe::heap()->is_in_reserved((oop)x)) {
  55     if (verify_only) {
  56       guarantee(*(uint32_t*) disp == CompressedOops::encode((oop)x), "instructions must match");
  57     } else {
  58       *(int32_t*) disp = CompressedOops::encode((oop)x);
  59     }
  60   } else {
  61       if (verify_only) {
  62         guarantee(*(uint32_t*) disp == CompressedKlassPointers::encode((Klass*)x), "instructions must match");
  63       } else {
  64         *(int32_t*) disp = CompressedKlassPointers::encode((Klass*)x);
  65       }
  66     }
  67   } else {
  68     // Note:  Use runtime_call_type relocations for call32_operand.
  69     address ip = addr();
  70     address disp = Assembler::locate_operand(ip, which);
  71     address next_ip = Assembler::locate_next_instruction(ip);
  72     if (verify_only) {
  73       guarantee(*(int32_t*) disp == (x - next_ip), "instructions must match");
  74     } else {


< prev index next >