Despite just-in-time (JIT) compilation being a crucial aspect of optimizing Java Virtual Machine (JVM) performance, directly viewing its output code can be challenging. However, there are specific JVM options that allow for examining the native code generated by the JIT.
The following JVM options can be added to command lines:
These options provide verbose output and include generated assembly instructions.
To limit the output to a particular method, use the syntax:
For Windows systems, installing hsdis-amd64.dll and hsdis-i386.dll is necessary to access the PrintAssembly functionality. Prebuilt binaries are available from the fcml project, or they can be built manually using Cygwin and binutils.
Building hsdis-amd64.dll and hsdis-i386.dll on Windows
Install Cygwin and select the following packages:
Bonus Tip
To display assembly instructions using Intel rather than AT&T syntax, add -XX:PrintAssemblyOptions=intel to the JVM options.
The above is the detailed content of How Can I View JIT-Compiled Code Generated by the JVM?. For more information, please follow other related articles on the PHP Chinese website!