RFR(M): 8156915: introduce MethodHandle factory for array length
Uwe Schindler
uschindler at apache.org
Wed May 18 12:48:21 UTC 2016
Hi,
> > P.S.: I am not so familiar with the intrinsic stuff, so here is my question: The
> intrinsic for the array accesses is always created before caching the MH; so
> why do we need the static implementation methods at all? I had the same
> question also about the old element getters and setters. Or is the intrinsic
> only used after the MH is called multiple times as "optimization"? If the latter
> is the case, the test should ensure that the intrinsics are tested, too.
> Intrinsics (in j.l.i sense) are just markers for bytecode generator
> (j.l.i.InvokerBytecodeGenerator or IBG) which signals there's a more
> efficient way to represent the behavior on bytecode level.
>
> There are 2 execution modes supported for LambdaForms:
> - interpreter (LFI)
> - compiled (to bytecode by IGB)
>
> Static implementation methods are needed for LFI.
>
> Since 8u40, all LFs are always precompiled to bytecode before usage (
> invocation threshold == 0) thus bypassing interpretation phase.
>
> The test case could be extended to test LFI scenario, but I don't think
> it's worth it.
>
> It's more productive to include additional test configuration with
> -Djava.lang.invoke.MethodHandle.COMPILE_THRESHOLD=30 when testing
> j.l.i
> changes to ensure LFI isn't broken.
Thanks Vladimir! This is how I understood it, but I did not see the place in code where the actual switch between those "modes" is done, as I have seen they are compiled-up-front.
Theoretically at some point, the LFI code could be removed from JDK, right?
Uwe
More information about the core-libs-dev
mailing list