1129
1130
1131 void LIR_Assembler::return_op(LIR_Opr result) {
1132 assert(result->is_illegal() ||
1133 (result->is_single_cpu() && result->as_register() == Z_R2) ||
1134 (result->is_double_cpu() && result->as_register_lo() == Z_R2) ||
1135 (result->is_single_fpu() && result->as_float_reg() == Z_F0) ||
1136 (result->is_double_fpu() && result->as_double_reg() == Z_F0), "convention");
1137
1138 AddressLiteral pp(os::get_polling_page());
1139 __ load_const_optimized(Z_R1_scratch, pp);
1140
1141 // Pop the frame before the safepoint code.
1142 int retPC_offset = initial_frame_size_in_bytes() + _z_abi16(return_pc);
1143 if (Displacement::is_validDisp(retPC_offset)) {
1144 __ z_lg(Z_R14, retPC_offset, Z_SP);
1145 __ add2reg(Z_SP, initial_frame_size_in_bytes());
1146 } else {
1147 __ add2reg(Z_SP, initial_frame_size_in_bytes());
1148 __ restore_return_pc();
1149 }
1150
1151 // We need to mark the code position where the load from the safepoint
1152 // polling page was emitted as relocInfo::poll_return_type here.
1153 __ relocate(relocInfo::poll_return_type);
1154 __ load_from_polling_page(Z_R1_scratch);
1155
1156 __ z_br(Z_R14); // Return to caller.
1157 }
1158
1159 int LIR_Assembler::safepoint_poll(LIR_Opr tmp, CodeEmitInfo* info) {
1160 AddressLiteral pp(os::get_polling_page());
1161 __ load_const_optimized(tmp->as_register_lo(), pp);
1162 guarantee(info != NULL, "Shouldn't be NULL");
1163 add_debug_info_for_branch(info);
1164 int offset = __ offset();
1165 __ relocate(relocInfo::poll_type);
1166 __ load_from_polling_page(tmp->as_register_lo());
1167 return offset;
1168 }
|
1129
1130
1131 void LIR_Assembler::return_op(LIR_Opr result) {
1132 assert(result->is_illegal() ||
1133 (result->is_single_cpu() && result->as_register() == Z_R2) ||
1134 (result->is_double_cpu() && result->as_register_lo() == Z_R2) ||
1135 (result->is_single_fpu() && result->as_float_reg() == Z_F0) ||
1136 (result->is_double_fpu() && result->as_double_reg() == Z_F0), "convention");
1137
1138 AddressLiteral pp(os::get_polling_page());
1139 __ load_const_optimized(Z_R1_scratch, pp);
1140
1141 // Pop the frame before the safepoint code.
1142 int retPC_offset = initial_frame_size_in_bytes() + _z_abi16(return_pc);
1143 if (Displacement::is_validDisp(retPC_offset)) {
1144 __ z_lg(Z_R14, retPC_offset, Z_SP);
1145 __ add2reg(Z_SP, initial_frame_size_in_bytes());
1146 } else {
1147 __ add2reg(Z_SP, initial_frame_size_in_bytes());
1148 __ restore_return_pc();
1149 }
1150
1151 if (StackReservedPages > 0 && compilation()->has_reserved_stack_access()) {
1152 __ reserved_stack_check(Z_R14);
1153 }
1154
1155 // We need to mark the code position where the load from the safepoint
1156 // polling page was emitted as relocInfo::poll_return_type here.
1157 __ relocate(relocInfo::poll_return_type);
1158 __ load_from_polling_page(Z_R1_scratch);
1159
1160 __ z_br(Z_R14); // Return to caller.
1161 }
1162
1163 int LIR_Assembler::safepoint_poll(LIR_Opr tmp, CodeEmitInfo* info) {
1164 AddressLiteral pp(os::get_polling_page());
1165 __ load_const_optimized(tmp->as_register_lo(), pp);
1166 guarantee(info != NULL, "Shouldn't be NULL");
1167 add_debug_info_for_branch(info);
1168 int offset = __ offset();
1169 __ relocate(relocInfo::poll_type);
1170 __ load_from_polling_page(tmp->as_register_lo());
1171 return offset;
1172 }
|