< prev index next >

src/share/vm/opto/callGenerator.cpp

Print this page

        

*** 441,451 **** } map->set_argument(jvms, i1, arg); } else { if (t->isa_valuetypeptr() && t->is_valuetypeptr()->klass() != C->env()->___Value_klass()) { ciValueKlass* vk = t->is_valuetypeptr()->value_type()->value_klass(); ! Node* vt = C->create_vt_node(call, vk, vk, 0, j, true); map->set_argument(jvms, i1, gvn.transform(vt)); j += vk->value_arg_slots(); } else { map->set_argument(jvms, i1, call->in(j)); j++; --- 441,451 ---- } map->set_argument(jvms, i1, arg); } else { if (t->isa_valuetypeptr() && t->is_valuetypeptr()->klass() != C->env()->___Value_klass()) { ciValueKlass* vk = t->is_valuetypeptr()->value_type()->value_klass(); ! Node* vt = ValueTypeNode::make(gvn, call, vk, j, true); map->set_argument(jvms, i1, gvn.transform(vt)); j += vk->value_arg_slots(); } else { map->set_argument(jvms, i1, call->in(j)); j++;
*** 492,525 **** C->set_has_loops(C->has_loops() || _inline_cg->method()->has_loops()); C->env()->notice_inlined_method(_inline_cg->method()); C->set_inlining_progress(true); ! if (return_type->is_valuetype() && return_type != C->env()->___Value_klass()) { if (result->is_ValueType()) { ValueTypeNode* vt = result->as_ValueType(); if (!call->tf()->returns_value_type_as_fields()) { result = vt->allocate(&kit); result = C->initial_gvn()->transform(new ValueTypePtrNode(vt, result, C)); } else { // Return of multiple values (the fields of a value type) vt->replace_call_results(call, C); } } else { assert(result->is_top(), "what else?"); for (DUIterator_Fast imax, i = call->fast_outs(imax); i < imax; i++) { ProjNode *pn = call->fast_out(i)->as_Proj(); uint con = pn->_con; if (con >= TypeFunc::Parms) { - // C->gvn_replace_by(pn, C->top()); C->initial_gvn()->hash_delete(pn); pn->set_req(0, C->top()); --i; --imax; } } } } kit.replace_call(call, result, true); } --- 492,533 ---- C->set_has_loops(C->has_loops() || _inline_cg->method()->has_loops()); C->env()->notice_inlined_method(_inline_cg->method()); C->set_inlining_progress(true); ! if (return_type->is_valuetype()) { if (result->is_ValueType()) { ValueTypeNode* vt = result->as_ValueType(); if (!call->tf()->returns_value_type_as_fields()) { result = vt->allocate(&kit); result = C->initial_gvn()->transform(new ValueTypePtrNode(vt, result, C)); } else { // Return of multiple values (the fields of a value type) vt->replace_call_results(call, C); } } else { + const Type* vt_t = call->_tf->range_sig()->field_at(TypeFunc::Parms); + if (vt_t->is_valuetypeptr()->value_type()->value_klass() != C->env()->___Value_klass()) { + if (gvn.type(result)->isa_valuetypeptr() && call->tf()->returns_value_type_as_fields()) { + Node* cast = gvn.transform(new CheckCastPPNode(NULL, result, vt_t)); + ValueTypePtrNode* vtptr = ValueTypePtrNode::make(gvn, kit.merged_memory(), cast); + vtptr->replace_call_results(call, C); + } else { assert(result->is_top(), "what else?"); for (DUIterator_Fast imax, i = call->fast_outs(imax); i < imax; i++) { ProjNode *pn = call->fast_out(i)->as_Proj(); uint con = pn->_con; if (con >= TypeFunc::Parms) { C->initial_gvn()->hash_delete(pn); pn->set_req(0, C->top()); --i; --imax; } } } } + } + } kit.replace_call(call, result, true); }
< prev index next >