RFR (M): 8069591: Customize LambdaForms which are invoked using MH.invoke/invokeExact
forax at univ-mlv.fr
Wed Jan 21 17:31:05 UTC 2015
in Invokers.java, I think that checkCustomized should take an Object and
not a MethodHandle
exactly like getCallSiteTarget takes an Object and not a CallSite.
in MethodHandle.java, customizationCount is declared as a byte and there
is no check that
the CUSTOMIZE_THRESHOLD is not greater than 127.
On 01/21/2015 05:25 PM, Vladimir Ivanov wrote:
> Overhead of non-inlined MH.invoke/invokeExact calls significantly
> increased with LambdaForm sharing. The cause is JIT compiler can't
> produce a single nmethod for the whole MethodHandle chain, so the
> execution is spread around numerous nmethods (1 per each MethodHandle
> in the chain). The longer the chain the larger overhead.
> The fix is to customize LambdaForms (create a dedicated LambdaForm for
> a MethodHandle). Per-MethodHandle count is introduced, which is
> incremented every time a MethodHandle is invoked using
> MethodHandle.invoke/invokeExact. Once CUSTOMIZE_THRESHOLD is reached
> for a particular MethodHandle, it's LambdaForm is substituted with a
> customized one, which has it's MethodHandle embedded. It allows JIT to
> see actual MethodHandle during compilation and produce more efficient
> This fix completely recovers Gbemu peak performance to pre-LambdaForm
> sharing level.
> Testing: jck (api/java_lang/invoke), jdk/java/lang/invoke, nashorn
> tests, nashorn/octane
> Best regards,
> Vladimir Ivanov
> mlvm-dev mailing list
> mlvm-dev at openjdk.java.net
More information about the core-libs-dev