128 *(jint*)disp += (x - old_dest);
129 } else if (ni->is_mov_literal64()) {
130 ((NativeMovConstReg*)ni)->set_data((intptr_t)x);
131 } else {
132 ShouldNotReachHere();
133 }
134 }
135
136
137 address* Relocation::pd_address_in_code() {
138 // All embedded Intel addresses are stored in 32-bit words.
139 // Since the addr points at the start of the instruction,
140 // we must parse the instruction a bit to find the embedded word.
141 assert(is_data(), "must be a DataRelocation");
142 typedef Assembler::WhichOperand WhichOperand;
143 WhichOperand which = (WhichOperand) format(); // that is, disp32 or imm/imm32
144 #ifdef AMD64
145 assert(which == Assembler::disp32_operand ||
146 which == Assembler::call32_operand ||
147 which == Assembler::imm_operand, "format unpacks ok");
148 if (which != Assembler::imm_operand) {
149 // The "address" in the code is a displacement can't return it as
150 // and address* since it is really a jint*
151 ShouldNotReachHere();
152 return NULL;
153 }
154 #else
155 assert(which == Assembler::disp32_operand || which == Assembler::imm_operand, "format unpacks ok");
156 #endif // AMD64
157 return (address*) Assembler::locate_operand(addr(), which);
158 }
159
160
161 address Relocation::pd_get_address_from_code() {
162 #ifdef AMD64
163 // All embedded Intel addresses are stored in 32-bit words.
164 // Since the addr points at the start of the instruction,
165 // we must parse the instruction a bit to find the embedded word.
166 assert(is_data(), "must be a DataRelocation");
167 typedef Assembler::WhichOperand WhichOperand;
168 WhichOperand which = (WhichOperand) format(); // that is, disp32 or imm/imm32
169 assert(which == Assembler::disp32_operand ||
170 which == Assembler::call32_operand ||
171 which == Assembler::imm_operand, "format unpacks ok");
172 if (which != Assembler::imm_operand) {
173 address ip = addr();
|
128 *(jint*)disp += (x - old_dest);
129 } else if (ni->is_mov_literal64()) {
130 ((NativeMovConstReg*)ni)->set_data((intptr_t)x);
131 } else {
132 ShouldNotReachHere();
133 }
134 }
135
136
137 address* Relocation::pd_address_in_code() {
138 // All embedded Intel addresses are stored in 32-bit words.
139 // Since the addr points at the start of the instruction,
140 // we must parse the instruction a bit to find the embedded word.
141 assert(is_data(), "must be a DataRelocation");
142 typedef Assembler::WhichOperand WhichOperand;
143 WhichOperand which = (WhichOperand) format(); // that is, disp32 or imm/imm32
144 #ifdef AMD64
145 assert(which == Assembler::disp32_operand ||
146 which == Assembler::call32_operand ||
147 which == Assembler::imm_operand, "format unpacks ok");
148 // The "address" in the code is a displacement can't return it as
149 // and address* since it is really a jint*
150 guarantee(which == Assembler::imm_operand, "must be immediate operand");
151 #else
152 assert(which == Assembler::disp32_operand || which == Assembler::imm_operand, "format unpacks ok");
153 #endif // AMD64
154 return (address*) Assembler::locate_operand(addr(), which);
155 }
156
157
158 address Relocation::pd_get_address_from_code() {
159 #ifdef AMD64
160 // All embedded Intel addresses are stored in 32-bit words.
161 // Since the addr points at the start of the instruction,
162 // we must parse the instruction a bit to find the embedded word.
163 assert(is_data(), "must be a DataRelocation");
164 typedef Assembler::WhichOperand WhichOperand;
165 WhichOperand which = (WhichOperand) format(); // that is, disp32 or imm/imm32
166 assert(which == Assembler::disp32_operand ||
167 which == Assembler::call32_operand ||
168 which == Assembler::imm_operand, "format unpacks ok");
169 if (which != Assembler::imm_operand) {
170 address ip = addr();
|