review(M): 7057120: Tiered: Allow C1 to inline methods with loops

Vladimir Kozlov vladimir.kozlov at
Wed Jun 22 09:51:54 PDT 2011

Can you explain why in counter_overflow_helper() (c1_Runtime1.cpp) you expect 
the caller (enclosing_method) to be nmethod?

Could you rename should_not_inline() to should_not_inline_for_profile() or 
something since it is only for C1 compilation with profiling?

Add {} for else:

+        } else
+          if (next_level != CompLevel_full_optimization) {
+            // next_level is not full opt, so we need to recompile the
+            // enclosing method without the inlinee
+            cur_level = CompLevel_none;
+            make_not_entrant = true;
+          }
+        if (make_not_entrant) {

I don't understand why you need to recompile caller. It comes from a different 
frame so it did not inline callee before :

+       if (max_osr_level == CompLevel_full_optimization) {
+         // The inlinee OSRed to full opt, we need to modify the enclosing 
method to avoid deopts

Also next check should be at the beginning of this logic since "Fix up" could 
trigger unneeded recompilation:

+       if (!CompileBroker::compilation_is_in_queue(mh, InvocationEntryBci) && 
cur_level != next_level) {


Igor Veresov wrote:
> This allows inlining of methods with loops by C1 on levels with 
> profiling (2 and 3). The solution is to recompile the enclosing methods 
> without inlining of the method that has OSRed to level 4 or recompile 
> the enclosing method at level 4.
> There's no significant impact on performance because of these changes.
> Webrev:
> The change is for 7u2.
> Thanks,
> igor

More information about the hotspot-compiler-dev mailing list