< prev index next >

src/hotspot/share/opto/callGenerator.cpp

Print this page




 443   }
 444 
 445   // Now perform the inlining using the synthesized JVMState
 446   JVMState* new_jvms = _inline_cg->generate(jvms);
 447   if (new_jvms == NULL)  return;  // no change
 448   if (C->failing())      return;
 449 
 450   // Capture any exceptional control flow
 451   GraphKit kit(new_jvms);
 452 
 453   // Find the result object
 454   Node* result = C->top();
 455   int   result_size = method()->return_type()->size();
 456   if (result_size != 0 && !kit.stopped()) {
 457     result = (result_size == 1) ? kit.pop() : kit.pop_pair();
 458   }
 459 
 460   C->set_has_loops(C->has_loops() || _inline_cg->method()->has_loops());
 461   C->env()->notice_inlined_method(_inline_cg->method());
 462   C->set_inlining_progress(true);
 463 
 464   kit.replace_call(call, result, true);
 465 }
 466 
 467 
 468 CallGenerator* CallGenerator::for_late_inline(ciMethod* method, CallGenerator* inline_cg) {
 469   return new LateInlineCallGenerator(method, inline_cg);
 470 }
 471 
 472 class LateInlineMHCallGenerator : public LateInlineCallGenerator {
 473   ciMethod* _caller;
 474   int _attempt;
 475   bool _input_not_const;
 476 
 477   virtual bool do_late_inline_check(JVMState* jvms);
 478   virtual bool already_attempted() const { return _attempt > 0; }
 479 
 480  public:
 481   LateInlineMHCallGenerator(ciMethod* caller, ciMethod* callee, bool input_not_const) :
 482     LateInlineCallGenerator(callee, NULL), _caller(caller), _attempt(0), _input_not_const(input_not_const) {}
 483 




 443   }
 444 
 445   // Now perform the inlining using the synthesized JVMState
 446   JVMState* new_jvms = _inline_cg->generate(jvms);
 447   if (new_jvms == NULL)  return;  // no change
 448   if (C->failing())      return;
 449 
 450   // Capture any exceptional control flow
 451   GraphKit kit(new_jvms);
 452 
 453   // Find the result object
 454   Node* result = C->top();
 455   int   result_size = method()->return_type()->size();
 456   if (result_size != 0 && !kit.stopped()) {
 457     result = (result_size == 1) ? kit.pop() : kit.pop_pair();
 458   }
 459 
 460   C->set_has_loops(C->has_loops() || _inline_cg->method()->has_loops());
 461   C->env()->notice_inlined_method(_inline_cg->method());
 462   C->set_inlining_progress(true);
 463   C->set_do_cleanup(kit.stopped()); // path is dead; needs cleanup
 464   kit.replace_call(call, result, true);
 465 }
 466 
 467 
 468 CallGenerator* CallGenerator::for_late_inline(ciMethod* method, CallGenerator* inline_cg) {
 469   return new LateInlineCallGenerator(method, inline_cg);
 470 }
 471 
 472 class LateInlineMHCallGenerator : public LateInlineCallGenerator {
 473   ciMethod* _caller;
 474   int _attempt;
 475   bool _input_not_const;
 476 
 477   virtual bool do_late_inline_check(JVMState* jvms);
 478   virtual bool already_attempted() const { return _attempt > 0; }
 479 
 480  public:
 481   LateInlineMHCallGenerator(ciMethod* caller, ciMethod* callee, bool input_not_const) :
 482     LateInlineCallGenerator(callee, NULL), _caller(caller), _attempt(0), _input_not_const(input_not_const) {}
 483 


< prev index next >