src/share/vm/opto/callGenerator.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/opto

src/share/vm/opto/callGenerator.cpp

Print this page
rev 6579 : 8046542: [I.finalize() calls from methods compiled by C1 do not cause IllegalAccessError on Sparc
Summary: call to Object.finalize() sometimes allowed by compilers on array type
Reviewed-by:


 854             const Type*       sig_type = TypeOopPtr::make_from_klass(t->as_klass());
 855             if (arg_type != NULL && !arg_type->higher_equal(sig_type)) {
 856               Node* cast_obj = gvn.transform(new CheckCastPPNode(kit.control(), arg, sig_type));
 857               kit.set_argument(receiver_skip + i, cast_obj);
 858             }
 859           }
 860         }
 861 
 862         // Try to get the most accurate receiver type
 863         const bool is_virtual              = (iid == vmIntrinsics::_linkToVirtual);
 864         const bool is_virtual_or_interface = (is_virtual || iid == vmIntrinsics::_linkToInterface);
 865         int  vtable_index       = Method::invalid_vtable_index;
 866         bool call_does_dispatch = false;
 867 
 868         ciKlass* speculative_receiver_type = NULL;
 869         if (is_virtual_or_interface) {
 870           ciInstanceKlass* klass = target->holder();
 871           Node*             receiver_node = kit.argument(0);
 872           const TypeOopPtr* receiver_type = gvn.type(receiver_node)->isa_oopptr();
 873           // call_does_dispatch and vtable_index are out-parameters.  They might be changed.
 874           target = C->optimize_virtual_call(caller, jvms->bci(), klass, target, receiver_type,
 875                                             is_virtual,
 876                                             call_does_dispatch, vtable_index);  // out-parameters
 877           // We lack profiling at this call but type speculation may
 878           // provide us with a type
 879           speculative_receiver_type = receiver_type->speculative_type();
 880         }
 881         CallGenerator* cg = C->call_generator(target, vtable_index, call_does_dispatch, jvms, true, PROB_ALWAYS, speculative_receiver_type, true, true);
 882         assert(cg == NULL || !cg->is_late_inline() || cg->is_mh_late_inline(), "no late inline here");
 883         if (cg != NULL && cg->is_inline())
 884           return cg;
 885       } else {
 886         const char* msg = "member_name not constant";
 887         if (PrintInlining)  C->print_inlining(callee, jvms->depth() - 1, jvms->bci(), msg);
 888         C->log_inline_failure(msg);
 889       }
 890     }
 891     break;
 892 
 893   default:
 894     fatal(err_msg_res("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid)));
 895     break;




 854             const Type*       sig_type = TypeOopPtr::make_from_klass(t->as_klass());
 855             if (arg_type != NULL && !arg_type->higher_equal(sig_type)) {
 856               Node* cast_obj = gvn.transform(new CheckCastPPNode(kit.control(), arg, sig_type));
 857               kit.set_argument(receiver_skip + i, cast_obj);
 858             }
 859           }
 860         }
 861 
 862         // Try to get the most accurate receiver type
 863         const bool is_virtual              = (iid == vmIntrinsics::_linkToVirtual);
 864         const bool is_virtual_or_interface = (is_virtual || iid == vmIntrinsics::_linkToInterface);
 865         int  vtable_index       = Method::invalid_vtable_index;
 866         bool call_does_dispatch = false;
 867 
 868         ciKlass* speculative_receiver_type = NULL;
 869         if (is_virtual_or_interface) {
 870           ciInstanceKlass* klass = target->holder();
 871           Node*             receiver_node = kit.argument(0);
 872           const TypeOopPtr* receiver_type = gvn.type(receiver_node)->isa_oopptr();
 873           // call_does_dispatch and vtable_index are out-parameters.  They might be changed.
 874           target = C->optimize_virtual_call(caller, jvms->bci(), klass, klass,
 875                                             target, receiver_type, is_virtual,
 876                                             call_does_dispatch, vtable_index);  // out-parameters
 877           // We lack profiling at this call but type speculation may
 878           // provide us with a type
 879           speculative_receiver_type = receiver_type->speculative_type();
 880         }
 881         CallGenerator* cg = C->call_generator(target, vtable_index, call_does_dispatch, jvms, true, PROB_ALWAYS, speculative_receiver_type, true, true);
 882         assert(cg == NULL || !cg->is_late_inline() || cg->is_mh_late_inline(), "no late inline here");
 883         if (cg != NULL && cg->is_inline())
 884           return cg;
 885       } else {
 886         const char* msg = "member_name not constant";
 887         if (PrintInlining)  C->print_inlining(callee, jvms->depth() - 1, jvms->bci(), msg);
 888         C->log_inline_failure(msg);
 889       }
 890     }
 891     break;
 892 
 893   default:
 894     fatal(err_msg_res("unexpected intrinsic %d: %s", iid, vmIntrinsics::name_at(iid)));
 895     break;


src/share/vm/opto/callGenerator.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File