19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
25
26 #include "precompiled.hpp"
27 #include "c1/c1_Compilation.hpp"
28 #include "c1/c1_LIRAssembler.hpp"
29 #include "c1/c1_MacroAssembler.hpp"
30 #include "c1/c1_Runtime1.hpp"
31 #include "c1/c1_ValueStack.hpp"
32 #include "ci/ciArrayKlass.hpp"
33 #include "ci/ciInstance.hpp"
34 #include "gc/shared/collectedHeap.hpp"
35 #include "gc/shared/barrierSet.hpp"
36 #include "gc/shared/cardTableModRefBS.hpp"
37 #include "nativeInst_s390.hpp"
38 #include "oops/objArrayKlass.hpp"
39 #include "runtime/sharedRuntime.hpp"
40 #include "vmreg_s390.inline.hpp"
41
42 #define __ _masm->
43
44 #ifndef PRODUCT
45 #undef __
46 #define __ (Verbose ? (_masm->block_comment(FILE_AND_LINE),_masm) : _masm)->
47 #endif
48
49 //------------------------------------------------------------
50
51 bool LIR_Assembler::is_small_constant(LIR_Opr opr) {
52 // Not used on ZARCH_64
53 ShouldNotCallThis();
54 return false;
55 }
56
57 LIR_Opr LIR_Assembler::receiverOpr() {
58 return FrameMap::Z_R2_oop_opr;
1118 }
1119 break;
1120 default: ShouldNotReachHere();
1121 }
1122
1123 if (patch != NULL) {
1124 patching_epilog(patch, patch_code, dest, info);
1125 }
1126
1127 if (info != NULL) add_debug_info_for_null_check(offset, info);
1128 }
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 __ pop_frame_restore_retPC(initial_frame_size_in_bytes());
1143
1144 if (StackReservedPages > 0 && compilation()->has_reserved_stack_access()) {
1145 __ reserved_stack_check(Z_R14);
1146 }
1147
1148 // We need to mark the code position where the load from the safepoint
1149 // polling page was emitted as relocInfo::poll_return_type here.
1150 __ relocate(relocInfo::poll_return_type);
1151 __ load_from_polling_page(Z_R1_scratch);
1152
1153 __ z_br(Z_R14); // Return to caller.
1154 }
1155
1156 int LIR_Assembler::safepoint_poll(LIR_Opr tmp, CodeEmitInfo* info) {
1157 AddressLiteral pp(os::get_polling_page());
1158 __ load_const_optimized(tmp->as_register_lo(), pp);
1159 guarantee(info != NULL, "Shouldn't be NULL");
1160 add_debug_info_for_branch(info);
1161 int offset = __ offset();
1162 __ relocate(relocInfo::poll_type);
1163 __ load_from_polling_page(tmp->as_register_lo());
1164 return offset;
1165 }
1166
1167 void LIR_Assembler::emit_static_call_stub() {
1168
1169 // Stub is fixed up when the corresponding call is converted from calling
1170 // compiled code to calling interpreted code.
1171
1172 address call_pc = __ pc();
1173 address stub = __ start_a_stub(call_stub_size());
1174 if (stub == NULL) {
1175 bailout("static call stub overflow");
1176 return;
1177 }
1178
1179 int start = __ offset();
1180
1181 __ relocate(static_stub_Relocation::spec(call_pc));
1182
1183 // See also Matcher::interpreter_method_oop_reg().
|
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
25
26 #include "precompiled.hpp"
27 #include "c1/c1_Compilation.hpp"
28 #include "c1/c1_LIRAssembler.hpp"
29 #include "c1/c1_MacroAssembler.hpp"
30 #include "c1/c1_Runtime1.hpp"
31 #include "c1/c1_ValueStack.hpp"
32 #include "ci/ciArrayKlass.hpp"
33 #include "ci/ciInstance.hpp"
34 #include "gc/shared/collectedHeap.hpp"
35 #include "gc/shared/barrierSet.hpp"
36 #include "gc/shared/cardTableModRefBS.hpp"
37 #include "nativeInst_s390.hpp"
38 #include "oops/objArrayKlass.hpp"
39 #include "runtime/safepointMechanism.inline.hpp"
40 #include "runtime/sharedRuntime.hpp"
41 #include "vmreg_s390.inline.hpp"
42
43 #define __ _masm->
44
45 #ifndef PRODUCT
46 #undef __
47 #define __ (Verbose ? (_masm->block_comment(FILE_AND_LINE),_masm) : _masm)->
48 #endif
49
50 //------------------------------------------------------------
51
52 bool LIR_Assembler::is_small_constant(LIR_Opr opr) {
53 // Not used on ZARCH_64
54 ShouldNotCallThis();
55 return false;
56 }
57
58 LIR_Opr LIR_Assembler::receiverOpr() {
59 return FrameMap::Z_R2_oop_opr;
1119 }
1120 break;
1121 default: ShouldNotReachHere();
1122 }
1123
1124 if (patch != NULL) {
1125 patching_epilog(patch, patch_code, dest, info);
1126 }
1127
1128 if (info != NULL) add_debug_info_for_null_check(offset, info);
1129 }
1130
1131
1132 void LIR_Assembler::return_op(LIR_Opr result) {
1133 assert(result->is_illegal() ||
1134 (result->is_single_cpu() && result->as_register() == Z_R2) ||
1135 (result->is_double_cpu() && result->as_register_lo() == Z_R2) ||
1136 (result->is_single_fpu() && result->as_float_reg() == Z_F0) ||
1137 (result->is_double_fpu() && result->as_double_reg() == Z_F0), "convention");
1138
1139 if (SafepointMechanism::uses_thread_local_poll()) {
1140 __ z_lg(Z_R1_scratch, Address(Z_thread, Thread::polling_page_offset()));
1141 } else {
1142 AddressLiteral pp(os::get_polling_page());
1143 __ load_const_optimized(Z_R1_scratch, pp);
1144 }
1145
1146 // Pop the frame before the safepoint code.
1147 __ pop_frame_restore_retPC(initial_frame_size_in_bytes());
1148
1149 if (StackReservedPages > 0 && compilation()->has_reserved_stack_access()) {
1150 __ reserved_stack_check(Z_R14);
1151 }
1152
1153 // We need to mark the code position where the load from the safepoint
1154 // polling page was emitted as relocInfo::poll_return_type here.
1155 __ relocate(relocInfo::poll_return_type);
1156 __ load_from_polling_page(Z_R1_scratch);
1157
1158 __ z_br(Z_R14); // Return to caller.
1159 }
1160
1161 int LIR_Assembler::safepoint_poll(LIR_Opr tmp, CodeEmitInfo* info) {
1162 const Register poll_addr = tmp->as_register_lo();
1163 if (SafepointMechanism::uses_thread_local_poll()) {
1164 __ z_lg(poll_addr, Address(Z_thread, Thread::polling_page_offset()));
1165 } else {
1166 AddressLiteral pp(os::get_polling_page());
1167 __ load_const_optimized(poll_addr, pp);
1168 }
1169 guarantee(info != NULL, "Shouldn't be NULL");
1170 add_debug_info_for_branch(info);
1171 int offset = __ offset();
1172 __ relocate(relocInfo::poll_type);
1173 __ load_from_polling_page(poll_addr);
1174 return offset;
1175 }
1176
1177 void LIR_Assembler::emit_static_call_stub() {
1178
1179 // Stub is fixed up when the corresponding call is converted from calling
1180 // compiled code to calling interpreted code.
1181
1182 address call_pc = __ pc();
1183 address stub = __ start_a_stub(call_stub_size());
1184 if (stub == NULL) {
1185 bailout("static call stub overflow");
1186 return;
1187 }
1188
1189 int start = __ offset();
1190
1191 __ relocate(static_stub_Relocation::spec(call_pc));
1192
1193 // See also Matcher::interpreter_method_oop_reg().
|