hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
changeset 10510 ab626d1bdf53
parent 10509 43d670e5701e
child 10730 38dcf027574e
equal deleted inserted replaced
10509:43d670e5701e 10510:ab626d1bdf53
  3742 bool GraphBuilder::for_invokedynamic_inline(ciMethod* callee) {
  3742 bool GraphBuilder::for_invokedynamic_inline(ciMethod* callee) {
  3743   // Get the MethodHandle from the CallSite.
  3743   // Get the MethodHandle from the CallSite.
  3744   ciCallSite*     call_site     = stream()->get_call_site();
  3744   ciCallSite*     call_site     = stream()->get_call_site();
  3745   ciMethodHandle* method_handle = call_site->get_target();
  3745   ciMethodHandle* method_handle = call_site->get_target();
  3746 
  3746 
  3747   // Inline constant and mutable call sites.  We don't inline
  3747   // Set the callee to have access to the class and signature in the
  3748   // volatile call sites optimistically since they are specified
  3748   // MethodHandleCompiler.
  3749   // to change their value often and that would result in a lot of
  3749   method_handle->set_callee(callee);
  3750   // deoptimizations and recompiles.
  3750   method_handle->set_caller(method());
  3751   if (call_site->is_constant_call_site() || call_site->is_mutable_call_site()) {
  3751 
  3752     // Set the callee to have access to the class and signature in the
  3752   // Get an adapter for the MethodHandle.
  3753     // MethodHandleCompiler.
  3753   ciMethod* method_handle_adapter = method_handle->get_invokedynamic_adapter();
  3754     method_handle->set_callee(callee);
  3754   if (method_handle_adapter != NULL) {
  3755     method_handle->set_caller(method());
  3755     if (try_inline(method_handle_adapter, /*holder_known=*/ true)) {
  3756 
  3756       // Add a dependence for invalidation of the optimization.
  3757     // Get an adapter for the MethodHandle.
  3757       if (!call_site->is_constant_call_site()) {
  3758     ciMethod* method_handle_adapter = method_handle->get_invokedynamic_adapter();
  3758         dependency_recorder()->assert_call_site_target_value(call_site, method_handle);
  3759     if (method_handle_adapter != NULL) {
  3759       }
  3760       if (try_inline(method_handle_adapter, /*holder_known=*/ true)) {
  3760       return true;
  3761         // Add a dependence for invalidation of the optimization.
       
  3762         if (!call_site->is_constant_call_site()) {
       
  3763           dependency_recorder()->assert_call_site_target_value(call_site, method_handle);
       
  3764         }
       
  3765         return true;
       
  3766       }
       
  3767     }
  3761     }
  3768   }
  3762   }
  3769   return false;
  3763   return false;
  3770 }
  3764 }
  3771 
  3765