@@ -112,24 +112,18 @@ static bool is_unboxing_method(ciMethod* callee_method, Compile* C) {
112112
113113// positive filter: should callee be inlined?
114114bool InlineTree::should_inline (ciMethod* callee_method, ciMethod* caller_method,
115- int caller_bci, ciCallProfile& profile,
116- WarmCallInfo* wci_result) {
115+ int caller_bci, ciCallProfile& profile) {
117116 // Allows targeted inlining
118117 if (C->directive ()->should_inline (callee_method)) {
119- *wci_result = *(WarmCallInfo::always_hot ());
120- if (C->print_inlining () && Verbose) {
121- CompileTask::print_inline_indent (inline_level ());
122- tty->print_cr (" Inlined method is hot: " );
123- }
124118 set_msg (" force inline by CompileCommand" );
125119 _forced_inline = true ;
126120 return true ;
127121 }
128122
129123 if (callee_method->force_inline ()) {
130- set_msg (" force inline by annotation" );
131- _forced_inline = true ;
132- return true ;
124+ set_msg (" force inline by annotation" );
125+ _forced_inline = true ;
126+ return true ;
133127 }
134128
135129#ifndef PRODUCT
@@ -146,7 +140,6 @@ bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method,
146140 // Check for too many throws (and not too huge)
147141 if (callee_method->interpreter_throwout_count () > InlineThrowCount &&
148142 size < InlineThrowMaxSize ) {
149- wci_result->set_profit (wci_result->profit () * 100 );
150143 if (C->print_inlining () && Verbose) {
151144 CompileTask::print_inline_indent (inline_level ());
152145 tty->print_cr (" Inlined method with many throws (throws=%d):" , callee_method->interpreter_throwout_count ());
@@ -202,8 +195,7 @@ bool InlineTree::should_inline(ciMethod* callee_method, ciMethod* caller_method,
202195// negative filter: should callee NOT be inlined?
203196bool InlineTree::should_not_inline (ciMethod *callee_method,
204197 ciMethod* caller_method,
205- JVMState* jvms,
206- WarmCallInfo* wci_result) {
198+ JVMState* jvms) {
207199
208200 const char * fail_msg = NULL ;
209201
@@ -361,7 +353,7 @@ bool InlineTree::is_not_reached(ciMethod* callee_method, ciMethod* caller_method
361353// Relocated from "InliningClosure::try_to_inline"
362354bool InlineTree::try_to_inline (ciMethod* callee_method, ciMethod* caller_method,
363355 int caller_bci, JVMState* jvms, ciCallProfile& profile,
364- WarmCallInfo* wci_result, bool & should_delay) {
356+ bool & should_delay) {
365357
366358 if (ClipInlining && (int )count_inline_bcs () >= DesiredMethodLimit) {
367359 if (!callee_method->force_inline () || !IncrementalInline) {
@@ -373,11 +365,10 @@ bool InlineTree::try_to_inline(ciMethod* callee_method, ciMethod* caller_method,
373365 }
374366
375367 _forced_inline = false ; // Reset
376- if (!should_inline (callee_method, caller_method, caller_bci, profile,
377- wci_result)) {
368+ if (!should_inline (callee_method, caller_method, caller_bci, profile)) {
378369 return false ;
379370 }
380- if (should_not_inline (callee_method, caller_method, jvms, wci_result )) {
371+ if (should_not_inline (callee_method, caller_method, jvms)) {
381372 return false ;
382373 }
383374
@@ -560,7 +551,8 @@ void InlineTree::print_inlining(ciMethod* callee_method, int caller_bci,
560551}
561552
562553// ------------------------------ok_to_inline-----------------------------------
563- WarmCallInfo* InlineTree::ok_to_inline (ciMethod* callee_method, JVMState* jvms, ciCallProfile& profile, WarmCallInfo* initial_wci, bool & should_delay) {
554+ bool InlineTree::ok_to_inline (ciMethod* callee_method, JVMState* jvms, ciCallProfile& profile,
555+ bool & should_delay) {
564556 assert (callee_method != NULL , " caller checks for optimized virtual!" );
565557 assert (!should_delay, " should be initialized to false" );
566558#ifdef ASSERT
@@ -580,68 +572,35 @@ WarmCallInfo* InlineTree::ok_to_inline(ciMethod* callee_method, JVMState* jvms,
580572 if (!pass_initial_checks (caller_method, caller_bci, callee_method)) {
581573 set_msg (" failed initial checks" );
582574 print_inlining (callee_method, caller_bci, caller_method, false /* !success */ );
583- return NULL ;
575+ return false ;
584576 }
585577
586578 // Do some parse checks.
587579 set_msg (check_can_parse (callee_method));
588580 if (msg () != NULL ) {
589581 print_inlining (callee_method, caller_bci, caller_method, false /* !success */ );
590- return NULL ;
582+ return false ;
591583 }
592584
593585 // Check if inlining policy says no.
594- WarmCallInfo wci = *(initial_wci);
595- bool success = try_to_inline (callee_method, caller_method, caller_bci,
596- jvms, profile, &wci, should_delay);
597-
598- #ifndef PRODUCT
599- if (InlineWarmCalls && (PrintOpto || C->print_inlining ())) {
600- bool cold = wci.is_cold ();
601- bool hot = !cold && wci.is_hot ();
602- bool old_cold = !success;
603- if (old_cold != cold || (Verbose || WizardMode)) {
604- if (msg () == NULL ) {
605- set_msg (" OK" );
606- }
607- tty->print (" OldInlining= %4s : %s\n WCI=" ,
608- old_cold ? " cold" : " hot" , msg ());
609- wci.print ();
610- }
611- }
612- #endif
586+ bool success = try_to_inline (callee_method, caller_method, caller_bci, jvms, profile,
587+ should_delay); // out
613588 if (success) {
614- wci = *(WarmCallInfo::always_hot ());
615- } else {
616- wci = *(WarmCallInfo::always_cold ());
617- }
618-
619- if (!InlineWarmCalls) {
620- if (!wci.is_cold () && !wci.is_hot ()) {
621- // Do not inline the warm calls.
622- wci = *(WarmCallInfo::always_cold ());
623- }
624- }
625-
626- if (!wci.is_cold ()) {
627589 // Inline!
628590 if (msg () == NULL ) {
629591 set_msg (" inline (hot)" );
630592 }
631593 print_inlining (callee_method, caller_bci, caller_method, true /* success */ );
632594 build_inline_tree_for_callee (callee_method, jvms, caller_bci);
633- if (InlineWarmCalls && !wci.is_hot ()) {
634- return new (C) WarmCallInfo (wci); // copy to heap
595+ return true ;
596+ } else {
597+ // Do not inline
598+ if (msg () == NULL ) {
599+ set_msg (" too cold to inline" );
635600 }
636- return WarmCallInfo::always_hot ();
637- }
638-
639- // Do not inline
640- if (msg () == NULL ) {
641- set_msg (" too cold to inline" );
601+ print_inlining (callee_method, caller_bci, caller_method, false /* !success */ );
602+ return false ;
642603 }
643- print_inlining (callee_method, caller_bci, caller_method, false /* !success */ );
644- return NULL ;
645604}
646605
647606// ------------------------------build_inline_tree_for_callee-------------------
0 commit comments