< prev index next >

src/hotspot/share/opto/vector.cpp

Print this page

188       Node* use = vec_box->fast_out(i);
189       if (use->is_CallJava()) {
190         CallJavaNode* call = use->as_CallJava();
191         if (call->has_non_debug_use(vec_box) && vec_box->in(VectorBoxNode::Box)->is_Phi()) {
192           calls.push(call);
193         }
194       }
195     }
196 
197     while (calls.size() > 0) {
198       CallJavaNode* call = calls.pop()->as_CallJava();
199       // Attach new VBA to the call and use it instead of Phi (VBA ... VBA).
200 
201       JVMState* jvms = clone_jvms(C, call);
202       GraphKit kit(jvms);
203       PhaseGVN& gvn = kit.gvn();
204 
205       // Adjust JVMS from post-call to pre-call state: put args on stack
206       uint nargs = call->method()->arg_size();
207       kit.ensure_stack(kit.sp() + nargs);
208       for (uint i = TypeFunc::Parms; i < call->tf()->domain()->cnt(); i++) {
209         kit.push(call->in(i));














210       }


211       jvms = kit.sync_jvms();
212 
213       Node* new_vbox = nullptr;
214       {
215         Node* vect = vec_box->in(VectorBoxNode::Value);
216         const TypeInstPtr* vbox_type = vec_box->box_type();
217         const TypeVect* vt = vec_box->vec_type();
218         BasicType elem_bt = vt->element_basic_type();
219         int num_elem = vt->length();
220 
221         new_vbox = kit.box_vector(vect, vbox_type, elem_bt, num_elem, /*deoptimize=*/true);
222 
223         kit.replace_in_map(vec_box, new_vbox);
224       }
225 
226       kit.dec_sp(nargs);
227       jvms = kit.sync_jvms();
228 
229       call->set_req(TypeFunc::Control , kit.control());
230       call->set_req(TypeFunc::I_O     , kit.i_o());

188       Node* use = vec_box->fast_out(i);
189       if (use->is_CallJava()) {
190         CallJavaNode* call = use->as_CallJava();
191         if (call->has_non_debug_use(vec_box) && vec_box->in(VectorBoxNode::Box)->is_Phi()) {
192           calls.push(call);
193         }
194       }
195     }
196 
197     while (calls.size() > 0) {
198       CallJavaNode* call = calls.pop()->as_CallJava();
199       // Attach new VBA to the call and use it instead of Phi (VBA ... VBA).
200 
201       JVMState* jvms = clone_jvms(C, call);
202       GraphKit kit(jvms);
203       PhaseGVN& gvn = kit.gvn();
204 
205       // Adjust JVMS from post-call to pre-call state: put args on stack
206       uint nargs = call->method()->arg_size();
207       kit.ensure_stack(kit.sp() + nargs);
208       uint in_idx = TypeFunc::Parms;  // The index of the call input, using scalarized calling convention.
209       int parm_idx = 0;  // The index of the Java parameter: double/long take one slot
210       for (uint i = 0; i < nargs; i++) {  // The index of the argument on the JVM stack: double/long take two slots
211         const Type* arg_type = call->tf()->domain_sig()->field_at(TypeFunc::Parms + i);
212         if (arg_type->is_inlinetypeptr() && !call->method()->mismatch() && call->method()->is_scalarized_arg(parm_idx)) {
213           bool nullable = arg_type->maybe_null();
214           ciInlineKlass* vk = arg_type->inline_klass();
215           InlineTypeNode* it = InlineTypeNode::make_from_multi(&kit, call, vk, in_idx, true, !nullable);
216           kit.push(gvn.transform(it));
217         } else {
218           kit.push(call->in(in_idx));
219           in_idx++;
220         }
221         if (arg_type != Type::HALF) {
222           parm_idx++;
223         }
224       }
225       assert(in_idx == call->tf()->domain_cc()->cnt(), "should have processed exactly as many input as the scalarized calling convention; %d vs %d", in_idx, call->tf()->domain_cc()->cnt());
226       assert(parm_idx == (call->method()->is_static() ? 0 : 1) + call->method()->signature()->count(), "should have processed all the parameters; %d vs %d", parm_idx, (call->method()->is_static() ? 0 : 1) + call->method()->signature()->count());
227       jvms = kit.sync_jvms();
228 
229       Node* new_vbox = nullptr;
230       {
231         Node* vect = vec_box->in(VectorBoxNode::Value);
232         const TypeInstPtr* vbox_type = vec_box->box_type();
233         const TypeVect* vt = vec_box->vec_type();
234         BasicType elem_bt = vt->element_basic_type();
235         int num_elem = vt->length();
236 
237         new_vbox = kit.box_vector(vect, vbox_type, elem_bt, num_elem, /*deoptimize=*/true);
238 
239         kit.replace_in_map(vec_box, new_vbox);
240       }
241 
242       kit.dec_sp(nargs);
243       jvms = kit.sync_jvms();
244 
245       call->set_req(TypeFunc::Control , kit.control());
246       call->set_req(TypeFunc::I_O     , kit.i_o());
< prev index next >