[9] RFR (S): 7177745: JSR292: Many Callsite relinkages cause target method to always run in interpreter mode

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Mon Jan 18 12:54:48 UTC 2016


JVM aggressively inlines through CallSites, even for mutable and 
volatile flavors. It's the key optimization for making invokedynamic 

When a CallSite.target is updated, JVM invalidates all affected nmethods 
and try to recompile them later. If a call site target regularly 
changes, JVM will eventually mark (after PerMethodRecompilationCutoff 
invalidations) all hot methods which have the call site bound as 
non-compilable. It leads to significant peak performance reduction, 
because all affected methods will always be executed in interpreter mode 
since then.

The fix is to avoid updating recompilation count when corresponding 
nmethod is invalidated due to a call site target change.

I filed a separate RFE (JDK-8147550 [1]) to consider slow non-inlined 
code shape for unstable call sites, as John suggested [2].

Testing: regression test, octane, JPRT.


Best regards,
Vladimir Ivanov

[1] https://bugs.openjdk.java.net/browse/JDK-8147550

More information about the hotspot-compiler-dev mailing list