src/hotspot/share/opto/bytecodeInfo.cpp
changeset 50113 caf115bb98ad
parent 48024 6199dfaf72da
child 51078 fc6cfe40e32a
equal deleted inserted replaced
50112:7a2a740815b7 50113:caf115bb98ad
    27 #include "classfile/systemDictionary.hpp"
    27 #include "classfile/systemDictionary.hpp"
    28 #include "classfile/vmSymbols.hpp"
    28 #include "classfile/vmSymbols.hpp"
    29 #include "compiler/compileBroker.hpp"
    29 #include "compiler/compileBroker.hpp"
    30 #include "compiler/compileLog.hpp"
    30 #include "compiler/compileLog.hpp"
    31 #include "interpreter/linkResolver.hpp"
    31 #include "interpreter/linkResolver.hpp"
       
    32 #include "jfr/jfrEvents.hpp"
    32 #include "oops/objArrayKlass.hpp"
    33 #include "oops/objArrayKlass.hpp"
    33 #include "opto/callGenerator.hpp"
    34 #include "opto/callGenerator.hpp"
    34 #include "opto/parse.hpp"
    35 #include "opto/parse.hpp"
    35 #include "runtime/handles.inline.hpp"
    36 #include "runtime/handles.inline.hpp"
    36 #include "utilities/events.hpp"
    37 #include "utilities/events.hpp"
   482   if ( callee->get_flow_analysis()->failing())  return "not compilable (flow analysis failed)";
   483   if ( callee->get_flow_analysis()->failing())  return "not compilable (flow analysis failed)";
   483   if (!callee->can_be_parsed())                 return "cannot be parsed";
   484   if (!callee->can_be_parsed())                 return "cannot be parsed";
   484   return NULL;
   485   return NULL;
   485 }
   486 }
   486 
   487 
       
   488 static void post_inlining_event(int compile_id,const char* msg, bool success, int bci, ciMethod* caller, ciMethod* callee) {
       
   489   assert(caller != NULL, "invariant");
       
   490   assert(callee != NULL, "invariant");
       
   491   EventCompilerInlining event;
       
   492   if (event.should_commit()) {
       
   493     JfrStructCalleeMethod callee_struct;
       
   494     callee_struct.set_type(callee->holder()->name()->as_utf8());
       
   495     callee_struct.set_name(callee->name()->as_utf8());
       
   496     callee_struct.set_descriptor(callee->signature()->as_symbol()->as_utf8());
       
   497     event.set_compileId(compile_id);
       
   498     event.set_message(msg);
       
   499     event.set_succeeded(success);
       
   500     event.set_bci(bci);
       
   501     event.set_caller(caller->get_Method());
       
   502     event.set_callee(callee_struct);
       
   503     event.commit();
       
   504   }
       
   505 }
       
   506 
   487 //------------------------------print_inlining---------------------------------
   507 //------------------------------print_inlining---------------------------------
   488 void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci,
   508 void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci,
   489                                 ciMethod* caller_method, bool success) const {
   509                                 ciMethod* caller_method, bool success) const {
   490   const char* inline_msg = msg();
   510   const char* inline_msg = msg();
   491   assert(inline_msg != NULL, "just checking");
   511   assert(inline_msg != NULL, "just checking");
   505       const InlineTree *top = this;
   525       const InlineTree *top = this;
   506       while( top->caller_tree() != NULL ) { top = top->caller_tree(); }
   526       while( top->caller_tree() != NULL ) { top = top->caller_tree(); }
   507       //tty->print("  bcs: %d+%d  invoked: %d", top->count_inline_bcs(), callee_method->code_size(), callee_method->interpreter_invocation_count());
   527       //tty->print("  bcs: %d+%d  invoked: %d", top->count_inline_bcs(), callee_method->code_size(), callee_method->interpreter_invocation_count());
   508     }
   528     }
   509   }
   529   }
   510 #if INCLUDE_TRACE
   530   post_inlining_event(C->compile_id(), inline_msg, success, caller_bci, caller_method, callee_method);
   511   EventCompilerInlining event;
       
   512   if (event.should_commit()) {
       
   513     event.set_compileId(C->compile_id());
       
   514     event.set_message(inline_msg);
       
   515     event.set_succeeded(success);
       
   516     event.set_bci(caller_bci);
       
   517     event.set_caller(caller_method->get_Method());
       
   518     event.set_callee(callee_method->to_trace_struct());
       
   519     event.commit();
       
   520   }
       
   521 #endif // INCLUDE_TRACE
       
   522 }
   531 }
   523 
   532 
   524 //------------------------------ok_to_inline-----------------------------------
   533 //------------------------------ok_to_inline-----------------------------------
   525 WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms, ciCallProfile& profile, WarmCallInfo* initial_wci, bool& should_delay) {
   534 WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms, ciCallProfile& profile, WarmCallInfo* initial_wci, bool& should_delay) {
   526   assert(callee_method != NULL, "caller checks for optimized virtual!");
   535   assert(callee_method != NULL, "caller checks for optimized virtual!");