Accurate Profiling of Dynamically Compiled Code with Bytecode Instrumentation
Many profilers based on bytecode instrumentation yield wrong results in the presence of an optimizing dynamic compiler, either due to not being aware of compiler optimizations or due to the inserted code disrupting some optimizations. To avoid such perturbations, we present a technique to make any profiler implemented at the bytecode level aware of optimizations performed by the dynamic compiler. We implement our approach in a state-of-the-art Java virtual machine and evaluate it with several profilers. Joint work with Yudi Zheng and Lubomir Bulej.