src/share/vm/opto/bytecodeInfo.cpp

Print this page
rev 3898 : 8005031: Some cleanup in c2 to prepare for incremental inlining support
Summary: collection of small changes to prepare for incremental inlining.
Reviewed-by:


 386   // and ignore such exceptions and do not attempt to compile the method.
 387   if( callee_method->should_exclude() )  return false;
 388 
 389   return true;
 390 }
 391 
 392 //------------------------------check_can_parse--------------------------------
 393 const char* InlineTree::check_can_parse(ciMethod* callee) {
 394   // Certain methods cannot be parsed at all:
 395   if ( callee->is_native())                     return "native method";
 396   if ( callee->is_abstract())                   return "abstract method";
 397   if (!callee->can_be_compiled())               return "not compilable (disabled)";
 398   if (!callee->has_balanced_monitors())         return "not compilable (unbalanced monitors)";
 399   if ( callee->get_flow_analysis()->failing())  return "not compilable (flow analysis failed)";
 400   return NULL;
 401 }
 402 
 403 //------------------------------print_inlining---------------------------------
 404 // Really, the failure_msg can be a success message also.
 405 void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci, const char* failure_msg) const {
 406   CompileTask::print_inlining(callee_method, inline_level(), caller_bci, failure_msg ? failure_msg : "inline");
 407   if (callee_method == NULL)  tty->print(" callee not monotonic or profiled");
 408   if (Verbose && callee_method) {
 409     const InlineTree *top = this;
 410     while( top->caller_tree() != NULL ) { top = top->caller_tree(); }
 411     //tty->print("  bcs: %d+%d  invoked: %d", top->count_inline_bcs(), callee_method->code_size(), callee_method->interpreter_invocation_count());
 412   }
 413 }
 414 
 415 //------------------------------ok_to_inline-----------------------------------
 416 WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms, ciCallProfile& profile, WarmCallInfo* initial_wci) {
 417   assert(callee_method != NULL, "caller checks for optimized virtual!");
 418 #ifdef ASSERT
 419   // Make sure the incoming jvms has the same information content as me.
 420   // This means that we can eventually make this whole class AllStatic.
 421   if (jvms->caller() == NULL) {
 422     assert(_caller_jvms == NULL, "redundant instance state");
 423   } else {
 424     assert(_caller_jvms->same_calls_as(jvms->caller()), "redundant instance state");
 425   }
 426   assert(_method == jvms->method(), "redundant instance state");




 386   // and ignore such exceptions and do not attempt to compile the method.
 387   if( callee_method->should_exclude() )  return false;
 388 
 389   return true;
 390 }
 391 
 392 //------------------------------check_can_parse--------------------------------
 393 const char* InlineTree::check_can_parse(ciMethod* callee) {
 394   // Certain methods cannot be parsed at all:
 395   if ( callee->is_native())                     return "native method";
 396   if ( callee->is_abstract())                   return "abstract method";
 397   if (!callee->can_be_compiled())               return "not compilable (disabled)";
 398   if (!callee->has_balanced_monitors())         return "not compilable (unbalanced monitors)";
 399   if ( callee->get_flow_analysis()->failing())  return "not compilable (flow analysis failed)";
 400   return NULL;
 401 }
 402 
 403 //------------------------------print_inlining---------------------------------
 404 // Really, the failure_msg can be a success message also.
 405 void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci, const char* failure_msg) const {
 406   C->print_inlining(callee_method, inline_level(), caller_bci, failure_msg ? failure_msg : "inline");
 407   if (callee_method == NULL)  tty->print(" callee not monotonic or profiled");
 408   if (Verbose && callee_method) {
 409     const InlineTree *top = this;
 410     while( top->caller_tree() != NULL ) { top = top->caller_tree(); }
 411     //tty->print("  bcs: %d+%d  invoked: %d", top->count_inline_bcs(), callee_method->code_size(), callee_method->interpreter_invocation_count());
 412   }
 413 }
 414 
 415 //------------------------------ok_to_inline-----------------------------------
 416 WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms, ciCallProfile& profile, WarmCallInfo* initial_wci) {
 417   assert(callee_method != NULL, "caller checks for optimized virtual!");
 418 #ifdef ASSERT
 419   // Make sure the incoming jvms has the same information content as me.
 420   // This means that we can eventually make this whole class AllStatic.
 421   if (jvms->caller() == NULL) {
 422     assert(_caller_jvms == NULL, "redundant instance state");
 423   } else {
 424     assert(_caller_jvms->same_calls_as(jvms->caller()), "redundant instance state");
 425   }
 426   assert(_method == jvms->method(), "redundant instance state");