< prev index next >

src/cpu/ppc/vm/macroAssembler_ppc.cpp

Print this page
rev 9050 : 8139421: PPC64LE: MacroAssembler::bxx64_patchable kill register R12
Summary: Register R12 must be preserved for stub calls (e.g. deopt handler).
Reviewed-by:


 577       bl(dest, relocInfo::none);
 578     } else {
 579       // do the jump
 580       assert(pc() == pc_of_b, "just checking");
 581       b(dest, relocInfo::none);
 582 
 583       // some padding
 584       nop();
 585       nop();
 586       nop();
 587       nop();
 588       nop();
 589       nop();
 590     }
 591 
 592     // Assert that we can identify the emitted call/jump.
 593     assert(is_bxx64_patchable_variant2_at((address)start_pc, link),
 594            "can't identify emitted call");
 595   } else {
 596     // variant 1:
 597 #if defined(ABI_ELFv2)
 598     nop();
 599     calculate_address_from_global_toc(R12, dest, true, true, false);
 600     mtctr(R12);
 601     nop();
 602     nop();
 603 #else
 604     mr(R0, R11);  // spill R11 -> R0.
 605 
 606     // Load the destination address into CTR,
 607     // calculate destination relative to global toc.
 608     calculate_address_from_global_toc(R11, dest, true, true, false);
 609 
 610     mtctr(R11);
 611     mr(R11, R0);  // spill R11 <- R0.
 612     nop();
 613 #endif
 614 
 615     // do the call/jump
 616     if (link) {
 617       bctrl();
 618     } else{
 619       bctr();
 620     }
 621     // Assert that we can identify the emitted call/jump.
 622     assert(is_bxx64_patchable_variant1b_at((address)start_pc, link),
 623            "can't identify emitted call");
 624   }
 625 
 626   // Assert that we can identify the emitted call/jump.
 627   assert(is_bxx64_patchable_at((address)start_pc, link),
 628          "can't identify emitted call");
 629   assert(get_dest_of_bxx64_patchable_at((address)start_pc, link) == dest,
 630          "wrong encoding of dest address");
 631 }
 632 
 633 // Identify a bxx64_patchable instruction.




 577       bl(dest, relocInfo::none);
 578     } else {
 579       // do the jump
 580       assert(pc() == pc_of_b, "just checking");
 581       b(dest, relocInfo::none);
 582 
 583       // some padding
 584       nop();
 585       nop();
 586       nop();
 587       nop();
 588       nop();
 589       nop();
 590     }
 591 
 592     // Assert that we can identify the emitted call/jump.
 593     assert(is_bxx64_patchable_variant2_at((address)start_pc, link),
 594            "can't identify emitted call");
 595   } else {
 596     // variant 1:







 597     mr(R0, R11);  // spill R11 -> R0.
 598 
 599     // Load the destination address into CTR,
 600     // calculate destination relative to global toc.
 601     calculate_address_from_global_toc(R11, dest, true, true, false);
 602 
 603     mtctr(R11);
 604     mr(R11, R0);  // spill R11 <- R0.
 605     nop();

 606 
 607     // do the call/jump
 608     if (link) {
 609       bctrl();
 610     } else{
 611       bctr();
 612     }
 613     // Assert that we can identify the emitted call/jump.
 614     assert(is_bxx64_patchable_variant1b_at((address)start_pc, link),
 615            "can't identify emitted call");
 616   }
 617 
 618   // Assert that we can identify the emitted call/jump.
 619   assert(is_bxx64_patchable_at((address)start_pc, link),
 620          "can't identify emitted call");
 621   assert(get_dest_of_bxx64_patchable_at((address)start_pc, link) == dest,
 622          "wrong encoding of dest address");
 623 }
 624 
 625 // Identify a bxx64_patchable instruction.


< prev index next >