< prev index next >

src/hotspot/cpu/riscv/nativeInst_riscv.cpp

Print this page

262         Bytes::put_native_u8((address)oop_addr, x);
263         break;
264       } else if (iter.type() == relocInfo::metadata_type) {
265         Metadata** metadata_addr = iter.metadata_reloc()->metadata_addr();
266         Bytes::put_native_u8((address)metadata_addr, x);
267         break;
268       }
269     }
270   }
271 }
272 
273 void NativeMovConstReg::print() {
274   tty->print_cr(PTR_FORMAT ": mov reg, " INTPTR_FORMAT,
275                 p2i(instruction_address()), data());
276 }
277 
278 //--------------------------------------------------------------------------------
279 
280 void NativeJump::verify() { }
281 







282 address NativeJump::jump_destination() const {
283   address dest = MacroAssembler::target_addr_for_insn(instruction_address());
284 
285   // We use jump to self as the unresolved address which the inline
286   // cache code (and relocs) know about
287   // As a special case we also use sequence movptr(r,0), jalr(r,0)
288   // i.e. jump to 0 when we need leave space for a wide immediate
289   // load
290 
291   // return -1 if jump to self or to 0
292   if ((dest == (address) this) || dest == nullptr) {
293     dest = (address) -1;
294   }
295 
296   return dest;
297 };
298 
299 void NativeJump::set_jump_destination(address dest) {
300   // We use jump to self as the unresolved address which the inline
301   // cache code (and relocs) know about

262         Bytes::put_native_u8((address)oop_addr, x);
263         break;
264       } else if (iter.type() == relocInfo::metadata_type) {
265         Metadata** metadata_addr = iter.metadata_reloc()->metadata_addr();
266         Bytes::put_native_u8((address)metadata_addr, x);
267         break;
268       }
269     }
270   }
271 }
272 
273 void NativeMovConstReg::print() {
274   tty->print_cr(PTR_FORMAT ": mov reg, " INTPTR_FORMAT,
275                 p2i(instruction_address()), data());
276 }
277 
278 //--------------------------------------------------------------------------------
279 
280 void NativeJump::verify() { }
281 
282 void NativeJump::insert(address code_pos, address entry) {
283   intptr_t disp = (intptr_t)entry - ((intptr_t)code_pos);
284   uint32_t new_jal = Assembler::encode_jal(ra, disp);
285   AtomicAccess::store((uint32_t *)code_pos, new_jal);
286   ICache::invalidate_range(code_pos, instruction_size);
287 }
288 
289 address NativeJump::jump_destination() const {
290   address dest = MacroAssembler::target_addr_for_insn(instruction_address());
291 
292   // We use jump to self as the unresolved address which the inline
293   // cache code (and relocs) know about
294   // As a special case we also use sequence movptr(r,0), jalr(r,0)
295   // i.e. jump to 0 when we need leave space for a wide immediate
296   // load
297 
298   // return -1 if jump to self or to 0
299   if ((dest == (address) this) || dest == nullptr) {
300     dest = (address) -1;
301   }
302 
303   return dest;
304 };
305 
306 void NativeJump::set_jump_destination(address dest) {
307   // We use jump to self as the unresolved address which the inline
308   // cache code (and relocs) know about
< prev index next >