detecting jit compilation

Mikael Gerdin mikael.gerdin at oracle.com
Tue Sep 2 18:46:28 UTC 2014


Hi Tom,

On Tuesday 02 September 2014 18.12.21 Deneau, Tom wrote:
> Hi All --
> 
> I was directed to this list for the following question which I asked on the
> jmh-dev list
> 
>     Is there a way thru Management Beans that I can find out from the Java
>     side whether a particular method has been JIT compiled?
> 
> Aleksey Shipilev mentioned the WhiteBox API which I am not familiar with. 
> Is this something that can be used today from Java 8?

The WhiteBox API is an internal testing API. It's used by some compiler tests, 
see:
http://hg.openjdk.java.net/jdk9/hs-gc/hotspot/file/f80bb126b5bb/test/compiler/whitebox/IsMethodCompilableTest.java

The VM-side implementation is located at:
http://hg.openjdk.java.net/jdk9/hs-gc/hotspot/file/f80bb126b5bb/src/share/vm/prims/whitebox.cpp

I cannot stress this enough: this is by no means intended to be used in any 
production type environment. If it crashes you get to keep the pieces.
It is primarily designed to be used during JVM development.

/Mikael

> 
> -- Tom



More information about the hotspot-dev mailing list