< prev index next >

test/hotspot/jtreg/compiler/valhalla/valuetypes/TestMethodHandles.java

Print this page

        

*** 60,91 **** try { Class<?> clazz = TestMethodHandles.class; ClassLoader loader = clazz.getClassLoader(); MethodHandles.Lookup lookup = MethodHandles.lookup(); ! MethodType mt = MethodType.methodType(MyValue3.class); test1_mh = lookup.findVirtual(clazz, "test1_target", mt); test2_mh = lookup.findVirtual(clazz, "test2_target", mt); test3_mh = lookup.findVirtual(clazz, "test3_target", mt); ! MethodType test4_mt1 = MethodType.methodType(int.class, MyValue1.class); ! MethodType test4_mt2 = MethodType.methodType(MyValue1.class); MethodHandle test4_mh1 = lookup.findStatic(clazz, "test4_helper1", test4_mt1); MethodHandle test4_mh2 = lookup.findStatic(clazz, "test4_helper2", test4_mt2); test4_mh = MethodHandles.filterReturnValue(test4_mh2, test4_mh1); ! MethodType test5_mt = MethodType.methodType(int.class, MyValue1.class); test5_mh = lookup.findVirtual(clazz, "test5_target", test5_mt); ! MethodType test6_mt = MethodType.methodType(MyValue3.class); MethodHandle test6_mh1 = lookup.findVirtual(clazz, "test6_target1", test6_mt); MethodHandle test6_mh2 = lookup.findVirtual(clazz, "test6_target2", test6_mt); MethodType boolean_mt = MethodType.methodType(boolean.class); MethodHandle test6_mh_test = lookup.findVirtual(clazz, "test6_test", boolean_mt); test6_mh = MethodHandles.guardWithTest(test6_mh_test, test6_mh1, test6_mh2); ! MethodType myvalue2_mt = MethodType.methodType(MyValue2.class); test7_mh1 = lookup.findStatic(clazz, "test7_target1", myvalue2_mt); MethodHandle test7_mh2 = lookup.findStatic(clazz, "test7_target2", myvalue2_mt); MethodHandle test7_mh_test = lookup.findStatic(clazz, "test7_test", boolean_mt); test7_mh = MethodHandles.guardWithTest(test7_mh_test, MethodHandles.invoker(myvalue2_mt), --- 60,91 ---- try { Class<?> clazz = TestMethodHandles.class; ClassLoader loader = clazz.getClassLoader(); MethodHandles.Lookup lookup = MethodHandles.lookup(); ! MethodType mt = MethodType.methodType(MyValue3.class.asValueType()); test1_mh = lookup.findVirtual(clazz, "test1_target", mt); test2_mh = lookup.findVirtual(clazz, "test2_target", mt); test3_mh = lookup.findVirtual(clazz, "test3_target", mt); ! MethodType test4_mt1 = MethodType.methodType(int.class, MyValue1.class.asValueType()); ! MethodType test4_mt2 = MethodType.methodType(MyValue1.class.asValueType()); MethodHandle test4_mh1 = lookup.findStatic(clazz, "test4_helper1", test4_mt1); MethodHandle test4_mh2 = lookup.findStatic(clazz, "test4_helper2", test4_mt2); test4_mh = MethodHandles.filterReturnValue(test4_mh2, test4_mh1); ! MethodType test5_mt = MethodType.methodType(int.class, MyValue1.class.asValueType()); test5_mh = lookup.findVirtual(clazz, "test5_target", test5_mt); ! MethodType test6_mt = MethodType.methodType(MyValue3.class.asValueType()); MethodHandle test6_mh1 = lookup.findVirtual(clazz, "test6_target1", test6_mt); MethodHandle test6_mh2 = lookup.findVirtual(clazz, "test6_target2", test6_mt); MethodType boolean_mt = MethodType.methodType(boolean.class); MethodHandle test6_mh_test = lookup.findVirtual(clazz, "test6_test", boolean_mt); test6_mh = MethodHandles.guardWithTest(test6_mh_test, test6_mh1, test6_mh2); ! MethodType myvalue2_mt = MethodType.methodType(MyValue2.class.asValueType()); test7_mh1 = lookup.findStatic(clazz, "test7_target1", myvalue2_mt); MethodHandle test7_mh2 = lookup.findStatic(clazz, "test7_target2", myvalue2_mt); MethodHandle test7_mh_test = lookup.findStatic(clazz, "test7_test", boolean_mt); test7_mh = MethodHandles.guardWithTest(test7_mh_test, MethodHandles.invoker(myvalue2_mt),
*** 96,122 **** MethodHandle test8_mh_test = lookup.findStatic(clazz, "test8_test", boolean_mt); test8_mh = MethodHandles.guardWithTest(test8_mh_test, MethodHandles.dropArguments(test8_mh1, 0, MethodHandle.class), MethodHandles.invoker(myvalue2_mt)); ! MethodType test9_mt = MethodType.methodType(MyValue3.class); MethodHandle test9_mh1 = lookup.findVirtual(clazz, "test9_target1", test9_mt); MethodHandle test9_mh2 = lookup.findVirtual(clazz, "test9_target2", test9_mt); MethodHandle test9_mh3 = lookup.findVirtual(clazz, "test9_target3", test9_mt); MethodType test9_mt2 = MethodType.methodType(boolean.class); MethodHandle test9_mh_test1 = lookup.findVirtual(clazz, "test9_test1", test9_mt2); MethodHandle test9_mh_test2 = lookup.findVirtual(clazz, "test9_test2", test9_mt2); test9_mh = MethodHandles.guardWithTest(test9_mh_test1, test9_mh1, MethodHandles.guardWithTest(test9_mh_test2, test9_mh2, test9_mh3)); ! MethodType test10_mt = MethodType.methodType(MyValue2.class); MethodHandle test10_mh1 = lookup.findStatic(clazz, "test10_target1", test10_mt); test10_mh2 = lookup.findStatic(clazz, "test10_target2", test10_mt); test10_mh3 = lookup.findStatic(clazz, "test10_target3", test10_mt); MethodType test10_mt2 = MethodType.methodType(boolean.class); ! MethodType test10_mt3 = MethodType.methodType(MyValue2.class); MethodHandle test10_mh_test1 = lookup.findStatic(clazz, "test10_test1", test10_mt2); MethodHandle test10_mh_test2 = lookup.findStatic(clazz, "test10_test2", test10_mt2); test10_mh = MethodHandles.guardWithTest(test10_mh_test1, MethodHandles.dropArguments(test10_mh1, 0, MethodHandle.class, MethodHandle.class), MethodHandles.guardWithTest(test10_mh_test2, --- 96,122 ---- MethodHandle test8_mh_test = lookup.findStatic(clazz, "test8_test", boolean_mt); test8_mh = MethodHandles.guardWithTest(test8_mh_test, MethodHandles.dropArguments(test8_mh1, 0, MethodHandle.class), MethodHandles.invoker(myvalue2_mt)); ! MethodType test9_mt = MethodType.methodType(MyValue3.class.asValueType()); MethodHandle test9_mh1 = lookup.findVirtual(clazz, "test9_target1", test9_mt); MethodHandle test9_mh2 = lookup.findVirtual(clazz, "test9_target2", test9_mt); MethodHandle test9_mh3 = lookup.findVirtual(clazz, "test9_target3", test9_mt); MethodType test9_mt2 = MethodType.methodType(boolean.class); MethodHandle test9_mh_test1 = lookup.findVirtual(clazz, "test9_test1", test9_mt2); MethodHandle test9_mh_test2 = lookup.findVirtual(clazz, "test9_test2", test9_mt2); test9_mh = MethodHandles.guardWithTest(test9_mh_test1, test9_mh1, MethodHandles.guardWithTest(test9_mh_test2, test9_mh2, test9_mh3)); ! MethodType test10_mt = MethodType.methodType(MyValue2.class.asValueType()); MethodHandle test10_mh1 = lookup.findStatic(clazz, "test10_target1", test10_mt); test10_mh2 = lookup.findStatic(clazz, "test10_target2", test10_mt); test10_mh3 = lookup.findStatic(clazz, "test10_target3", test10_mt); MethodType test10_mt2 = MethodType.methodType(boolean.class); ! MethodType test10_mt3 = MethodType.methodType(MyValue2.class.asValueType()); MethodHandle test10_mh_test1 = lookup.findStatic(clazz, "test10_test1", test10_mt2); MethodHandle test10_mh_test2 = lookup.findStatic(clazz, "test10_test2", test10_mt2); test10_mh = MethodHandles.guardWithTest(test10_mh_test1, MethodHandles.dropArguments(test10_mh1, 0, MethodHandle.class, MethodHandle.class), MethodHandles.guardWithTest(test10_mh_test2,
*** 136,146 **** } } public static void main(String[] args) throws Throwable { TestMethodHandles test = new TestMethodHandles(); ! test.run(args, MyValue1.class, MyValue2.class, MyValue2Inline.class, MyValue3.class, MyValue3Inline.class); } // Everything inlined final MyValue3 test1_vt = MyValue3.create(); --- 136,146 ---- } } public static void main(String[] args) throws Throwable { TestMethodHandles test = new TestMethodHandles(); ! test.run(args, MyValue1.class.asValueType(), MyValue2.class.asValueType(), MyValue2Inline.class.asValueType(), MyValue3.class.asValueType(), MyValue3Inline.class.asValueType()); } // Everything inlined final MyValue3 test1_vt = MyValue3.create();
< prev index next >