hotspot/src/cpu/x86/vm/relocInfo_x86.cpp
changeset 33807 9f8b0f8a3f29
parent 33160 c59f1676d27e
equal deleted inserted replaced
33806:4160a3c28ce8 33807:9f8b0f8a3f29
    39   assert(which == Assembler::disp32_operand ||
    39   assert(which == Assembler::disp32_operand ||
    40          which == Assembler::narrow_oop_operand ||
    40          which == Assembler::narrow_oop_operand ||
    41          which == Assembler::imm_operand, "format unpacks ok");
    41          which == Assembler::imm_operand, "format unpacks ok");
    42   if (which == Assembler::imm_operand) {
    42   if (which == Assembler::imm_operand) {
    43     if (verify_only) {
    43     if (verify_only) {
    44       assert(*pd_address_in_code() == x, "instructions must match");
    44       guarantee(*pd_address_in_code() == x, "instructions must match");
    45     } else {
    45     } else {
    46       *pd_address_in_code() = x;
    46       *pd_address_in_code() = x;
    47     }
    47     }
    48   } else if (which == Assembler::narrow_oop_operand) {
    48   } else if (which == Assembler::narrow_oop_operand) {
    49     address disp = Assembler::locate_operand(addr(), which);
    49     address disp = Assembler::locate_operand(addr(), which);
    50     // both compressed oops and compressed classes look the same
    50     // both compressed oops and compressed classes look the same
    51     if (Universe::heap()->is_in_reserved((oop)x)) {
    51     if (Universe::heap()->is_in_reserved((oop)x)) {
    52     if (verify_only) {
    52     if (verify_only) {
    53       assert(*(uint32_t*) disp == oopDesc::encode_heap_oop((oop)x), "instructions must match");
    53       guarantee(*(uint32_t*) disp == oopDesc::encode_heap_oop((oop)x), "instructions must match");
    54     } else {
    54     } else {
    55       *(int32_t*) disp = oopDesc::encode_heap_oop((oop)x);
    55       *(int32_t*) disp = oopDesc::encode_heap_oop((oop)x);
    56     }
    56     }
    57   } else {
    57   } else {
    58       if (verify_only) {
    58       if (verify_only) {
    59         assert(*(uint32_t*) disp == Klass::encode_klass((Klass*)x), "instructions must match");
    59         guarantee(*(uint32_t*) disp == Klass::encode_klass((Klass*)x), "instructions must match");
    60       } else {
    60       } else {
    61         *(int32_t*) disp = Klass::encode_klass((Klass*)x);
    61         *(int32_t*) disp = Klass::encode_klass((Klass*)x);
    62       }
    62       }
    63     }
    63     }
    64   } else {
    64   } else {
    65     // Note:  Use runtime_call_type relocations for call32_operand.
    65     // Note:  Use runtime_call_type relocations for call32_operand.
    66     address ip = addr();
    66     address ip = addr();
    67     address disp = Assembler::locate_operand(ip, which);
    67     address disp = Assembler::locate_operand(ip, which);
    68     address next_ip = Assembler::locate_next_instruction(ip);
    68     address next_ip = Assembler::locate_next_instruction(ip);
    69     if (verify_only) {
    69     if (verify_only) {
    70       assert(*(int32_t*) disp == (x - next_ip), "instructions must match");
    70       guarantee(*(int32_t*) disp == (x - next_ip), "instructions must match");
    71     } else {
    71     } else {
    72       *(int32_t*) disp = x - next_ip;
    72       *(int32_t*) disp = x - next_ip;
    73     }
    73     }
    74   }
    74   }
    75 #else
    75 #else
    76   if (verify_only) {
    76   if (verify_only) {
    77     assert(*pd_address_in_code() == (x + o), "instructions must match");
    77     guarantee(*pd_address_in_code() == (x + o), "instructions must match");
    78   } else {
    78   } else {
    79     *pd_address_in_code() = x + o;
    79     *pd_address_in_code() = x + o;
    80   }
    80   }
    81 #endif // AMD64
    81 #endif // AMD64
    82 }
    82 }