RFR: 8244413: Avoid rebinds in MethodHandle.viewAsType

Claes Redestad claes.redestad at oracle.com
Wed May 6 19:50:07 UTC 2020


On 2020-05-06 16:59, Claes Redestad wrote:
> 
> -XX:TieredStopAtLevel=1:
>          Benchmark           Mode  Cnt    Score   Error  Units
> 15-b19  Capture0.lambda_01  avgt    5    6.312 ± 0.919  ns/op
> 15-b20  Capture0.lambda_01  avgt    5  105.761 ± 7.575  ns/op
> jdk     Capture0.lambda_01  avgt    5  105.228 ± 7.175  ns/op
> 
> So outside of the direct bootstrap improvement, there's a positive
> effect during early warmup. Sadly this patch doesn't translate into an
> improvement in C1. I can see a rather large regression in C1 on this
> specific micro in 15-b20 (which is where the Hidden Classes integration
> happened).

Filed: https://bugs.openjdk.java.net/browse/JDK-8244550

Overhead is entirely in Unsafe::allocateInstance, which will be
intrinsified by C2, but has ~100ns/op overhead when called from
interpreter and C1 code.

I've prototyped a patch to remove a few redundant VM->native transitions
and gotten this overhead down to 60ns/op.

/Claes


More information about the core-libs-dev mailing list