review for 7071307: MethodHandle bimorphic inlining should consider the frequency

Charles Oliver Nutter headius at
Mon Aug 8 14:29:46 PDT 2011

On Thu, Jul 28, 2011 at 7:47 PM, Tom Rodriguez <tom.rodriguez at> wrote:
> 46 lines changed: 27 ins; 6 del; 13 mod; 3568 unchg
> 7071307: MethodHandle bimorphic inlining should consider the frequency
> Reviewed-by:
> The fix for 7050554 added a bimorphic inline path but didn't take into
> account the frequency of the guarding test.  This ends up treating
> both sides of the if as equally frequent which can lead to over
> inlining and overflowing the method inlining limits.  The fix is to
> grab the frequency from the If and apply that to the branches.  This
> addresses a major source of overinlining that can result in bad
> performance with JSR 292.  We may do a later extension to this to
> actually do per call chain profiling of selectAlternative but that's a
> more complicated fix.
> I also fixed a problem with the ideal graph printer where debug_orig
> printing would go into an infinite loop.
> Tested with jruby and vm.mlvm tests.

Building on Ubuntu (an admittedly old install) yields some warnings
that are turned into errors:

-I/home/headius/hsx-hotspot/src/os/posix/vm -I../generated
-DTARGET_OS_ARCH_linux_x86 -DTARGET_OS_ARCH_MODEL_linux_x86_32
-fno-exceptions -D_REENTRANT -fcheck-new -m32 -march=i586 -pipe -O3
-fno-strict-aliasing -DVM_LITTLE_ENDIAN -Werror -Wpointer-arith
-Wconversion -Wsign-compare    -c -MMD -MP -MF
../generated/dependencies/precompiled.hpp.gch.d -x c++-header
/home/headius/hsx-hotspot/src/share/vm/precompiled.hpp -o
cc1plus: warnings being treated as errors
/home/headius/hsx-hotspot/src/share/vm/ci/ciCallProfile.hpp: In member
function 'ciCallProfile ciCallProfile::rescale(double)':
warning: converting to 'int' from 'double'
warning: converting to 'int' from 'double'

The lines in question are doing (int) *= (double), which gcc complains
about. Ubuntu probably has warnings set up to be errors, so it fails
the build.

I modified them in my local copy to do the long form with an explicit
cast back to int, but you can fix in whatever way is best.

- Charlie

More information about the hotspot-compiler-dev mailing list