United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6666343 Compile::has_loops not always set correctly
JDK-6666343 : Compile::has_loops not always set correctly

Details
Type:
Bug
Submit Date:
2008-02-21
Status:
Closed
Updated Date:
2011-04-20
Project Name:
JDK
Resolved Date:
2011-04-20
Component:
hotspot
OS:
solaris_9
Sub-Component:
compiler
CPU:
sparc
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs12 (b02)

Related Reports
Backport:
Backport:

Sub Tasks

Description
C2 estimates of whether a compile has loops by calling has_loops() on the root of the compile but not on any inlinees.  This means that inlining something with loops into something without loops might result in loop opts not being run.  Sometimes it will be run anyway because we have split_ifs but it certainly should take inlinees into account.

                                    

Comments
SUGGESTED FIX

diff -r a61af66fc99e src/share/vm/opto/doCall.cpp
--- a/src/share/vm/opto/doCall.cpp      Sat Dec 01 00:00:00 2007 +0000
+++ b/src/share/vm/opto/doCall.cpp      Thu Feb 21 14:46:17 2008 -0800
@@ -390,6 +390,8 @@ void Parse::do_call() {
   }

   if (cg->is_inline()) {
+    // Accumulate has_loops estimate
+    C->set_has_loops(C->has_loops() || call_method->has_loops());
     C->env()->notice_inlined_method(call_method);
   }
                                     
2008-02-21
EVALUATION

inlining should accumulate the has_loop flag.
                                     
2008-03-13
SUGGESTED FIX

repo:       /net/jano2.sfbay/export2/hotspot/hg/hotspot-comp.clean
changeset:  50:16e1cb7cde24
user:       never
date:       Tue Mar 18 11:17:37 2008 -0700
description:
6666343: Compile::has_loops not always set correctly
Summary: Compile::has_loops() should be set from inlined methods
Reviewed-by: kvn, rasbold

files:
src/share/vm/opto/doCall.cpp
                                     
2008-03-19



Hardware and Software, Engineered to Work Together