Hotspot VM client compiler - are profile driven opt done?

Tom Rodriguez Thomas.Rodriguez at Sun.COM
Fri May 30 11:45:37 PDT 2008


> > I would like to know if there are any "profile driven  
> optimizations" done.
>
> No, the client compiler does not use profile data (only the server  
> compiler does).

We've actually built support for profile collection into the client  
compiler as part of the work for tiered compilation but C1 has no  
optimizations which take advantage of it since it's targeted a profile  
collection for use by C2.  It would be possible to build a C1 only  
system that use profile collection for optimization but it's not in  
our plans.

> > That is, will the compiled code for the threshold of 1500 (or  
> better) > be different than
> > the compiled code for the threshold of say 10 ?
>
> Most likely, the code will be the same. You only have to be aware  
> that class loading and class initialization is done lazily when  
> bytecodes are executed the first time. So when e.g. a method call  
> was never executed in the interpreter, the class could still be  
> unloaded and the compiler must generated complex patching code and  
> cannot inline the method. Therefore, setting the threshold to 0 will  
> certainly make a difference.

That will be the primary difference.  The code will most likely be a  
bit worse because the client compiler uses patching for dealing with  
unloaded classes so it might not go back and recompile the code so you  
may miss inlining opportunities.

tom



More information about the hotspot-dev mailing list