Invokedynamic deoptimization issues

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Wed Jan 14 18:40:04 UTC 2015


Sam,

The first thing I usually do is run with:
-XX:+PrintCompilation -XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining

I haven't looked at your benchmarks yet, but my main suspicion is that 
MethodHandles aren't compile-time constants, so inlining fails. Do you 
use invokedynamic bytecode or call MethodHandle.invokeExact()/invoke()? 
In the latter case, you should store MethodHandles in static final 
fields. Otherwise, JIT won't inline them.

Best regards,
Vladimir Ivanov

On 1/14/15 8:23 PM, Sam Pullara wrote:
> Hi,
>
> I've implemented a bunch of different ways for mustache.java to get data
> from names fields and methods. One thing I have noticed running benchmarks
> is that accessing the fields/methods in different ways can cause
> invokedynamic to either never be optimized or actually be deoptimized later
> during the running of the benchmarks (20x+ difference in performance). Here
> is the code I have been running:
>
> https://github.com/spullara/indybenchmark
>
> I was wondering what the best way to debug this would be?
>
> Thanks,
> Sam
>


More information about the hotspot-dev mailing list