hotspot/src/share/vm/c1/c1_GraphBuilder.cpp
changeset 33626 3c94db05e903
parent 33589 7cbd1b2c139b
parent 33451 0712796e4039
child 33638 ef49ed90010b
equal deleted inserted replaced
33625:18e7896ca9fe 33626:3c94db05e903
  3363   return NULL;
  3363   return NULL;
  3364 }
  3364 }
  3365 
  3365 
  3366 // negative filter: should callee NOT be inlined?  returns NULL, ok to inline, or rejection msg
  3366 // negative filter: should callee NOT be inlined?  returns NULL, ok to inline, or rejection msg
  3367 const char* GraphBuilder::should_not_inline(ciMethod* callee) const {
  3367 const char* GraphBuilder::should_not_inline(ciMethod* callee) const {
  3368   if ( callee->should_not_inline())    return "disallowed by CompileCommand";
  3368   if ( compilation()->directive()->should_not_inline(callee)) return "disallowed by CompileCommand";
  3369   if ( callee->dont_inline())          return "don't inline by annotation";
  3369   if ( callee->dont_inline())          return "don't inline by annotation";
  3370   return NULL;
  3370   return NULL;
  3371 }
  3371 }
  3372 
  3372 
  3373 void GraphBuilder::build_graph_for_intrinsic(ciMethod* callee) {
  3373 void GraphBuilder::build_graph_for_intrinsic(ciMethod* callee) {
  3492   // accesses critical VM-internal data.
  3492   // accesses critical VM-internal data.
  3493   bool is_available = false;
  3493   bool is_available = false;
  3494   {
  3494   {
  3495     VM_ENTRY_MARK;
  3495     VM_ENTRY_MARK;
  3496     methodHandle mh(THREAD, callee->get_Method());
  3496     methodHandle mh(THREAD, callee->get_Method());
  3497     methodHandle ct(THREAD, method()->get_Method());
  3497     is_available = _compilation->compiler()->is_intrinsic_available(mh, _compilation->directive());
  3498     is_available = _compilation->compiler()->is_intrinsic_available(mh, ct);
       
  3499   }
  3498   }
  3500 
  3499 
  3501   if (!is_available) {
  3500   if (!is_available) {
  3502     if (!InlineNatives) {
  3501     if (!InlineNatives) {
  3503       // Return false and also set message that the inlining of
  3502       // Return false and also set message that the inlining of
  3688   if (is_profiling() && !callee->ensure_method_data()) {
  3687   if (is_profiling() && !callee->ensure_method_data()) {
  3689     INLINE_BAILOUT("mdo allocation failed");
  3688     INLINE_BAILOUT("mdo allocation failed");
  3690   }
  3689   }
  3691 
  3690 
  3692   // now perform tests that are based on flag settings
  3691   // now perform tests that are based on flag settings
  3693   if (callee->force_inline() || callee->should_inline()) {
  3692   bool inlinee_by_directive = compilation()->directive()->should_inline(callee);
       
  3693   if (callee->force_inline() || inlinee_by_directive) {
  3694     if (inline_level() > MaxForceInlineLevel                    ) INLINE_BAILOUT("MaxForceInlineLevel");
  3694     if (inline_level() > MaxForceInlineLevel                    ) INLINE_BAILOUT("MaxForceInlineLevel");
  3695     if (recursive_inline_level(callee) > MaxRecursiveInlineLevel) INLINE_BAILOUT("recursive inlining too deep");
  3695     if (recursive_inline_level(callee) > MaxRecursiveInlineLevel) INLINE_BAILOUT("recursive inlining too deep");
  3696 
  3696 
  3697     const char* msg = "";
  3697     const char* msg = "";
  3698     if (callee->force_inline())  msg = "force inline by annotation";
  3698     if (callee->force_inline())  msg = "force inline by annotation";
  3699     if (callee->should_inline()) msg = "force inline by CompileCommand";
  3699     if (inlinee_by_directive)    msg = "force inline by CompileCommand";
  3700     print_inlining(callee, msg);
  3700     print_inlining(callee, msg);
  3701   } else {
  3701   } else {
  3702     // use heuristic controls on inlining
  3702     // use heuristic controls on inlining
  3703     if (inline_level() > MaxInlineLevel                         ) INLINE_BAILOUT("inlining too deep");
  3703     if (inline_level() > MaxInlineLevel                         ) INLINE_BAILOUT("inlining too deep");
  3704     if (recursive_inline_level(callee) > MaxRecursiveInlineLevel) INLINE_BAILOUT("recursive inlining too deep");
  3704     if (recursive_inline_level(callee) > MaxRecursiveInlineLevel) INLINE_BAILOUT("recursive inlining too deep");
  4205     event.set_caller(method()->get_Method());
  4205     event.set_caller(method()->get_Method());
  4206     event.set_callee(callee->to_trace_struct());
  4206     event.set_callee(callee->to_trace_struct());
  4207     event.commit();
  4207     event.commit();
  4208   }
  4208   }
  4209 #endif // INCLUDE_TRACE
  4209 #endif // INCLUDE_TRACE
  4210   if (!PrintInlining && !compilation()->method()->has_option("PrintInlining")) {
  4210 
       
  4211   if (!compilation()->directive()->PrintInliningOption) {
  4211     return;
  4212     return;
  4212   }
  4213   }
  4213   CompileTask::print_inlining_tty(callee, scope()->level(), bci(), msg);
  4214   CompileTask::print_inlining_tty(callee, scope()->level(), bci(), msg);
  4214   if (success && CIPrintMethodCodes) {
  4215   if (success && CIPrintMethodCodes) {
  4215     callee->print_codes();
  4216     callee->print_codes();