287 }
288
289 //-------------------------------------------------------------------
290
291 int NativeMovRegMem::offset() const {
292 address pc = instruction_address();
293 unsigned insn = *(unsigned*)pc;
294 if (Instruction_aarch64::extract(insn, 28, 24) == 0b10000) {
295 address addr = MacroAssembler::target_addr_for_insn(pc);
296 return *addr;
297 } else {
298 return (int)(intptr_t)MacroAssembler::target_addr_for_insn(instruction_address());
299 }
300 }
301
302 void NativeMovRegMem::set_offset(int x) {
303 address pc = instruction_address();
304 unsigned insn = *(unsigned*)pc;
305 if (maybe_cpool_ref(pc)) {
306 address addr = MacroAssembler::target_addr_for_insn(pc);
307 *(long*)addr = x;
308 } else {
309 MacroAssembler::pd_patch_instruction(pc, (address)intptr_t(x));
310 ICache::invalidate_range(instruction_address(), instruction_size);
311 }
312 }
313
314 void NativeMovRegMem::verify() {
315 #ifdef ASSERT
316 address dest = MacroAssembler::target_addr_for_insn(instruction_address());
317 #endif
318 }
319
320 //--------------------------------------------------------------------------------
321
322 void NativeJump::verify() { ; }
323
324
325 void NativeJump::check_verified_entry_alignment(address entry, address verified_entry) {
326 }
327
|
287 }
288
289 //-------------------------------------------------------------------
290
291 int NativeMovRegMem::offset() const {
292 address pc = instruction_address();
293 unsigned insn = *(unsigned*)pc;
294 if (Instruction_aarch64::extract(insn, 28, 24) == 0b10000) {
295 address addr = MacroAssembler::target_addr_for_insn(pc);
296 return *addr;
297 } else {
298 return (int)(intptr_t)MacroAssembler::target_addr_for_insn(instruction_address());
299 }
300 }
301
302 void NativeMovRegMem::set_offset(int x) {
303 address pc = instruction_address();
304 unsigned insn = *(unsigned*)pc;
305 if (maybe_cpool_ref(pc)) {
306 address addr = MacroAssembler::target_addr_for_insn(pc);
307 *(int64_t*)addr = x;
308 } else {
309 MacroAssembler::pd_patch_instruction(pc, (address)intptr_t(x));
310 ICache::invalidate_range(instruction_address(), instruction_size);
311 }
312 }
313
314 void NativeMovRegMem::verify() {
315 #ifdef ASSERT
316 address dest = MacroAssembler::target_addr_for_insn(instruction_address());
317 #endif
318 }
319
320 //--------------------------------------------------------------------------------
321
322 void NativeJump::verify() { ; }
323
324
325 void NativeJump::check_verified_entry_alignment(address entry, address verified_entry) {
326 }
327
|