239 set_word_at(MacroAssembler::call_far_pcrelative_size() - 4, Assembler::z_pcrel_off(dest, iaddr));
240 } else {
241 assert(MacroAssembler::is_load_const_from_toc(instruction_address()), "unsupported instruction");
242 nativeMovConstReg_at(instruction_address())->set_data(((intptr_t)dest));
243 }
244 }
245
246 //-----------------------------
247 // N a t i v e F a r C a l l
248 //-----------------------------
249
250 void NativeFarCall::verify() {
251 NativeInstruction::verify();
252 if (NativeFarCall::is_far_call_at(addr_at(0))) return;
253 fatal("not a NativeFarCall");
254 }
255
256 address NativeFarCall::destination() {
257 assert(MacroAssembler::is_call_far_patchable_at((address)this), "unexpected call type");
258 address ctable = NULL;
259 if (MacroAssembler::call_far_patchable_requires_alignment_nop((address)this)) {
260 return MacroAssembler::get_dest_of_call_far_patchable_at(((address)this)+MacroAssembler::nop_size(), ctable);
261 } else {
262 return MacroAssembler::get_dest_of_call_far_patchable_at((address)this, ctable);
263 }
264 }
265
266
267 // Handles both patterns of patchable far calls.
268 void NativeFarCall::set_destination(address dest, int toc_offset) {
269 address inst_addr = (address)this;
270
271 // Set new destination (implementation of call may change here).
272 assert(MacroAssembler::is_call_far_patchable_at(inst_addr), "unexpected call type");
273
274 if (!MacroAssembler::is_call_far_patchable_pcrelative_at(inst_addr)) {
275 address ctable = CodeCache::find_blob(inst_addr)->ctable_begin();
276 // Need distance of TOC entry from current instruction.
277 toc_offset = (ctable + toc_offset) - inst_addr;
278 // Call is via constant table entry.
279 MacroAssembler::set_dest_of_call_far_patchable_at(inst_addr, dest, toc_offset);
280 } else {
281 // Here, we have a pc-relative call (brasl).
282 // Be aware: dest may have moved in this case, so really patch the displacement,
283 // when necessary!
604 tty->print_cr("NativeMovRegMem::verify(): verifying addr " PTR_FORMAT, p2i(l1));
605 tty->cr();
606 ((NativeMovRegMem*)l1)->dump(64, "NativeMovConstReg::verify()");
607 fatal("this is not a `NativeMovRegMem' site");
608 }
609
610 unsigned long inst1;
611 Assembler::get_instruction(l2, &inst1);
612
613 if (!Assembler::is_z_lb(inst1) &&
614 !Assembler::is_z_llgh(inst1) &&
615 !Assembler::is_z_lh(inst1) &&
616 !Assembler::is_z_l(inst1) &&
617 !Assembler::is_z_llgf(inst1) &&
618 !Assembler::is_z_lg(inst1) &&
619 !Assembler::is_z_le(inst1) &&
620 !Assembler::is_z_ld(inst1) &&
621 !Assembler::is_z_stc(inst1) &&
622 !Assembler::is_z_sth(inst1) &&
623 !Assembler::is_z_st(inst1) &&
624 !(Assembler::is_z_lgr(inst1) && UseCompressedOops) &&
625 !Assembler::is_z_stg(inst1) &&
626 !Assembler::is_z_ste(inst1) &&
627 !Assembler::is_z_std(inst1)) {
628 tty->cr();
629 tty->print_cr("NativeMovRegMem::verify(): verifying addr " PTR_FORMAT
630 ": wrong or missing load or store at " PTR_FORMAT, p2i(l1), p2i(l2));
631 tty->cr();
632 ((NativeMovRegMem*)l1)->dump(64, "NativeMovConstReg::verify()");
633 fatal("this is not a `NativeMovRegMem' site");
634 }
635 }
636 #endif // COMPILER1
637
638 //-----------------------
639 // N a t i v e J u m p
640 //-----------------------
641
642 void NativeJump::verify() {
643 if (NativeJump::is_jump_at(addr_at(0))) return;
644 fatal("this is not a `NativeJump' site");
|
239 set_word_at(MacroAssembler::call_far_pcrelative_size() - 4, Assembler::z_pcrel_off(dest, iaddr));
240 } else {
241 assert(MacroAssembler::is_load_const_from_toc(instruction_address()), "unsupported instruction");
242 nativeMovConstReg_at(instruction_address())->set_data(((intptr_t)dest));
243 }
244 }
245
246 //-----------------------------
247 // N a t i v e F a r C a l l
248 //-----------------------------
249
250 void NativeFarCall::verify() {
251 NativeInstruction::verify();
252 if (NativeFarCall::is_far_call_at(addr_at(0))) return;
253 fatal("not a NativeFarCall");
254 }
255
256 address NativeFarCall::destination() {
257 assert(MacroAssembler::is_call_far_patchable_at((address)this), "unexpected call type");
258 address ctable = NULL;
259 return MacroAssembler::get_dest_of_call_far_patchable_at((address)this, ctable);
260 }
261
262
263 // Handles both patterns of patchable far calls.
264 void NativeFarCall::set_destination(address dest, int toc_offset) {
265 address inst_addr = (address)this;
266
267 // Set new destination (implementation of call may change here).
268 assert(MacroAssembler::is_call_far_patchable_at(inst_addr), "unexpected call type");
269
270 if (!MacroAssembler::is_call_far_patchable_pcrelative_at(inst_addr)) {
271 address ctable = CodeCache::find_blob(inst_addr)->ctable_begin();
272 // Need distance of TOC entry from current instruction.
273 toc_offset = (ctable + toc_offset) - inst_addr;
274 // Call is via constant table entry.
275 MacroAssembler::set_dest_of_call_far_patchable_at(inst_addr, dest, toc_offset);
276 } else {
277 // Here, we have a pc-relative call (brasl).
278 // Be aware: dest may have moved in this case, so really patch the displacement,
279 // when necessary!
600 tty->print_cr("NativeMovRegMem::verify(): verifying addr " PTR_FORMAT, p2i(l1));
601 tty->cr();
602 ((NativeMovRegMem*)l1)->dump(64, "NativeMovConstReg::verify()");
603 fatal("this is not a `NativeMovRegMem' site");
604 }
605
606 unsigned long inst1;
607 Assembler::get_instruction(l2, &inst1);
608
609 if (!Assembler::is_z_lb(inst1) &&
610 !Assembler::is_z_llgh(inst1) &&
611 !Assembler::is_z_lh(inst1) &&
612 !Assembler::is_z_l(inst1) &&
613 !Assembler::is_z_llgf(inst1) &&
614 !Assembler::is_z_lg(inst1) &&
615 !Assembler::is_z_le(inst1) &&
616 !Assembler::is_z_ld(inst1) &&
617 !Assembler::is_z_stc(inst1) &&
618 !Assembler::is_z_sth(inst1) &&
619 !Assembler::is_z_st(inst1) &&
620 !UseCompressedOops &&
621 !Assembler::is_z_stg(inst1) &&
622 !Assembler::is_z_ste(inst1) &&
623 !Assembler::is_z_std(inst1)) {
624 tty->cr();
625 tty->print_cr("NativeMovRegMem::verify(): verifying addr " PTR_FORMAT
626 ": wrong or missing load or store at " PTR_FORMAT, p2i(l1), p2i(l2));
627 tty->cr();
628 ((NativeMovRegMem*)l1)->dump(64, "NativeMovConstReg::verify()");
629 fatal("this is not a `NativeMovRegMem' site");
630 }
631 }
632 #endif // COMPILER1
633
634 //-----------------------
635 // N a t i v e J u m p
636 //-----------------------
637
638 void NativeJump::verify() {
639 if (NativeJump::is_jump_at(addr_at(0))) return;
640 fatal("this is not a `NativeJump' site");
|