1.1 --- a/src/cpu/ppc/vm/stubGenerator_ppc.cpp Thu Feb 20 11:05:12 2014 +0100 1.2 +++ b/src/cpu/ppc/vm/stubGenerator_ppc.cpp Thu Mar 06 10:55:28 2014 -0800 1.3 @@ -79,11 +79,11 @@ 1.4 1.5 StubCodeMark mark(this, "StubRoutines", "call_stub"); 1.6 1.7 - address start = __ emit_fd(); 1.8 + address start = __ function_entry(); 1.9 1.10 // some sanity checks 1.11 - assert((sizeof(frame::abi_48) % 16) == 0, "unaligned"); 1.12 - assert((sizeof(frame::abi_112) % 16) == 0, "unaligned"); 1.13 + assert((sizeof(frame::abi_minframe) % 16) == 0, "unaligned"); 1.14 + assert((sizeof(frame::abi_reg_args) % 16) == 0, "unaligned"); 1.15 assert((sizeof(frame::spill_nonvolatiles) % 16) == 0, "unaligned"); 1.16 assert((sizeof(frame::parent_ijava_frame_abi) % 16) == 0, "unaligned"); 1.17 assert((sizeof(frame::entry_frame_locals) % 16) == 0, "unaligned"); 1.18 @@ -444,7 +444,7 @@ 1.19 1.20 // Save LR/CR and copy exception pc (LR) into R4_ARG2. 1.21 __ save_LR_CR(R4_ARG2); 1.22 - __ push_frame_abi112(0, R0); 1.23 + __ push_frame_reg_args(0, R0); 1.24 // Find exception handler. 1.25 __ call_VM_leaf(CAST_FROM_FN_PTR(address, 1.26 SharedRuntime::exception_handler_for_return_address), 1.27 @@ -519,7 +519,7 @@ 1.28 MacroAssembler* masm = new MacroAssembler(&code); 1.29 1.30 OopMapSet* oop_maps = new OopMapSet(); 1.31 - int frame_size_in_bytes = frame::abi_112_size; 1.32 + int frame_size_in_bytes = frame::abi_reg_args_size; 1.33 OopMap* map = new OopMap(frame_size_in_bytes / sizeof(jint), 0); 1.34 1.35 StubCodeMark mark(this, "StubRoutines", "throw_exception"); 1.36 @@ -529,7 +529,7 @@ 1.37 __ save_LR_CR(R11_scratch1); 1.38 1.39 // Push a frame. 1.40 - __ push_frame_abi112(0, R11_scratch1); 1.41 + __ push_frame_reg_args(0, R11_scratch1); 1.42 1.43 address frame_complete_pc = __ pc(); 1.44 1.45 @@ -551,8 +551,11 @@ 1.46 if (arg2 != noreg) { 1.47 __ mr(R5_ARG3, arg2); 1.48 } 1.49 - __ call_c(CAST_FROM_FN_PTR(FunctionDescriptor*, runtime_entry), 1.50 - relocInfo::none); 1.51 +#if defined(ABI_ELFv2) 1.52 + __ call_c(runtime_entry, relocInfo::none); 1.53 +#else 1.54 + __ call_c(CAST_FROM_FN_PTR(FunctionDescriptor*, runtime_entry), relocInfo::none); 1.55 +#endif 1.56 1.57 // Set an oopmap for the call site. 1.58 oop_maps->add_gc_map((int)(gc_map_pc - start), map); 1.59 @@ -614,7 +617,7 @@ 1.60 // With G1, don't generate the call if we statically know that the target in uninitialized 1.61 if (!dest_uninitialized) { 1.62 const int spill_slots = 4 * wordSize; 1.63 - const int frame_size = frame::abi_112_size + spill_slots; 1.64 + const int frame_size = frame::abi_reg_args_size + spill_slots; 1.65 Label filtered; 1.66 1.67 // Is marking active? 1.68 @@ -628,7 +631,7 @@ 1.69 __ beq(CCR0, filtered); 1.70 1.71 __ save_LR_CR(R0); 1.72 - __ push_frame_abi112(spill_slots, R0); 1.73 + __ push_frame_reg_args(spill_slots, R0); 1.74 __ std(from, frame_size - 1 * wordSize, R1_SP); 1.75 __ std(to, frame_size - 2 * wordSize, R1_SP); 1.76 __ std(count, frame_size - 3 * wordSize, R1_SP); 1.77 @@ -672,7 +675,7 @@ 1.78 if (branchToEnd) { 1.79 __ save_LR_CR(R0); 1.80 // We need this frame only to spill LR. 1.81 - __ push_frame_abi112(0, R0); 1.82 + __ push_frame_reg_args(0, R0); 1.83 __ call_VM_leaf(CAST_FROM_FN_PTR(address, BarrierSet::static_write_ref_array_post), addr, count); 1.84 __ pop_frame(); 1.85 __ restore_LR_CR(R0); 1.86 @@ -742,7 +745,7 @@ 1.87 StubCodeMark mark(this, "StubRoutines", "zero_words_aligned8"); 1.88 1.89 // Implemented as in ClearArray. 1.90 - address start = __ emit_fd(); 1.91 + address start = __ function_entry(); 1.92 1.93 Register base_ptr_reg = R3_ARG1; // tohw (needs to be 8b aligned) 1.94 Register cnt_dwords_reg = R4_ARG2; // count (in dwords) 1.95 @@ -820,7 +823,7 @@ 1.96 // 1.97 address generate_handler_for_unsafe_access() { 1.98 StubCodeMark mark(this, "StubRoutines", "handler_for_unsafe_access"); 1.99 - address start = __ emit_fd(); 1.100 + address start = __ function_entry(); 1.101 __ unimplemented("StubRoutines::handler_for_unsafe_access", 93); 1.102 return start; 1.103 } 1.104 @@ -861,7 +864,7 @@ 1.105 // to read from the safepoint polling page. 1.106 address generate_load_from_poll() { 1.107 StubCodeMark mark(this, "StubRoutines", "generate_load_from_poll"); 1.108 - address start = __ emit_fd(); 1.109 + address start = __ function_entry(); 1.110 __ unimplemented("StubRoutines::verify_oop", 95); // TODO PPC port 1.111 return start; 1.112 } 1.113 @@ -885,7 +888,7 @@ 1.114 // 1.115 address generate_fill(BasicType t, bool aligned, const char* name) { 1.116 StubCodeMark mark(this, "StubRoutines", name); 1.117 - address start = __ emit_fd(); 1.118 + address start = __ function_entry(); 1.119 1.120 const Register to = R3_ARG1; // source array address 1.121 const Register value = R4_ARG2; // fill value 1.122 @@ -1123,7 +1126,7 @@ 1.123 // 1.124 address generate_disjoint_byte_copy(bool aligned, const char * name) { 1.125 StubCodeMark mark(this, "StubRoutines", name); 1.126 - address start = __ emit_fd(); 1.127 + address start = __ function_entry(); 1.128 1.129 Register tmp1 = R6_ARG4; 1.130 Register tmp2 = R7_ARG5; 1.131 @@ -1254,15 +1257,21 @@ 1.132 // 1.133 address generate_conjoint_byte_copy(bool aligned, const char * name) { 1.134 StubCodeMark mark(this, "StubRoutines", name); 1.135 - address start = __ emit_fd(); 1.136 + address start = __ function_entry(); 1.137 1.138 Register tmp1 = R6_ARG4; 1.139 Register tmp2 = R7_ARG5; 1.140 Register tmp3 = R8_ARG6; 1.141 1.142 +#if defined(ABI_ELFv2) 1.143 + address nooverlap_target = aligned ? 1.144 + StubRoutines::arrayof_jbyte_disjoint_arraycopy() : 1.145 + StubRoutines::jbyte_disjoint_arraycopy(); 1.146 +#else 1.147 address nooverlap_target = aligned ? 1.148 ((FunctionDescriptor*)StubRoutines::arrayof_jbyte_disjoint_arraycopy())->entry() : 1.149 ((FunctionDescriptor*)StubRoutines::jbyte_disjoint_arraycopy())->entry(); 1.150 +#endif 1.151 1.152 array_overlap_test(nooverlap_target, 0); 1.153 // Do reverse copy. We assume the case of actual overlap is rare enough 1.154 @@ -1345,7 +1354,7 @@ 1.155 Register tmp3 = R8_ARG6; 1.156 Register tmp4 = R9_ARG7; 1.157 1.158 - address start = __ emit_fd(); 1.159 + address start = __ function_entry(); 1.160 1.161 Label l_1, l_2, l_3, l_4, l_5, l_6, l_7, l_8; 1.162 // don't try anything fancy if arrays don't have many elements 1.163 @@ -1474,15 +1483,21 @@ 1.164 // 1.165 address generate_conjoint_short_copy(bool aligned, const char * name) { 1.166 StubCodeMark mark(this, "StubRoutines", name); 1.167 - address start = __ emit_fd(); 1.168 + address start = __ function_entry(); 1.169 1.170 Register tmp1 = R6_ARG4; 1.171 Register tmp2 = R7_ARG5; 1.172 Register tmp3 = R8_ARG6; 1.173 1.174 +#if defined(ABI_ELFv2) 1.175 + address nooverlap_target = aligned ? 1.176 + StubRoutines::arrayof_jshort_disjoint_arraycopy() : 1.177 + StubRoutines::jshort_disjoint_arraycopy(); 1.178 +#else 1.179 address nooverlap_target = aligned ? 1.180 ((FunctionDescriptor*)StubRoutines::arrayof_jshort_disjoint_arraycopy())->entry() : 1.181 ((FunctionDescriptor*)StubRoutines::jshort_disjoint_arraycopy())->entry(); 1.182 +#endif 1.183 1.184 array_overlap_test(nooverlap_target, 1); 1.185 1.186 @@ -1597,7 +1612,7 @@ 1.187 // 1.188 address generate_disjoint_int_copy(bool aligned, const char * name) { 1.189 StubCodeMark mark(this, "StubRoutines", name); 1.190 - address start = __ emit_fd(); 1.191 + address start = __ function_entry(); 1.192 generate_disjoint_int_copy_core(aligned); 1.193 __ blr(); 1.194 return start; 1.195 @@ -1681,11 +1696,17 @@ 1.196 // 1.197 address generate_conjoint_int_copy(bool aligned, const char * name) { 1.198 StubCodeMark mark(this, "StubRoutines", name); 1.199 - address start = __ emit_fd(); 1.200 + address start = __ function_entry(); 1.201 1.202 +#if defined(ABI_ELFv2) 1.203 + address nooverlap_target = aligned ? 1.204 + StubRoutines::arrayof_jint_disjoint_arraycopy() : 1.205 + StubRoutines::jint_disjoint_arraycopy(); 1.206 +#else 1.207 address nooverlap_target = aligned ? 1.208 ((FunctionDescriptor*)StubRoutines::arrayof_jint_disjoint_arraycopy())->entry() : 1.209 ((FunctionDescriptor*)StubRoutines::jint_disjoint_arraycopy())->entry(); 1.210 +#endif 1.211 1.212 array_overlap_test(nooverlap_target, 2); 1.213 1.214 @@ -1767,7 +1788,7 @@ 1.215 // 1.216 address generate_disjoint_long_copy(bool aligned, const char * name) { 1.217 StubCodeMark mark(this, "StubRoutines", name); 1.218 - address start = __ emit_fd(); 1.219 + address start = __ function_entry(); 1.220 generate_disjoint_long_copy_core(aligned); 1.221 __ blr(); 1.222 1.223 @@ -1849,11 +1870,17 @@ 1.224 // 1.225 address generate_conjoint_long_copy(bool aligned, const char * name) { 1.226 StubCodeMark mark(this, "StubRoutines", name); 1.227 - address start = __ emit_fd(); 1.228 + address start = __ function_entry(); 1.229 1.230 +#if defined(ABI_ELFv2) 1.231 + address nooverlap_target = aligned ? 1.232 + StubRoutines::arrayof_jlong_disjoint_arraycopy() : 1.233 + StubRoutines::jlong_disjoint_arraycopy(); 1.234 +#else 1.235 address nooverlap_target = aligned ? 1.236 ((FunctionDescriptor*)StubRoutines::arrayof_jlong_disjoint_arraycopy())->entry() : 1.237 ((FunctionDescriptor*)StubRoutines::jlong_disjoint_arraycopy())->entry(); 1.238 +#endif 1.239 1.240 array_overlap_test(nooverlap_target, 3); 1.241 generate_conjoint_long_copy_core(aligned); 1.242 @@ -1875,11 +1902,17 @@ 1.243 address generate_conjoint_oop_copy(bool aligned, const char * name, bool dest_uninitialized) { 1.244 StubCodeMark mark(this, "StubRoutines", name); 1.245 1.246 - address start = __ emit_fd(); 1.247 + address start = __ function_entry(); 1.248 1.249 +#if defined(ABI_ELFv2) 1.250 + address nooverlap_target = aligned ? 1.251 + StubRoutines::arrayof_oop_disjoint_arraycopy() : 1.252 + StubRoutines::oop_disjoint_arraycopy(); 1.253 +#else 1.254 address nooverlap_target = aligned ? 1.255 ((FunctionDescriptor*)StubRoutines::arrayof_oop_disjoint_arraycopy())->entry() : 1.256 ((FunctionDescriptor*)StubRoutines::oop_disjoint_arraycopy())->entry(); 1.257 +#endif 1.258 1.259 gen_write_ref_array_pre_barrier(R3_ARG1, R4_ARG2, R5_ARG3, dest_uninitialized, R9_ARG7); 1.260 1.261 @@ -1910,7 +1943,7 @@ 1.262 // 1.263 address generate_disjoint_oop_copy(bool aligned, const char * name, bool dest_uninitialized) { 1.264 StubCodeMark mark(this, "StubRoutines", name); 1.265 - address start = __ emit_fd(); 1.266 + address start = __ function_entry(); 1.267 1.268 gen_write_ref_array_pre_barrier(R3_ARG1, R4_ARG2, R5_ARG3, dest_uninitialized, R9_ARG7); 1.269 1.270 @@ -1991,7 +2024,7 @@ 1.271 StubCodeMark mark(this, "StubRoutines", name); 1.272 1.273 // Entry point, pc or function descriptor. 1.274 - *entry = __ emit_fd(); 1.275 + *entry = __ function_entry(); 1.276 1.277 // Load *adr into R4_ARG2, may fault. 1.278 *fault_pc = __ pc();