176 // Special case: Patchable branch local to the code cache.
177 // This will break badly if the code cache grows larger than a few Mb.
178 NativeGeneralJump* br = nativeGeneralJump_at(addr());
179 br->set_jump_destination(x);
180 }
181
182
183 address* Relocation::pd_address_in_code() {
184 // SPARC never embeds addresses in code, at present.
185 //assert(type() == relocInfo::oop_type, "only oops are inlined at present");
186 return (address*)addr();
187 }
188
189
190 address Relocation::pd_get_address_from_code() {
191 // SPARC never embeds addresses in code, at present.
192 //assert(type() == relocInfo::oop_type, "only oops are inlined at present");
193 return *(address*)addr();
194 }
195
196
197 int Relocation::pd_breakpoint_size() {
198 // minimum breakpoint size, in short words
199 return NativeIllegalInstruction::instruction_size / sizeof(short);
200 }
201
202 void Relocation::pd_swap_in_breakpoint(address x, short* instrs, int instrlen) {
203 Untested("pd_swap_in_breakpoint");
204 // %%% probably do not need a general instrlen; just use the trap size
205 if (instrs != NULL) {
206 assert(instrlen * sizeof(short) == NativeIllegalInstruction::instruction_size, "enough instrlen in reloc. data");
207 for (int i = 0; i < instrlen; i++) {
208 instrs[i] = ((short*)x)[i];
209 }
210 }
211 NativeIllegalInstruction::insert(x);
212 }
213
214
215 void Relocation::pd_swap_out_breakpoint(address x, short* instrs, int instrlen) {
216 Untested("pd_swap_out_breakpoint");
217 assert(instrlen * sizeof(short) == sizeof(int), "enough buf");
218 union { int l; short s[1]; } u;
219 for (int i = 0; i < instrlen; i++) {
220 u.s[i] = instrs[i];
221 }
222 NativeInstruction* ni = nativeInstruction_at(x);
223 ni->set_long_at(0, u.l);
224 }
225
226 void poll_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) {
227 }
228
229 void poll_return_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) {
230 }
231
232 void metadata_Relocation::pd_fix_value(address x) {
233 }
|
176 // Special case: Patchable branch local to the code cache.
177 // This will break badly if the code cache grows larger than a few Mb.
178 NativeGeneralJump* br = nativeGeneralJump_at(addr());
179 br->set_jump_destination(x);
180 }
181
182
183 address* Relocation::pd_address_in_code() {
184 // SPARC never embeds addresses in code, at present.
185 //assert(type() == relocInfo::oop_type, "only oops are inlined at present");
186 return (address*)addr();
187 }
188
189
190 address Relocation::pd_get_address_from_code() {
191 // SPARC never embeds addresses in code, at present.
192 //assert(type() == relocInfo::oop_type, "only oops are inlined at present");
193 return *(address*)addr();
194 }
195
196 void poll_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) {
197 }
198
199 void poll_return_Relocation::fix_relocation_after_move(const CodeBuffer* src, CodeBuffer* dest) {
200 }
201
202 void metadata_Relocation::pd_fix_value(address x) {
203 }
|