1170 __ save_return_pc();
1171
1172 // The z/Architecture abi is already accounted for in `framesize' via the
1173 // 'out_preserve_stack_slots' declaration.
1174 __ push_frame((unsigned int)framesize/*includes JIT ABI*/);
1175
1176 if (C->has_mach_constant_base_node()) {
1177 // NOTE: We set the table base offset here because users might be
1178 // emitted before MachConstantBaseNode.
1179 ConstantTable& constant_table = C->output()->constant_table();
1180 constant_table.set_table_base_offset(constant_table.calculate_table_base_offset());
1181 }
1182
1183 if (C->stub_function() == nullptr) {
1184 BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
1185 bs->nmethod_entry_barrier(masm);
1186 }
1187
1188 C->output()->set_frame_complete(__ offset());
1189 }
1190
1191 uint MachPrologNode::size(PhaseRegAlloc *ra_) const {
1192 // Variable size. Determine dynamically.
1193 return MachNode::size(ra_);
1194 }
1195
1196 int MachPrologNode::reloc() const {
1197 // Return number of relocatable values contained in this instruction.
1198 return 1; // One reloc entry for load_const(toc).
1199 }
1200
1201 //=============================================================================
1202
1203 #if !defined(PRODUCT)
1204 void MachEpilogNode::format(PhaseRegAlloc *ra_, outputStream *os) const {
1205 os->print_cr("epilog");
1206 os->print("\t");
1207 if (do_polling() && ra_->C->is_method_compilation()) {
1208 os->print_cr("load_from_polling_page Z_R1_scratch");
1209 os->print("\t");
1210 }
1211 }
1212 #endif
1213
1214 void MachEpilogNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const {
1215 Compile* C = ra_->C;
1218 bool need_polling = do_polling() && C->is_method_compilation();
1219
1220 // Pop frame, restore return_pc, and all stuff needed by interpreter.
1221 int frame_size_in_bytes = Assembler::align((C->output()->frame_slots() << LogBytesPerInt), frame::alignment_in_bytes);
1222 __ pop_frame_restore_retPC(frame_size_in_bytes);
1223
1224 if (StackReservedPages > 0 && C->has_reserved_stack_access()) {
1225 __ reserved_stack_check(Z_R14);
1226 }
1227
1228 // Touch the polling page.
1229 if (need_polling) {
1230 __ z_lg(Z_R1_scratch, Address(Z_thread, JavaThread::polling_page_offset()));
1231 // We need to mark the code position where the load from the safepoint
1232 // polling page was emitted as relocInfo::poll_return_type here.
1233 __ relocate(relocInfo::poll_return_type);
1234 __ load_from_polling_page(Z_R1_scratch);
1235 }
1236 }
1237
1238 uint MachEpilogNode::size(PhaseRegAlloc *ra_) const {
1239 // Variable size. determine dynamically.
1240 return MachNode::size(ra_);
1241 }
1242
1243 int MachEpilogNode::reloc() const {
1244 // Return number of relocatable values contained in this instruction.
1245 return 1; // One for load_from_polling_page.
1246 }
1247
1248 const Pipeline * MachEpilogNode::pipeline() const {
1249 return MachNode::pipeline_class();
1250 }
1251
1252 //=============================================================================
1253
1254 // Figure out which register class each belongs in: rc_int, rc_float, rc_vector, rc_stack.
1255 enum RC { rc_bad, rc_int, rc_float, rc_vector, rc_stack };
1256
1257 static enum RC rc_class(OptoReg::Name reg) {
1258 // Return the register class for the given register. The given register
1259 // reg is a <register>_num value, which is an index into the MachRegisterNumbers
1260 // enumeration in adGlobals_s390.hpp.
1261
1262 if (reg == OptoReg::Bad) {
1627 class CallStubImpl {
1628 public:
1629
1630 // call trampolines
1631 // Size of call trampoline stub. For add'l comments, see size_java_to_interp().
1632 static uint size_call_trampoline() {
1633 return 0; // no call trampolines on this platform
1634 }
1635
1636 // call trampolines
1637 // Number of relocations needed by a call trampoline stub.
1638 static uint reloc_call_trampoline() {
1639 return 0; // No call trampolines on this platform.
1640 }
1641 };
1642
1643 %} // end source_hpp section
1644
1645 source %{
1646
1647 #if !defined(PRODUCT)
1648 void MachUEPNode::format(PhaseRegAlloc *ra_, outputStream *os) const {
1649 os->print_cr("---- MachUEPNode ----");
1650 os->print_cr("\tTA");
1651 os->print_cr("\tload_const Z_R1, SharedRuntime::get_ic_miss_stub()");
1652 os->print_cr("\tBR(Z_R1)");
1653 os->print_cr("\tTA # pad with illtraps");
1654 os->print_cr("\t...");
1655 os->print_cr("\tTA");
1656 os->print_cr("\tLTGR Z_R2, Z_R2");
1657 os->print_cr("\tBRU ic_miss");
1658 }
1659 #endif
1660
1661 void MachUEPNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const {
1662 // This is Unverified Entry Point
1663 __ ic_check(CodeEntryAlignment);
1664 }
1665
1666 uint MachUEPNode::size(PhaseRegAlloc *ra_) const {
1667 // Determine size dynamically.
1668 return MachNode::size(ra_);
1669 }
1670
1671 //=============================================================================
1672
1673 %} // interrupt source section
1674
1675 source_hpp %{ // Header information of the source block.
1676
1677 class HandlerImpl {
1678 public:
1679
1680 static int emit_deopt_handler(C2_MacroAssembler* masm);
1681
1682 static uint size_deopt_handler() {
1683 return NativeCall::max_instruction_size() + MacroAssembler::jump_pcrelative_size();
1684 }
1685 };
1686
1687 class Node::PD {
1688 public:
1689 enum NodeFlags {
1690 _last_flag = Node::_last_flag
|
1170 __ save_return_pc();
1171
1172 // The z/Architecture abi is already accounted for in `framesize' via the
1173 // 'out_preserve_stack_slots' declaration.
1174 __ push_frame((unsigned int)framesize/*includes JIT ABI*/);
1175
1176 if (C->has_mach_constant_base_node()) {
1177 // NOTE: We set the table base offset here because users might be
1178 // emitted before MachConstantBaseNode.
1179 ConstantTable& constant_table = C->output()->constant_table();
1180 constant_table.set_table_base_offset(constant_table.calculate_table_base_offset());
1181 }
1182
1183 if (C->stub_function() == nullptr) {
1184 BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
1185 bs->nmethod_entry_barrier(masm);
1186 }
1187
1188 C->output()->set_frame_complete(__ offset());
1189 }
1190 int MachPrologNode::reloc() const {
1191 // Return number of relocatable values contained in this instruction.
1192 return 1; // One reloc entry for load_const(toc).
1193 }
1194
1195 //=============================================================================
1196
1197 #if !defined(PRODUCT)
1198 void MachEpilogNode::format(PhaseRegAlloc *ra_, outputStream *os) const {
1199 os->print_cr("epilog");
1200 os->print("\t");
1201 if (do_polling() && ra_->C->is_method_compilation()) {
1202 os->print_cr("load_from_polling_page Z_R1_scratch");
1203 os->print("\t");
1204 }
1205 }
1206 #endif
1207
1208 void MachEpilogNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const {
1209 Compile* C = ra_->C;
1212 bool need_polling = do_polling() && C->is_method_compilation();
1213
1214 // Pop frame, restore return_pc, and all stuff needed by interpreter.
1215 int frame_size_in_bytes = Assembler::align((C->output()->frame_slots() << LogBytesPerInt), frame::alignment_in_bytes);
1216 __ pop_frame_restore_retPC(frame_size_in_bytes);
1217
1218 if (StackReservedPages > 0 && C->has_reserved_stack_access()) {
1219 __ reserved_stack_check(Z_R14);
1220 }
1221
1222 // Touch the polling page.
1223 if (need_polling) {
1224 __ z_lg(Z_R1_scratch, Address(Z_thread, JavaThread::polling_page_offset()));
1225 // We need to mark the code position where the load from the safepoint
1226 // polling page was emitted as relocInfo::poll_return_type here.
1227 __ relocate(relocInfo::poll_return_type);
1228 __ load_from_polling_page(Z_R1_scratch);
1229 }
1230 }
1231
1232 int MachEpilogNode::reloc() const {
1233 // Return number of relocatable values contained in this instruction.
1234 return 1; // One for load_from_polling_page.
1235 }
1236
1237 const Pipeline * MachEpilogNode::pipeline() const {
1238 return MachNode::pipeline_class();
1239 }
1240
1241 //=============================================================================
1242
1243 // Figure out which register class each belongs in: rc_int, rc_float, rc_vector, rc_stack.
1244 enum RC { rc_bad, rc_int, rc_float, rc_vector, rc_stack };
1245
1246 static enum RC rc_class(OptoReg::Name reg) {
1247 // Return the register class for the given register. The given register
1248 // reg is a <register>_num value, which is an index into the MachRegisterNumbers
1249 // enumeration in adGlobals_s390.hpp.
1250
1251 if (reg == OptoReg::Bad) {
1616 class CallStubImpl {
1617 public:
1618
1619 // call trampolines
1620 // Size of call trampoline stub. For add'l comments, see size_java_to_interp().
1621 static uint size_call_trampoline() {
1622 return 0; // no call trampolines on this platform
1623 }
1624
1625 // call trampolines
1626 // Number of relocations needed by a call trampoline stub.
1627 static uint reloc_call_trampoline() {
1628 return 0; // No call trampolines on this platform.
1629 }
1630 };
1631
1632 %} // end source_hpp section
1633
1634 source %{
1635
1636 #ifndef PRODUCT
1637 void MachVEPNode::format(PhaseRegAlloc* ra_, outputStream* st) const
1638 {
1639 Unimplemented();
1640 }
1641 #endif
1642
1643 void MachVEPNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc* ra_) const
1644 {
1645 Unimplemented();
1646 }
1647
1648 #if !defined(PRODUCT)
1649 void MachUEPNode::format(PhaseRegAlloc *ra_, outputStream *os) const {
1650 os->print_cr("---- MachUEPNode ----");
1651 os->print_cr("\tTA");
1652 os->print_cr("\tload_const Z_R1, SharedRuntime::get_ic_miss_stub()");
1653 os->print_cr("\tBR(Z_R1)");
1654 os->print_cr("\tTA # pad with illtraps");
1655 os->print_cr("\t...");
1656 os->print_cr("\tTA");
1657 os->print_cr("\tLTGR Z_R2, Z_R2");
1658 os->print_cr("\tBRU ic_miss");
1659 }
1660 #endif
1661
1662 void MachUEPNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const {
1663 // This is Unverified Entry Point
1664 __ ic_check(CodeEntryAlignment);
1665 }
1666
1667 //=============================================================================
1668
1669 %} // interrupt source section
1670
1671 source_hpp %{ // Header information of the source block.
1672
1673 class HandlerImpl {
1674 public:
1675
1676 static int emit_deopt_handler(C2_MacroAssembler* masm);
1677
1678 static uint size_deopt_handler() {
1679 return NativeCall::max_instruction_size() + MacroAssembler::jump_pcrelative_size();
1680 }
1681 };
1682
1683 class Node::PD {
1684 public:
1685 enum NodeFlags {
1686 _last_flag = Node::_last_flag
|