965 // This is a block of C++ code which provides values, functions, and
966 // definitions necessary in the rest of the architecture description.
967 source_hpp %{
968 // Header information of the source block.
969 // Method declarations/definitions which are used outside
970 // the ad-scope can conveniently be defined here.
971 //
972 // To keep related declarations/definitions/uses close together,
973 // we switch between source %{ }% and source_hpp %{ }% freely as needed.
974
975 #include "opto/convertnode.hpp"
976
977 // Returns true if Node n is followed by a MemBar node that
978 // will do an acquire. If so, this node must not do the acquire
979 // operation.
980 bool followed_by_acquire(const Node *n);
981 %}
982
983 source %{
984
985 #include "oops/klass.inline.hpp"
986
987 void PhaseOutput::pd_perform_mach_node_analysis() {
988 }
989
990 int MachNode::pd_alignment_required() const {
991 return 1;
992 }
993
994 int MachNode::compute_padding(int current_offset) const {
995 return 0;
996 }
997
998 // Should the matcher clone input 'm' of node 'n'?
999 bool Matcher::pd_clone_node(Node* n, Node* m, Matcher::MStack& mstack) {
1000 return false;
1001 }
1002
1003 // Should the Matcher clone shifts on addressing modes, expecting them
1004 // to be subsumed into complex addressing expressions or compute them
1604 const Register return_pc = R31; // Must survive C-call to enable_stack_reserved_zone().
1605 const Register temp = R12;
1606
1607 if (!method_is_frameless) {
1608 // Restore return pc relative to callers' sp.
1609 __ ld(return_pc, ((int)framesize) + _abi0(lr), R1_SP);
1610 // Move return pc to LR.
1611 __ mtlr(return_pc);
1612 // Pop frame (fixed frame-size).
1613 __ addi(R1_SP, R1_SP, (int)framesize);
1614 }
1615
1616 if (StackReservedPages > 0 && C->has_reserved_stack_access()) {
1617 __ reserved_stack_check(return_pc);
1618 }
1619
1620 if (method_needs_polling) {
1621 Label dummy_label;
1622 Label* code_stub = &dummy_label;
1623 if (!UseSIGTRAP && !C->output()->in_scratch_emit_size()) {
1624 code_stub = &C->output()->safepoint_poll_table()->add_safepoint(__ offset());
1625 __ relocate(relocInfo::poll_return_type);
1626 }
1627 __ safepoint_poll(*code_stub, temp, true /* at_return */, true /* in_nmethod */);
1628 }
1629 }
1630
1631 uint MachEpilogNode::size(PhaseRegAlloc *ra_) const {
1632 // Variable size. Determine dynamically.
1633 return MachNode::size(ra_);
1634 }
1635
1636 int MachEpilogNode::reloc() const {
1637 // Return number of relocatable values contained in this instruction.
1638 return 1; // 1 for load_from_polling_page.
1639 }
1640
1641 const Pipeline * MachEpilogNode::pipeline() const {
1642 return MachNode::pipeline_class();
1643 }
1644
|
965 // This is a block of C++ code which provides values, functions, and
966 // definitions necessary in the rest of the architecture description.
967 source_hpp %{
968 // Header information of the source block.
969 // Method declarations/definitions which are used outside
970 // the ad-scope can conveniently be defined here.
971 //
972 // To keep related declarations/definitions/uses close together,
973 // we switch between source %{ }% and source_hpp %{ }% freely as needed.
974
975 #include "opto/convertnode.hpp"
976
977 // Returns true if Node n is followed by a MemBar node that
978 // will do an acquire. If so, this node must not do the acquire
979 // operation.
980 bool followed_by_acquire(const Node *n);
981 %}
982
983 source %{
984
985 #include "opto/c2_CodeStubs.hpp"
986 #include "oops/klass.inline.hpp"
987
988 void PhaseOutput::pd_perform_mach_node_analysis() {
989 }
990
991 int MachNode::pd_alignment_required() const {
992 return 1;
993 }
994
995 int MachNode::compute_padding(int current_offset) const {
996 return 0;
997 }
998
999 // Should the matcher clone input 'm' of node 'n'?
1000 bool Matcher::pd_clone_node(Node* n, Node* m, Matcher::MStack& mstack) {
1001 return false;
1002 }
1003
1004 // Should the Matcher clone shifts on addressing modes, expecting them
1005 // to be subsumed into complex addressing expressions or compute them
1605 const Register return_pc = R31; // Must survive C-call to enable_stack_reserved_zone().
1606 const Register temp = R12;
1607
1608 if (!method_is_frameless) {
1609 // Restore return pc relative to callers' sp.
1610 __ ld(return_pc, ((int)framesize) + _abi0(lr), R1_SP);
1611 // Move return pc to LR.
1612 __ mtlr(return_pc);
1613 // Pop frame (fixed frame-size).
1614 __ addi(R1_SP, R1_SP, (int)framesize);
1615 }
1616
1617 if (StackReservedPages > 0 && C->has_reserved_stack_access()) {
1618 __ reserved_stack_check(return_pc);
1619 }
1620
1621 if (method_needs_polling) {
1622 Label dummy_label;
1623 Label* code_stub = &dummy_label;
1624 if (!UseSIGTRAP && !C->output()->in_scratch_emit_size()) {
1625 C2SafepointPollStub* stub = new (C->comp_arena()) C2SafepointPollStub(__ offset());
1626 C->output()->add_stub(stub);
1627 code_stub = &stub->entry();
1628 __ relocate(relocInfo::poll_return_type);
1629 }
1630 __ safepoint_poll(*code_stub, temp, true /* at_return */, true /* in_nmethod */);
1631 }
1632 }
1633
1634 uint MachEpilogNode::size(PhaseRegAlloc *ra_) const {
1635 // Variable size. Determine dynamically.
1636 return MachNode::size(ra_);
1637 }
1638
1639 int MachEpilogNode::reloc() const {
1640 // Return number of relocatable values contained in this instruction.
1641 return 1; // 1 for load_from_polling_page.
1642 }
1643
1644 const Pipeline * MachEpilogNode::pipeline() const {
1645 return MachNode::pipeline_class();
1646 }
1647
|