< prev index next >

src/hotspot/cpu/s390/s390.ad

Print this page

 1142   __ save_return_pc();
 1143 
 1144   // The z/Architecture abi is already accounted for in `framesize' via the
 1145   // 'out_preserve_stack_slots' declaration.
 1146   __ push_frame((unsigned int)framesize/*includes JIT ABI*/);
 1147 
 1148   if (C->has_mach_constant_base_node()) {
 1149     // NOTE: We set the table base offset here because users might be
 1150     // emitted before MachConstantBaseNode.
 1151     ConstantTable& constant_table = C->output()->constant_table();
 1152     constant_table.set_table_base_offset(constant_table.calculate_table_base_offset());
 1153   }
 1154 
 1155   if (C->stub_function() == nullptr) {
 1156     BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
 1157     bs->nmethod_entry_barrier(masm);
 1158   }
 1159 
 1160   C->output()->set_frame_complete(__ offset());
 1161 }
 1162 
 1163 uint MachPrologNode::size(PhaseRegAlloc *ra_) const {
 1164   // Variable size. Determine dynamically.
 1165   return MachNode::size(ra_);
 1166 }
 1167 
 1168 int MachPrologNode::reloc() const {
 1169   // Return number of relocatable values contained in this instruction.
 1170   return 1; // One reloc entry for load_const(toc).
 1171 }
 1172 
 1173 //=============================================================================
 1174 
 1175 #if !defined(PRODUCT)
 1176 void MachEpilogNode::format(PhaseRegAlloc *ra_, outputStream *os) const {
 1177   os->print_cr("epilog");
 1178   os->print("\t");
 1179   if (do_polling() && ra_->C->is_method_compilation()) {
 1180     os->print_cr("load_from_polling_page Z_R1_scratch");
 1181     os->print("\t");
 1182   }
 1183 }
 1184 #endif
 1185 
 1186 void MachEpilogNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const {
 1187   Compile* C = ra_->C;

 1190   bool need_polling = do_polling() && C->is_method_compilation();
 1191 
 1192   // Pop frame, restore return_pc, and all stuff needed by interpreter.
 1193   int frame_size_in_bytes = Assembler::align((C->output()->frame_slots() << LogBytesPerInt), frame::alignment_in_bytes);
 1194   __ pop_frame_restore_retPC(frame_size_in_bytes);
 1195 
 1196   if (StackReservedPages > 0 && C->has_reserved_stack_access()) {
 1197     __ reserved_stack_check(Z_R14);
 1198   }
 1199 
 1200   // Touch the polling page.
 1201   if (need_polling) {
 1202     __ z_lg(Z_R1_scratch, Address(Z_thread, JavaThread::polling_page_offset()));
 1203     // We need to mark the code position where the load from the safepoint
 1204     // polling page was emitted as relocInfo::poll_return_type here.
 1205     __ relocate(relocInfo::poll_return_type);
 1206     __ load_from_polling_page(Z_R1_scratch);
 1207   }
 1208 }
 1209 
 1210 uint MachEpilogNode::size(PhaseRegAlloc *ra_) const {
 1211   // Variable size. determine dynamically.
 1212   return MachNode::size(ra_);
 1213 }
 1214 
 1215 int MachEpilogNode::reloc() const {
 1216   // Return number of relocatable values contained in this instruction.
 1217   return 1; // One for load_from_polling_page.
 1218 }
 1219 
 1220 const Pipeline * MachEpilogNode::pipeline() const {
 1221   return MachNode::pipeline_class();
 1222 }
 1223 
 1224 //=============================================================================
 1225 
 1226 // Figure out which register class each belongs in: rc_int, rc_float, rc_vector, rc_stack.
 1227 enum RC { rc_bad, rc_int, rc_float, rc_vector, rc_stack };
 1228 
 1229 static enum RC rc_class(OptoReg::Name reg) {
 1230   // Return the register class for the given register. The given register
 1231   // reg is a <register>_num value, which is an index into the MachRegisterNumbers
 1232   // enumeration in adGlobals_s390.hpp.
 1233 
 1234   if (reg == OptoReg::Bad) {

 1599 class CallStubImpl {
 1600  public:
 1601 
 1602   // call trampolines
 1603   // Size of call trampoline stub. For add'l comments, see size_java_to_interp().
 1604   static uint size_call_trampoline() {
 1605     return 0; // no call trampolines on this platform
 1606   }
 1607 
 1608   // call trampolines
 1609   // Number of relocations needed by a call trampoline stub.
 1610   static uint reloc_call_trampoline() {
 1611     return 0; // No call trampolines on this platform.
 1612   }
 1613 };
 1614 
 1615 %} // end source_hpp section
 1616 
 1617 source %{
 1618 












 1619 #if !defined(PRODUCT)
 1620 void MachUEPNode::format(PhaseRegAlloc *ra_, outputStream *os) const {
 1621   os->print_cr("---- MachUEPNode ----");
 1622   os->print_cr("\tTA");
 1623   os->print_cr("\tload_const Z_R1, SharedRuntime::get_ic_miss_stub()");
 1624   os->print_cr("\tBR(Z_R1)");
 1625   os->print_cr("\tTA  # pad with illtraps");
 1626   os->print_cr("\t...");
 1627   os->print_cr("\tTA");
 1628   os->print_cr("\tLTGR    Z_R2, Z_R2");
 1629   os->print_cr("\tBRU     ic_miss");
 1630 }
 1631 #endif
 1632 
 1633 void MachUEPNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const {
 1634   // This is Unverified Entry Point
 1635   __ ic_check(CodeEntryAlignment);
 1636 }
 1637 
 1638 uint MachUEPNode::size(PhaseRegAlloc *ra_) const {
 1639   // Determine size dynamically.
 1640   return MachNode::size(ra_);
 1641 }
 1642 
 1643 //=============================================================================
 1644 
 1645 %} // interrupt source section
 1646 
 1647 source_hpp %{ // Header information of the source block.
 1648 
 1649 class HandlerImpl {
 1650  public:
 1651 
 1652   static int emit_deopt_handler(C2_MacroAssembler* masm);
 1653 
 1654   static uint size_deopt_handler() {
 1655     return NativeCall::max_instruction_size() + MacroAssembler::jump_pcrelative_size();
 1656   }
 1657 };
 1658 
 1659 class Node::PD {
 1660 public:
 1661   enum NodeFlags {
 1662     _last_flag = Node::_last_flag

 1142   __ save_return_pc();
 1143 
 1144   // The z/Architecture abi is already accounted for in `framesize' via the
 1145   // 'out_preserve_stack_slots' declaration.
 1146   __ push_frame((unsigned int)framesize/*includes JIT ABI*/);
 1147 
 1148   if (C->has_mach_constant_base_node()) {
 1149     // NOTE: We set the table base offset here because users might be
 1150     // emitted before MachConstantBaseNode.
 1151     ConstantTable& constant_table = C->output()->constant_table();
 1152     constant_table.set_table_base_offset(constant_table.calculate_table_base_offset());
 1153   }
 1154 
 1155   if (C->stub_function() == nullptr) {
 1156     BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
 1157     bs->nmethod_entry_barrier(masm);
 1158   }
 1159 
 1160   C->output()->set_frame_complete(__ offset());
 1161 }






 1162 int MachPrologNode::reloc() const {
 1163   // Return number of relocatable values contained in this instruction.
 1164   return 1; // One reloc entry for load_const(toc).
 1165 }
 1166 
 1167 //=============================================================================
 1168 
 1169 #if !defined(PRODUCT)
 1170 void MachEpilogNode::format(PhaseRegAlloc *ra_, outputStream *os) const {
 1171   os->print_cr("epilog");
 1172   os->print("\t");
 1173   if (do_polling() && ra_->C->is_method_compilation()) {
 1174     os->print_cr("load_from_polling_page Z_R1_scratch");
 1175     os->print("\t");
 1176   }
 1177 }
 1178 #endif
 1179 
 1180 void MachEpilogNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const {
 1181   Compile* C = ra_->C;

 1184   bool need_polling = do_polling() && C->is_method_compilation();
 1185 
 1186   // Pop frame, restore return_pc, and all stuff needed by interpreter.
 1187   int frame_size_in_bytes = Assembler::align((C->output()->frame_slots() << LogBytesPerInt), frame::alignment_in_bytes);
 1188   __ pop_frame_restore_retPC(frame_size_in_bytes);
 1189 
 1190   if (StackReservedPages > 0 && C->has_reserved_stack_access()) {
 1191     __ reserved_stack_check(Z_R14);
 1192   }
 1193 
 1194   // Touch the polling page.
 1195   if (need_polling) {
 1196     __ z_lg(Z_R1_scratch, Address(Z_thread, JavaThread::polling_page_offset()));
 1197     // We need to mark the code position where the load from the safepoint
 1198     // polling page was emitted as relocInfo::poll_return_type here.
 1199     __ relocate(relocInfo::poll_return_type);
 1200     __ load_from_polling_page(Z_R1_scratch);
 1201   }
 1202 }
 1203 





 1204 int MachEpilogNode::reloc() const {
 1205   // Return number of relocatable values contained in this instruction.
 1206   return 1; // One for load_from_polling_page.
 1207 }
 1208 
 1209 const Pipeline * MachEpilogNode::pipeline() const {
 1210   return MachNode::pipeline_class();
 1211 }
 1212 
 1213 //=============================================================================
 1214 
 1215 // Figure out which register class each belongs in: rc_int, rc_float, rc_vector, rc_stack.
 1216 enum RC { rc_bad, rc_int, rc_float, rc_vector, rc_stack };
 1217 
 1218 static enum RC rc_class(OptoReg::Name reg) {
 1219   // Return the register class for the given register. The given register
 1220   // reg is a <register>_num value, which is an index into the MachRegisterNumbers
 1221   // enumeration in adGlobals_s390.hpp.
 1222 
 1223   if (reg == OptoReg::Bad) {

 1588 class CallStubImpl {
 1589  public:
 1590 
 1591   // call trampolines
 1592   // Size of call trampoline stub. For add'l comments, see size_java_to_interp().
 1593   static uint size_call_trampoline() {
 1594     return 0; // no call trampolines on this platform
 1595   }
 1596 
 1597   // call trampolines
 1598   // Number of relocations needed by a call trampoline stub.
 1599   static uint reloc_call_trampoline() {
 1600     return 0; // No call trampolines on this platform.
 1601   }
 1602 };
 1603 
 1604 %} // end source_hpp section
 1605 
 1606 source %{
 1607 
 1608 #ifndef PRODUCT
 1609 void MachVEPNode::format(PhaseRegAlloc* ra_, outputStream* st) const
 1610 {
 1611   Unimplemented();
 1612 }
 1613 #endif
 1614 
 1615 void MachVEPNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc* ra_) const
 1616 {
 1617   Unimplemented();
 1618 }
 1619 
 1620 #if !defined(PRODUCT)
 1621 void MachUEPNode::format(PhaseRegAlloc *ra_, outputStream *os) const {
 1622   os->print_cr("---- MachUEPNode ----");
 1623   os->print_cr("\tTA");
 1624   os->print_cr("\tload_const Z_R1, SharedRuntime::get_ic_miss_stub()");
 1625   os->print_cr("\tBR(Z_R1)");
 1626   os->print_cr("\tTA  # pad with illtraps");
 1627   os->print_cr("\t...");
 1628   os->print_cr("\tTA");
 1629   os->print_cr("\tLTGR    Z_R2, Z_R2");
 1630   os->print_cr("\tBRU     ic_miss");
 1631 }
 1632 #endif
 1633 
 1634 void MachUEPNode::emit(C2_MacroAssembler *masm, PhaseRegAlloc *ra_) const {
 1635   // This is Unverified Entry Point
 1636   __ ic_check(CodeEntryAlignment);
 1637 }
 1638 





 1639 //=============================================================================
 1640 
 1641 %} // interrupt source section
 1642 
 1643 source_hpp %{ // Header information of the source block.
 1644 
 1645 class HandlerImpl {
 1646  public:
 1647 
 1648   static int emit_deopt_handler(C2_MacroAssembler* masm);
 1649 
 1650   static uint size_deopt_handler() {
 1651     return NativeCall::max_instruction_size() + MacroAssembler::jump_pcrelative_size();
 1652   }
 1653 };
 1654 
 1655 class Node::PD {
 1656 public:
 1657   enum NodeFlags {
 1658     _last_flag = Node::_last_flag
< prev index next >