--- old/src/share/vm/opto/compile.cpp 2017-08-04 21:18:48.977397175 +0200 +++ new/src/share/vm/opto/compile.cpp 2017-08-04 21:18:41.447409330 +0200 @@ -2711,91 +2711,6 @@ } } -void Compile::value_type_return_from_mh_intrinsic(CallNode *call, Final_Reshape_Counts &frc) { - if (ValueTypeReturnedAsFields && - call->is_CallStaticJava() && - call->as_CallStaticJava()->method() != NULL && - call->as_CallStaticJava()->method()->is_method_handle_intrinsic() && - call->proj_out(TypeFunc::Parms) != NULL && - call->proj_out(TypeFunc::Parms)->bottom_type()->isa_valuetypeptr()) { - // A value type is returned from the call but we don't know its - // type. One of the values being returned is the klass of the - // value type. We need to allocate a value type instance of that - // type and initialize it with other values being returned. This - // is done with the stub call below that we add right after this - // call. - Node* ret = call->proj_out(TypeFunc::Parms); - assert(ret->bottom_type()->is_valuetypeptr()->klass() == env()->___Value_klass(), "unexpected return type from MH intrinsic"); - const TypeFunc* tf = call->_tf; - const TypeTuple* domain = OptoRuntime::store_value_type_fields_Type()->domain_cc(); - const TypeFunc* new_tf = TypeFunc::make(tf->domain_sig(), tf->domain_cc(), tf->range_sig(), domain); - call->_tf = new_tf; - - CallProjections projs; - call->extract_projections(&projs, true, true); - Node* ctl = projs.fallthrough_catchproj; - Node* mem = projs.fallthrough_memproj; - Node* io = projs.fallthrough_ioproj; - Node* ex_ctl = projs.catchall_catchproj; - Node* ex_mem = projs.catchall_memproj; - Node* ex_io = projs.catchall_ioproj; - CallStaticJavaNode* rt_call = new CallStaticJavaNode(OptoRuntime::store_value_type_fields_Type(), - StubRoutines::store_value_type_fields_to_buf(), - "store_value_type_fields", - call->jvms()->bci(), - TypePtr::BOTTOM); - Node* out_ctl = new ProjNode(rt_call, TypeFunc::Control); - Node* out_mem = new ProjNode(rt_call, TypeFunc::Memory); - Node* out_io = new ProjNode(rt_call, TypeFunc::I_O); - Node* res = new ProjNode(rt_call, TypeFunc::Parms); - - Node* catc = new CatchNode(out_ctl, out_io, 2); - Node* norm = new CatchProjNode(catc, CatchProjNode::fall_through_index, CatchProjNode::no_handler_bci); - Node* excp = new CatchProjNode(catc, CatchProjNode::catch_all_index, CatchProjNode::no_handler_bci); - Node* r = new RegionNode(3); - Node* mem_phi = new PhiNode(r, Type::MEMORY, TypePtr::BOTTOM); - Node* io_phi = new PhiNode(r, Type::ABIO); - r->init_req(1, excp); - mem_phi->init_req(1, out_mem); - io_phi->init_req(1, out_io); - - frc._visited.set(norm->_idx); - frc._visited.set(excp->_idx); - - ctl->replace_by(norm); - mem->replace_by(out_mem); - io->replace_by(out_io); - ret->replace_by(res); - ex_ctl->replace_by(r); - ex_mem->replace_by(mem_phi); - ex_io->replace_by(io_phi); - - r->init_req(2, ex_ctl); - mem_phi->init_req(2, ex_mem); - io_phi->init_req(2, ex_io); - - rt_call->init_req(TypeFunc::Control, ctl); - rt_call->init_req(TypeFunc::Memory, mem); - rt_call->init_req(TypeFunc::I_O, io); - rt_call->init_req(TypeFunc::FramePtr, call->in(TypeFunc::FramePtr)); - rt_call->init_req(TypeFunc::ReturnAdr, call->in(TypeFunc::ReturnAdr)); - - rt_call->init_req(TypeFunc::Parms, ret); - // We don't know how many values are returned. This assumes the - // worst case, that all available registers are used. - for (uint i = TypeFunc::Parms+1; i < domain->cnt(); i++) { - if (domain->field_at(i) == Type::HALF) { - rt_call->init_req(i, top()); - continue; - } - Node* proj = new ProjNode(call, i); - rt_call->init_req(i, proj); - } - - // We can safepoint at that new call - add_safepoint_edges(rt_call, call->jvms()); - } -} //------------------------------final_graph_reshaping_impl---------------------- // Implement items 1-5 from final_graph_reshaping below. @@ -2911,7 +2826,6 @@ call->set_req( TypeFunc::Parms, x ); } } - value_type_return_from_mh_intrinsic(call, frc); break; } @@ -3664,6 +3578,7 @@ } // Recheck with a better notion of 'required_outcnt' if (n->outcnt() != required_outcnt) { + assert(false, "malformed control flow"); record_method_not_compilable("malformed control flow"); return true; // Not all targets reachable! } @@ -3673,6 +3588,7 @@ for (DUIterator_Fast jmax, j = n->fast_outs(jmax); j < jmax; j++) if (!frc._visited.test(n->fast_out(j)->_idx)) { record_method_not_compilable("infinite loop"); + assert(false, "infinite loop"); return true; // Found unvisited kid; must be unreach } }