1614 if (ConstantsALot) {
1615 const int num_consts = const_size();
1616 for (int i = 0; i < num_consts; i++) {
1617 __ long_constant(0xB0B5B00BBABE);
1618 }
1619 }
1620 #endif
1621 if (!method_is_frameless) {
1622 // Save return pc.
1623 __ std(return_pc, _abi0(lr), callers_sp);
1624 }
1625
1626 if (C->stub_function() == nullptr) {
1627 BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
1628 bs->nmethod_entry_barrier(masm, push_frame_temp);
1629 }
1630
1631 C->output()->set_frame_complete(__ offset());
1632 }
1633
1634 uint MachPrologNode::size(PhaseRegAlloc *ra_) const {
1635 // Variable size. determine dynamically.
1636 return MachNode::size(ra_);
1637 }
1638
1639 int MachPrologNode::reloc() const {
1640 // Return number of relocatable values contained in this instruction.
1641 return 1; // 1 reloc entry for load_const(toc).
1642 }
1643
1644 //=============================================================================
1645
1646 #ifndef PRODUCT
1647 void MachEpilogNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
1648 Compile* C = ra_->C;
1649
1650 st->print("EPILOG\n\t");
1651 st->print("restore return pc\n\t");
1652 st->print("pop frame\n\t");
1653
1654 if (do_polling() && C->is_method_compilation()) {
1655 st->print("safepoint poll\n\t");
1656 }
1657 }
1658 #endif
1677 __ addi(R1_SP, R1_SP, (int)framesize);
1678 }
1679
1680 if (StackReservedPages > 0 && C->has_reserved_stack_access()) {
1681 __ reserved_stack_check(return_pc);
1682 }
1683
1684 if (method_needs_polling) {
1685 Label dummy_label;
1686 Label* code_stub = &dummy_label;
1687 if (!UseSIGTRAP && !C->output()->in_scratch_emit_size()) {
1688 C2SafepointPollStub* stub = new (C->comp_arena()) C2SafepointPollStub(__ offset());
1689 C->output()->add_stub(stub);
1690 code_stub = &stub->entry();
1691 __ relocate(relocInfo::poll_return_type);
1692 }
1693 __ safepoint_poll(*code_stub, temp, true /* at_return */, true /* in_nmethod */);
1694 }
1695 }
1696
1697 uint MachEpilogNode::size(PhaseRegAlloc *ra_) const {
1698 // Variable size. Determine dynamically.
1699 return MachNode::size(ra_);
1700 }
1701
1702 int MachEpilogNode::reloc() const {
1703 // Return number of relocatable values contained in this instruction.
1704 return 1; // 1 for load_from_polling_page.
1705 }
1706
1707 const Pipeline * MachEpilogNode::pipeline() const {
1708 return MachNode::pipeline_class();
1709 }
1710
1711 // =============================================================================
1712
1713 // Figure out which register class each belongs in: rc_int, rc_float, rc_vec or
1714 // rc_stack.
1715 enum RC { rc_bad, rc_int, rc_float, rc_vec, rc_stack };
1716
1717 static enum RC rc_class(OptoReg::Name reg) {
1718 // Return the register class for the given register. The given register
1719 // reg is a <register>_num value, which is an index into the MachRegisterNumbers
1720 // enumeration in adGlobals_ppc.hpp.
1721
2031 st->print("ADDI %s, SP, %d \t// box node", reg_str, offset);
2032 }
2033 #endif
2034
2035 void BoxLockNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const {
2036 int offset = ra_->reg2offset(in_RegMask(0).find_first_elem());
2037 int reg = ra_->get_encode(this);
2038
2039 if (Assembler::is_simm(offset, 16)) {
2040 __ addi(as_Register(reg), R1, offset);
2041 } else {
2042 ShouldNotReachHere();
2043 }
2044 }
2045
2046 uint BoxLockNode::size(PhaseRegAlloc *ra_) const {
2047 // BoxLockNode is not a MachNode, so we can't just call MachNode::size(ra_).
2048 return 4;
2049 }
2050
2051 #ifndef PRODUCT
2052 void MachUEPNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
2053 st->print_cr("---- MachUEPNode ----");
2054 st->print_cr("...");
2055 }
2056 #endif
2057
2058 void MachUEPNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const {
2059 // This is the unverified entry point.
2060 __ ic_check(CodeEntryAlignment);
2061 // Argument is valid and klass is as expected, continue.
2062 }
2063
2064 uint MachUEPNode::size(PhaseRegAlloc *ra_) const {
2065 // Variable size. Determine dynamically.
2066 return MachNode::size(ra_);
2067 }
2068
2069 //=============================================================================
2070
2071 %} // interrupt source
2072
2073 source_hpp %{ // Header information of the source block.
2074
2075 class HandlerImpl {
2076
2077 public:
2078
2079 static int emit_deopt_handler(C2_MacroAssembler* masm);
2080
2081 static uint size_deopt_handler() {
2082 // The deopt_handler is a bl64_patchable.
2083 return MacroAssembler::bl64_patchable_size + BytesPerInstWord;
2084 }
2085
2086 };
2087
2088 class Node::PD {
|
1614 if (ConstantsALot) {
1615 const int num_consts = const_size();
1616 for (int i = 0; i < num_consts; i++) {
1617 __ long_constant(0xB0B5B00BBABE);
1618 }
1619 }
1620 #endif
1621 if (!method_is_frameless) {
1622 // Save return pc.
1623 __ std(return_pc, _abi0(lr), callers_sp);
1624 }
1625
1626 if (C->stub_function() == nullptr) {
1627 BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
1628 bs->nmethod_entry_barrier(masm, push_frame_temp);
1629 }
1630
1631 C->output()->set_frame_complete(__ offset());
1632 }
1633
1634 int MachPrologNode::reloc() const {
1635 // Return number of relocatable values contained in this instruction.
1636 return 1; // 1 reloc entry for load_const(toc).
1637 }
1638
1639 //=============================================================================
1640
1641 #ifndef PRODUCT
1642 void MachEpilogNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
1643 Compile* C = ra_->C;
1644
1645 st->print("EPILOG\n\t");
1646 st->print("restore return pc\n\t");
1647 st->print("pop frame\n\t");
1648
1649 if (do_polling() && C->is_method_compilation()) {
1650 st->print("safepoint poll\n\t");
1651 }
1652 }
1653 #endif
1672 __ addi(R1_SP, R1_SP, (int)framesize);
1673 }
1674
1675 if (StackReservedPages > 0 && C->has_reserved_stack_access()) {
1676 __ reserved_stack_check(return_pc);
1677 }
1678
1679 if (method_needs_polling) {
1680 Label dummy_label;
1681 Label* code_stub = &dummy_label;
1682 if (!UseSIGTRAP && !C->output()->in_scratch_emit_size()) {
1683 C2SafepointPollStub* stub = new (C->comp_arena()) C2SafepointPollStub(__ offset());
1684 C->output()->add_stub(stub);
1685 code_stub = &stub->entry();
1686 __ relocate(relocInfo::poll_return_type);
1687 }
1688 __ safepoint_poll(*code_stub, temp, true /* at_return */, true /* in_nmethod */);
1689 }
1690 }
1691
1692 int MachEpilogNode::reloc() const {
1693 // Return number of relocatable values contained in this instruction.
1694 return 1; // 1 for load_from_polling_page.
1695 }
1696
1697 const Pipeline * MachEpilogNode::pipeline() const {
1698 return MachNode::pipeline_class();
1699 }
1700
1701 // =============================================================================
1702
1703 // Figure out which register class each belongs in: rc_int, rc_float, rc_vec or
1704 // rc_stack.
1705 enum RC { rc_bad, rc_int, rc_float, rc_vec, rc_stack };
1706
1707 static enum RC rc_class(OptoReg::Name reg) {
1708 // Return the register class for the given register. The given register
1709 // reg is a <register>_num value, which is an index into the MachRegisterNumbers
1710 // enumeration in adGlobals_ppc.hpp.
1711
2021 st->print("ADDI %s, SP, %d \t// box node", reg_str, offset);
2022 }
2023 #endif
2024
2025 void BoxLockNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const {
2026 int offset = ra_->reg2offset(in_RegMask(0).find_first_elem());
2027 int reg = ra_->get_encode(this);
2028
2029 if (Assembler::is_simm(offset, 16)) {
2030 __ addi(as_Register(reg), R1, offset);
2031 } else {
2032 ShouldNotReachHere();
2033 }
2034 }
2035
2036 uint BoxLockNode::size(PhaseRegAlloc *ra_) const {
2037 // BoxLockNode is not a MachNode, so we can't just call MachNode::size(ra_).
2038 return 4;
2039 }
2040
2041 #ifndef PRODUCT
2042 void MachVEPNode::format(PhaseRegAlloc* ra_, outputStream* st) const
2043 {
2044 Unimplemented();
2045 }
2046 #endif
2047
2048 void MachVEPNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc* ra_) const
2049 {
2050 Unimplemented();
2051 }
2052
2053 #ifndef PRODUCT
2054 void MachUEPNode::format(PhaseRegAlloc *ra_, outputStream *st) const {
2055 st->print_cr("---- MachUEPNode ----");
2056 st->print_cr("...");
2057 }
2058 #endif
2059
2060 void MachUEPNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const {
2061 // This is the unverified entry point.
2062 __ ic_check(CodeEntryAlignment);
2063 // Argument is valid and klass is as expected, continue.
2064 }
2065
2066 //=============================================================================
2067
2068 %} // interrupt source
2069
2070 source_hpp %{ // Header information of the source block.
2071
2072 class HandlerImpl {
2073
2074 public:
2075
2076 static int emit_deopt_handler(C2_MacroAssembler* masm);
2077
2078 static uint size_deopt_handler() {
2079 // The deopt_handler is a bl64_patchable.
2080 return MacroAssembler::bl64_patchable_size + BytesPerInstWord;
2081 }
2082
2083 };
2084
2085 class Node::PD {
|