41 // share set-hi instructions between addresses that differ by a small
42 // offset (e.g., different static variables in the same class).
43 // On such machines, the "x" argument to set_value on all set-lo
44 // instructions must be the same as the "x" argument for the
45 // corresponding set-hi instructions. The "o" arguments for the
46 // set-hi instructions are ignored, and must not affect the high-half
47 // immediate constant. The "o" arguments for the set-lo instructions are
48 // added into the low-half immediate constant, and must not overflow it."
49 //
50 // Currently we don't support splitting of relocations, so o must be
51 // zero:
52 assert(o == 0, "tried to split relocations");
53
54 if (!verify_only) {
55 if (format() != 1) {
56 nativeMovConstReg_at(addr())->set_data_plain(((intptr_t)x), code());
57 } else {
58 assert(type() == relocInfo::oop_type || type() == relocInfo::metadata_type,
59 "how to encode else?");
60 narrowOop no = (type() == relocInfo::oop_type) ?
61 oopDesc::encode_heap_oop((oop)x) : oopDesc::encode_klass((Klass*)x);
62 nativeMovConstReg_at(addr())->set_narrow_oop(no, code());
63 }
64 } else {
65 assert((address) (nativeMovConstReg_at(addr())->data()) == x, "data must match");
66 }
67 }
68
69 address Relocation::pd_call_destination(address orig_addr) {
70 intptr_t adj = 0;
71 address inst_loc = addr();
72
73 if (orig_addr != NULL) {
74 // We just moved this call instruction from orig_addr to addr().
75 // This means its target will appear to have grown by addr() - orig_addr.
76 adj = -(inst_loc - orig_addr);
77 }
78 if (NativeFarCall::is_far_call_at(inst_loc)) {
79 NativeFarCall* call = nativeFarCall_at(inst_loc);
80 return call->destination() + (intptr_t)(call->is_pcrelative() ? adj : 0);
81 } else if (NativeJump::is_jump_at(inst_loc)) {
|
41 // share set-hi instructions between addresses that differ by a small
42 // offset (e.g., different static variables in the same class).
43 // On such machines, the "x" argument to set_value on all set-lo
44 // instructions must be the same as the "x" argument for the
45 // corresponding set-hi instructions. The "o" arguments for the
46 // set-hi instructions are ignored, and must not affect the high-half
47 // immediate constant. The "o" arguments for the set-lo instructions are
48 // added into the low-half immediate constant, and must not overflow it."
49 //
50 // Currently we don't support splitting of relocations, so o must be
51 // zero:
52 assert(o == 0, "tried to split relocations");
53
54 if (!verify_only) {
55 if (format() != 1) {
56 nativeMovConstReg_at(addr())->set_data_plain(((intptr_t)x), code());
57 } else {
58 assert(type() == relocInfo::oop_type || type() == relocInfo::metadata_type,
59 "how to encode else?");
60 narrowOop no = (type() == relocInfo::oop_type) ?
61 oopDesc::encode_heap_oop((oop)x) : Klass::encode_klass((Klass*)x);
62 nativeMovConstReg_at(addr())->set_narrow_oop(no, code());
63 }
64 } else {
65 assert((address) (nativeMovConstReg_at(addr())->data()) == x, "data must match");
66 }
67 }
68
69 address Relocation::pd_call_destination(address orig_addr) {
70 intptr_t adj = 0;
71 address inst_loc = addr();
72
73 if (orig_addr != NULL) {
74 // We just moved this call instruction from orig_addr to addr().
75 // This means its target will appear to have grown by addr() - orig_addr.
76 adj = -(inst_loc - orig_addr);
77 }
78 if (NativeFarCall::is_far_call_at(inst_loc)) {
79 NativeFarCall* call = nativeFarCall_at(inst_loc);
80 return call->destination() + (intptr_t)(call->is_pcrelative() ? adj : 0);
81 } else if (NativeJump::is_jump_at(inst_loc)) {
|