comparison src/share/vm/opto/callGenerator.cpp @ 3894:b27c72d69fd1

7083184: JSR 292: don't store context class argument with call site dependencies Reviewed-by: jrose, never
author twisti
date Mon, 29 Aug 2011 05:07:35 -0700
parents fdb992d83a87
children a32de5085326
comparison
equal deleted inserted replaced
3893:8805f8c1e23e 3894:b27c72d69fd1
334 assert(!m->is_abstract(), "for_direct_call mismatch"); 334 assert(!m->is_abstract(), "for_direct_call mismatch");
335 return new DirectCallGenerator(m, separate_io_proj); 335 return new DirectCallGenerator(m, separate_io_proj);
336 } 336 }
337 337
338 CallGenerator* CallGenerator::for_dynamic_call(ciMethod* m) { 338 CallGenerator* CallGenerator::for_dynamic_call(ciMethod* m) {
339 assert(m->is_method_handle_invoke(), "for_dynamic_call mismatch"); 339 assert(m->is_method_handle_invoke() || m->is_method_handle_adapter(), "for_dynamic_call mismatch");
340 return new DynamicCallGenerator(m); 340 return new DynamicCallGenerator(m);
341 } 341 }
342 342
343 CallGenerator* CallGenerator::for_virtual_call(ciMethod* m, int vtable_index) { 343 CallGenerator* CallGenerator::for_virtual_call(ciMethod* m, int vtable_index) {
344 assert(!m->is_static(), "for_virtual_call mismatch"); 344 assert(!m->is_static(), "for_virtual_call mismatch");
713 method_handle->set_call_profile(profile); 713 method_handle->set_call_profile(profile);
714 714
715 // Get an adapter for the MethodHandle. 715 // Get an adapter for the MethodHandle.
716 ciMethod* target_method = method_handle->get_method_handle_adapter(); 716 ciMethod* target_method = method_handle->get_method_handle_adapter();
717 if (target_method != NULL) { 717 if (target_method != NULL) {
718 CallGenerator* hit_cg = Compile::current()->call_generator(target_method, -1, false, jvms, true, 1); 718 CallGenerator* cg = Compile::current()->call_generator(target_method, -1, false, jvms, true, PROB_ALWAYS);
719 if (hit_cg != NULL && hit_cg->is_inline()) 719 if (cg != NULL && cg->is_inline())
720 return hit_cg; 720 return cg;
721 } 721 }
722 } else if (method_handle->Opcode() == Op_Phi && method_handle->req() == 3 && 722 } else if (method_handle->Opcode() == Op_Phi && method_handle->req() == 3 &&
723 method_handle->in(1)->Opcode() == Op_ConP && method_handle->in(2)->Opcode() == Op_ConP) { 723 method_handle->in(1)->Opcode() == Op_ConP && method_handle->in(2)->Opcode() == Op_ConP) {
724 // selectAlternative idiom merging two constant MethodHandles. 724 // selectAlternative idiom merging two constant MethodHandles.
725 // Generate a guard so that each can be inlined. We might want to 725 // Generate a guard so that each can be inlined. We might want to
752 752
753 // Get an adapter for the MethodHandle. 753 // Get an adapter for the MethodHandle.
754 ciMethod* target_method = method_handle->get_invokedynamic_adapter(); 754 ciMethod* target_method = method_handle->get_invokedynamic_adapter();
755 if (target_method != NULL) { 755 if (target_method != NULL) {
756 Compile *C = Compile::current(); 756 Compile *C = Compile::current();
757 CallGenerator* hit_cg = C->call_generator(target_method, -1, false, jvms, true, PROB_ALWAYS); 757 CallGenerator* cg = C->call_generator(target_method, -1, false, jvms, true, PROB_ALWAYS);
758 if (hit_cg != NULL && hit_cg->is_inline()) { 758 if (cg != NULL && cg->is_inline()) {
759 // Add a dependence for invalidation of the optimization. 759 // Add a dependence for invalidation of the optimization.
760 if (call_site->is_mutable_call_site()) { 760 if (call_site->is_mutable_call_site()) {
761 C->dependencies()->assert_call_site_target_value(C->env()->CallSite_klass(), call_site, method_handle); 761 C->dependencies()->assert_call_site_target_value(call_site, method_handle);
762 } 762 }
763 return hit_cg; 763 return cg;
764 } 764 }
765 } 765 }
766 return NULL; 766 return NULL;
767 } 767 }
768 768