--- old/test/compiler/valhalla/valuetypes/ValueTypeTestBench.java 2017-07-06 17:29:09.609225766 +0200 +++ new/test/compiler/valhalla/valuetypes/ValueTypeTestBench.java 2017-07-06 17:29:04.630248121 +0200 @@ -2422,6 +2422,14 @@ MethodType test86_mt = MethodType.fromMethodDescriptorString("(Qcompiler/valhalla/valuetypes/MyValue1;)I", ValueTypeTestBench.class.getClassLoader()); test86_mh = lookup.findVirtual(ValueTypeTestBench.class, "test86_target", test86_mt); + + MethodType test94_mt = MethodType.fromMethodDescriptorString("()Qcompiler/valhalla/valuetypes/MyValue3;", ValueTypeTestBench.class.getClassLoader()); + MethodHandle test94_mh1 = lookup.findVirtual(ValueTypeTestBench.class, "test94_target1", test94_mt); + MethodHandle test94_mh2 = lookup.findVirtual(ValueTypeTestBench.class, "test94_target2", test94_mt); + MethodType test94_mt2 = MethodType.methodType(boolean.class); + MethodHandle test94_mh_test = lookup.findVirtual(ValueTypeTestBench.class, "test94_test", test94_mt2); + test94_mh = MethodHandles.guardWithTest(test94_mh_test, test94_mh1, test94_mh2); + } catch (NoSuchMethodException|IllegalAccessException e) { throw new RuntimeException("method handle lookup fails"); } @@ -2605,6 +2613,42 @@ Asserts.assertEQ(result, 0L); } + // method handle combinators + final MyValue3 test94_vt1 = MyValue3.create(); + @ForceInline + MyValue3 test94_target1() { + return test94_vt1; + } + + final MyValue3 test94_vt2 = MyValue3.create(); + @ForceInline + MyValue3 test94_target2() { + return test94_vt2; + } + + boolean test94_bool = true; + @ForceInline + boolean test94_test() { + return test94_bool; + } + + static final MethodHandle test94_mh; + + // @Test(valid = ValueTypeReturnedAsFieldsOn, failOn = ALLOC + ALLOCA + STORE) + // @Test(valid = ValueTypeReturnedAsFieldsOff) + @Test() + MyValue3 test94() throws Throwable { + return (MyValue3)test94_mh.invokeExact(this); + } + + @DontCompile + public void test94_verifier(boolean warmup) throws Throwable { + test94_bool = !test94_bool; + MyValue3 vt = test94(); + //vt.verify(test94_bool ? test94_vt1 : test94_vt2); + } + + // ========== Test infrastructure ========== private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); @@ -2679,7 +2723,7 @@ } public static void main(String[] args) throws Throwable { - //tests.values().removeIf(p -> !p.getName().equals("test85")); // Run single test + //tests.values().removeIf(p -> !p.getName().equals("test94")); // Run single test if (args.length == 0) { execute_vm("-XX:+IgnoreUnrecognizedVMOptions", "-XX:-BackgroundCompilation", "-XX:+PrintCompilation", "-XX:+PrintInlining", "-XX:+PrintIdeal", "-XX:+PrintOptoAssembly",