couple questions on method handle combinators

Roland Westrelin rwestrel at redhat.com
Tue Jun 13 15:39:03 UTC 2017


> Below is a simple test class. Unfortunately running this crashes the VM.

Thanks for putting the test together. C2 fails to inline much of
anything...

   2131  126             GWTTest::run_Q_helper (16 bytes)
                            @ 10   java.lang.invoke.LambdaForm$MH/499105359::invoke_MT (28 bytes)   force inline by annotation
                              @ 9   java.lang.invoke.Invokers::checkGenericType (6 bytes)   force inline by annotation
                                @ 2   java.lang.invoke.MethodHandle::asType (28 bytes)   inline (hot)
                                  @ 12   java.lang.invoke.MethodHandle::asTypeCached (21 bytes)   inline (hot)
                                  @ 24   java.lang.invoke.MethodHandle::asTypeUncached (59 bytes)   too big
                              @ 16   java.lang.invoke.Invokers::checkCustomized (23 bytes)   force inline by annotation
                                @ 1   java.lang.invoke.MethodHandleImpl::isCompileConstant (2 bytes)   (intrinsic)
                                @ 19   java.lang.invoke.Invokers::maybeCustomize (28 bytes)   don't inline by annotation
                              @ 24   java.lang.invoke.MethodHandle::invokeBasic(LLI)L (0 bytes)   receiver not constant

with:

    static V run_Q_helper() throws Throwable {
        V v = (V) Q_MH_GWT.invoke(Q_V1_ARRAY, Q_V2_ARRAY, 0);
        return v;
    }

    static int run_Q() throws Throwable {
        int sum = 0;
        for (int i = 0; i < 100_000; i++) {
            V v = run_Q_helper();
            sum += v.x;
        }
        return sum;
    }

Roland.



More information about the valhalla-dev mailing list