Home >Java >javaTutorial >How Can I View JIT-Compiled Code in the Java Virtual Machine (JVM)?
Viewing JIT-Compiled Code in Java Virtual Machine (JVM)
The Java Virtual Machine (JVM) features a Just-In-Time (JIT) compiler that optimizes Java bytecode into native code. To examine this native code, consider the following techniques:
General Usage
Utilize JVM options as follows:
-XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly
Specific Method Filtering
You can isolate specific methods using the following syntax:
-XX:+UnlockDiagnosticVMOptions -XX:CompileCommand=print,*MyClass.myMethod
Note:
Installation on Windows
For Windows systems, follow the instructions below to build and install required libraries:
Prebuilt Binaries
Download prebuilt binaries for Windows from the fcml project:
Manual Building
Install Cygwin with the following packages:
make OS=Linux MINGW=x86_64-w64-mingw32 'AR=$(MINGW)-ar' BINUTILS=~/binutils-2.25 (or) make OS=Linux MINGW=i686-w64-mingw32 'AR=$(MINGW)-ar' BINUTILS=~/binutils-2.25
Additional Tips
For Intel ASM syntax, use the option -XX:PrintAssemblyOptions=intel alongside the PrintAssembly options.
The above is the detailed content of How Can I View JIT-Compiled Code in the Java Virtual Machine (JVM)?. For more information, please follow other related articles on the PHP Chinese website!